Skip to content
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

source urls cannot be versioned #342

Open
OmarTawfik opened this issue Nov 13, 2022 · 6 comments
Open

source urls cannot be versioned #342

OmarTawfik opened this issue Nov 13, 2022 · 6 comments

Comments

@OmarTawfik
Copy link
Contributor

OmarTawfik commented Nov 13, 2022

A recent update in hermit-packages broke all rust pipelines: cashapp/hermit-packages#235

To avoid this, projects typically fix their dependencies versions. As Hermit docs suggest, this can be done by locking the version of the packages sources they import.

An optional # suffix can be added to checkout a specific tag.

Which suggests something like this:

# hermit.hcl
sources = [
  "https://github.com/cashapp/hermit-packages.git#tag"
]

However, I had the following issues using that feature:

One: hermit-packages does not push tags regularly

For users to stay up to date, there need to be regular tags/versions pushed from this repository. Looking at the existing tags, I find only one index tag that is 6 months old: https://github.com/cashapp/hermit-packages/tags

If pushing tags more regularly is useful for Hermit long-term plans, should it be automated? Otherwise, I suggest supporting any ref in the URL, so that users can specify a specific commit hash (instead of a tag), and update it regularly.

Two: url format is not clear

Now I tried using the following formats, which all failed:

I suggest adding an explicit example of a versioned url in sources array in the documentation, for clarity.

Three: regular updates

Looking at Renovate plugin docs, it is not clear to me if the bot can update tags (or commit hashes) in the sources URLs in hermit.hcl .. Is this a supported scenario?

@alecthomas
Copy link
Collaborator

The problem is actually much more straightforward: the documentation is incorrect and git sources don't support #<ref> at all 🤦‍♂️

We haven't actually thought about pinning the sources before, but this is actually a great idea! I will add support for refs.

alecthomas added a commit that referenced this issue Nov 13, 2022
This was in the documentation but not implemented
(as discovered in #342). `#<tag>` was supported for Git packages, so
I've factored that code out and reused it.

Added an integration test for this, along with a couple of new test helper
functions that should make these kind of tests simpler in the future.
@alecthomas
Copy link
Collaborator

I forgot to add that the Renovate bot does not update source tags, only packages.

@OmarTawfik
Copy link
Contributor Author

@alecthomas Thanks for working on #343 .. Can we add a code example to the docs (this page) of a sources entry using a URL + a specific commit SHA? I will definitely be using this feature as soon as it is released.

I forgot to add that the Renovate bot does not update source tags, only packages.

Not urgent/blocking for me right now, but Is this something on your road map?

@alecthomas
Copy link
Collaborator

Not urgent/blocking for me right now, but Is this something on your road map?

It is not on the roadmap currently, no. Want to file an issue?

@OmarTawfik
Copy link
Contributor Author

Want to file an issue?

Created these two issues, and added more details/comments to them:

@alecthomas
Copy link
Collaborator

Awesome thanks Omar!

spicykay pushed a commit to spicykay/hermit that referenced this issue Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants