-
-
Notifications
You must be signed in to change notification settings - Fork 206
Add pubspec.lock
to repository
#749
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
Comments
Thanks for opening this issue!
|
Since it won't be published to pub.dev (I think regardless of
|
Sounds good. I was surprised though that even popular dart packages do not have the lock file in their GitHub repo. So despite the arguments I am still hesitant to commit the lock file. |
Where did the issue go, should pubspec.lock be added? |
This is still up for discussion. |
It is generally recommended to include the pubspec.lock file in version control for development purposes. This ensures that all developers have a consistent set of dependencies and versions, which helps to avoid build and runtime errors caused by version conflicts. It also helps to ensure that the same dependencies and versions are used in continuous integration (CI) and deployment environments. However, it is not recommended to include the pubspec.lock file in published packages, as this file contains specific version information that may not be applicable or compatible with other projects. Instead, when publishing a package, it is recommended to only include the pubspec.yaml file and let the package manager generate a new pubspec.lock file for each project that installs the package. This allows for more flexibility and compatibility with different dependency trees. |
Makes sense, how can we not ignore it in GitHub, so that it's in the repo, but then ignore it for release so that it's not pushed to pub.dev? |
I think we should use |
Sounds good to me. |
New Feature / Enhancement Checklist
Current Limitation
The
pubspec.lock
file is not checked in to this repository. This makes development more unstable and testing more volatile. While the lock file should not be published in the registry by convention, it may make sense to check it in for this repository.Why the lock file is not supposed to be published in the registry:
Why it makes sense to check in the lock file for development:
The effect of the above shortcomings is that we never have a reproducible dependency tree. In a CI run, tests may pass in one job and fail in the next job if in the meantime a new version has been published with a bug. It makes collaboration on the SDK more difficult for the Parse Platform community, as N developers may use N different dependency trees when working on the same PR, and the GitHub CI tests may even use a N+1'th version of the dependency tree, each one using their own lock file.
Feature / Enhancement Description
pubspec.lock
from.gitignore
so that it is checked in to this repository for development.pubspec.lock
to.pubignore
so that it is not published in the registry as part of the package.What we'd have to do manually is delete the lock file form time to time, e.g. with a new release and upgrade it in a controlled way. It can even be part of a PR where the developer regenerates the lock file. That way we have dependency consistency across our development pipeline.
Example Use Case
n/a
Alternatives / Workarounds
Live with the above mentioned risks, as seems to be accepted in dart ecosystem. Of the few pub.dev packages I've checked not a single one had their lock file in the GitHub repository.
The text was updated successfully, but these errors were encountered: