-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breaking-Change-Request: Forbid publishing of packages with git or third party hosted dependencies #36765
Comments
Could this be opt-in (or at least opt-out) for packages published to a private pub repository? If it was opt-in it would be non-breaking for that use case while still giving the gentle suggestion that git dependencies aren't the greatest idea |
@travissanderson-wf, I think we will enforce this server-side on |
Oh I see, I thought it was getting baked into the |
It might be worthwhile to make the |
As long as the client forwards the failure reason received from the server, that is true |
Request: @Hixie @matanlurey @dgrove for approval. |
seems reasonable |
LGTM |
I using git hosted dependency for the use case @jonasfj describe which is I made a PR on flutter camera plugin and need that for my package to work. So I'm using my fork directly as dependency.
So pub will become trash with mostly _ not maintained anymore because only use until that PR was merged :/ and as we can't delete once it's published it will become a nightmare after some time quick imho |
@jaumard, yes, this is the downside, but usage of Alternatively, you could also wait until the patch has landed upstream. Or vendor the patched dependency in |
I recently started to use a git hosted package to keep my preferred lint rules in sync across packages: https://github.com/pschiffmann/pedantic-pschiffmann.dart In my packages, I add this to my dev_dependencies:
pedantic_pschiffmann:
git:
url: https://github.com/pschiffmann/pedantic-pschiffmann.dart
ref: 97fab6223f4e367ccfade79f998bfc137e2e6131 ... and this to my This is not a package I'd publish on pub, because my lint rules are personal preference and not very useful to someone else; but after I change my mind and add or remove a rule, I want to do so in all my projects. Of course, I can just comment out that dependency before publishing to pub, I don't have strong feelings about this. I just thought I'd share my setup. And if you believe it's a legitimate use case for git dependencies, maybe you could continue to allow them in |
You can find many people who publish their personal linter preferences on npm :) I am inclined to not care about what goes into |
@matanlurey any objections to this, if applicable. |
No concerns from Matan. Jonas - I am assigning this back to you for landing. |
Changes for this have landed server-side and has been deployed to pub.dev. It's no longer possible to publish new packages with git dependencies. |
* This change is being enforced server-side on pub.dev. * This CHANGELOG entry is added for compliance with `docs/process/breaking-changes.md`. Change-Id: I9e10c4f224e084db6b6c78d637bb01a2a59565b3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108409 Reviewed-by: Sigurd Meldgaard <sigurdm@google.com> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com> Auto-Submit: Jonas Jensen <jonasfj@google.com>
This was announced through breaking change process in: dart-lang/sdk#36765 It serves to ensure that dependencies of a package cannot become unavailable in the future. Thus, if you can `pub get` something once, then you can `pub get` the exact same thing if you retain the `pubspec.lock`. Existing packages with git dependencies remain on `pub.dev`, but new packages containing git dependencies will not be permitted.
This was announced through breaking change process in: dart-lang/sdk#36765 It serves to ensure that dependencies of a package cannot become unavailable in the future. Thus, if you can `pub get` something once, then you can `pub get` the exact same thing if you retain the `pubspec.lock`. Existing packages with git dependencies remain on `pub.dev`, but new packages containing git dependencies will not be permitted.
This was announced through breaking change process in: dart-lang/sdk#36765 It serves to ensure that dependencies of a package cannot become unavailable in the future. Thus, if you can `pub get` something once, then you can `pub get` the exact same thing if you retain the `pubspec.lock`. Existing packages with git dependencies remain on `pub.dev`, but new packages containing git dependencies will not be permitted.
@jonasfj I just saw this is in the pipeline. I have a question related to internal/private instances of pub.dev for corporate/government use. I don't have a project that depends on this, but I patched a project, web-server, to point to a fork I made of dart2_constant that @nex3 used to maintain. It now sits in dart-archive. I would love if my changes could make it in there. But I doubt it. Anyway... My company is still using Angular 4, thus Dart 1.0. The client is government and has a lot of resistance to upgrading new technology like Dart they are unfamiliar with. So my question is, will this setting (allow git dependencies) be configurable if we clone pub.dev and setup our own internal version of it so we can maintain packages even if they depend on git repos? |
@Stargator, |
@jonasfj It does, thank you. I didn't catch that it was on the server end. I'll have to go back and look at the change. |
It is currently possible to publish packages to
pub.dartlang.org
which havedependencies that are fetched from
git
or a third party hosted pub repository.Rationale: This is undesirable as the contents of these dependencies can change, moreover, they might be unavailable at some point in the future. This could happen as a
result of someone deleting or changing their github repo- or username.
Impact: As of April 8th there was around 52 packages whose latest version
had a dependency on a git repository or third-party package repository. About
half of these were last published more than a year ago (before Dart 2.0).
Currently, published packages will remain, we merely forbid publishing of
new packages with git or third party pub repository dependencies. We may
remove these at a later date.
Mitigation: Git dependencies have largely been used to fork an existing
package, and then depend on the git repository until upstream merges the patch.
Going forward we recommend that forked packages be published under a new name
(for example,
<github username>_<packageName>
).The text was updated successfully, but these errors were encountered: