-
Notifications
You must be signed in to change notification settings - Fork 842
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
Detect when git commit refs are unlikely to be SHAs #3535
Comments
Thanks for the heads up about this issue. Unless a non-SHA ref can be resolved and the SHA version used to replace it, I agree that snapshots should never use them. Working within the new extensible snapshots framework, it becomes simple enough to override a fixed snapshot SHA with a local stack.yaml SHA. Is there ever a reason to support branch identifiers in a stack.yaml file, rather than SHA? On the other hand, one potential difficulty with git repos in snapshots is that they are not immutable. This affects SHA in addition to branches, although with the former at least git won't pick the wrong commit. I haven't yet tested an extensible snapshot with an SHA that can't be resolved; I would imagine the git checkout step would fail. The point is, even using SHA doesn't solve all the problems. Incidentally, the user interface could help simplify this. Ideal scenario is a command, say Furthermore, it would be helpful to know that a git repo contains the desired SHA before downloading. This may require github/lab/bitbucket/etc specific code. In any case, I hope this contribution helps the final extensible-snapshot design. As a user, I'm keen that something doesn't build by default if there are issues (say the SHA can't be found) but that it is possible, with minimal work, to override and fix this. |
What about tags? Unlike branches they usually don't change, and something like "version-1.3" is a lot more human friendly than a SHA. |
Since my comment, a great deal has changed. Thanks to pantry, the way the implementation of stack handles git dependencies has changed. See #4288 for the most relevant part to this discussion. I believe it is likely to allow a workflow like what you have proposed, @torgeirsh. |
Currently, if you have a git ref which is not a SHA, such as
Then it leads to non-reproducible builds, because you will just get the most recent version of the repo. Perhaps less expected, is that it will not attempt to update the repo, instead it will just use the version that you have. This is documented:
Since git dependencies can now be shared via extensible snapshots, it seems even more dangerous to have non SHA refs. Should warn about this, and perhaps refuse to share such packages.
The text was updated successfully, but these errors were encountered: