podman: add livecheck, update stable url#205162
Conversation
96f739c to
7a3b1b9
Compare
There was a problem hiding this comment.
If the issue is only that there can be a notable span of time between when a version is tagged and when the corresponding GitHub release is created, we can simply use the GithubLatest strategy. I've added suggestions to bring this in line with similar checks.
Upstream created a 5.3.2 release less than an hour ago (~18 hours after the tag) but the homepage is still referring to 5.3.1. If we specifically need to match the version from the homepage instead of using the latest GitHub release, then I can add a different suggestion to bring the regex up to standard.
Thanks for the review! My main motivation was to have livecheck consider the new version only based on what's on the website. It looks from containers/podman.io#364 like the website will similarly be not far behind a GH release, but that it's not totally automated. I see autobump PRs (for various formulae) where folks will hold off and consider it a prerelease if the website hasn't yet updated.. and then need to check back on it later. If we still want to consider the website as the best source of truth, I figured that this might be preferable over using the |
Yeah, we really need to make a decision what to do there. It was my understanding that we stopped doing GH latest because of rate limits. That's why I thought we should start using websites instead. |
That's partly where I came from as well.. our docs suggest to not use them unless we really need to, and it looks to me like in the case of podman, the website livecheck is feasible. |
|
FWIW the Podman team considers the upstream GH release as the official "release" time, regardless of when the tag is pushed or the website is updated. Although we do guarantee the website will be updated after the upstream release. |
Thanks! I was going to open an upstream issue to ask for clarification of the release process, so you've saved me the trouble. Short version: It sounds like Long version:
We only use Checking the upstream website is another way to address this situation and it can make sense if the website is kept up to date and they link to GitHub (ideally a specific release). If The reason why I suggested
When maintainers leave a comment like "Not the latest release yet" for a formula that's using a GitHub tag or tag tarball and the repository uses GitHub releases, that's often because livecheck is surfacing a new version from a Git tag but the GitHub release hasn't been created yet. Even though the formula only uses a tag or tag tarball, we wait for the release because some upstream projects feel comfortable retagging a version before the release is created and we would end up with a checksum mismatch. In a perfect world, we would have livecheck check GitHub releases for all projects that use them but that could lead to rate limit issues and break CI (the token is used for more than livecheck) or lead to issues when running lots of checks locally (e.g.,
We've gone through a few different phases over the years but we've been pretty consistent about only using Eventually we introduced the I haven't seen rate limit issues when checking github.com release pages for years but now |
From what I see in core most maintainers just check the releases manually because they're worried about using the latest livecheck with the way the documentation is written. If we can add more of them, I think the documentation should reflect that. If we can't, we should find a way to work around that. |
|
Thanks for taking the time to explain all these details :)
Given that, and I'm in agreement that the webpage livecheck is more brittle (and maybe moreso in the current form). It sounds like GitHub releases are generally treated as canonical and that in this case the GithubLatest check suffices since the ordering is predictable, and so that this case it fits the convention used in other formulae. I see for podman specifically there can be some Maybe there is a separate side discussion to have about whether we could track API ratelimit usage over time or do some spot-checks to see whether or not there is much wiggle room (IOW, whether there is sufficient headroom or if it should be more of a concern). When I get a chance tomorrow I'll fix up this PR with those changes, and from what I understand in switching the |
Upstream marks those as pre-release, so we don't have to worry about them being the "latest" release (provided upstream remains consistent).
The situation in this PR is covered by the existing documentation (i.e., we're using I agree that using We should also make sure that livecheck, bump, and related tooling/workflows don't make API requests after exceeding the rate limit. Currently In general, using I have some ideas on how we can potentially reduce the number of GitHub API requests that livecheck makes on CI but those ideas would take some notable work to implement (we have to lay some groundwork to make it possible), so it's not something that will change in the immediate-term. If we want to go down this path, I can create an issue to discuss this in more detail, as this is beyond the scope of this PR (and continuing the discussion here would make it hard to find in the future). In the near-term, I agree with Tim that we should look into how much of the rate limit we're typically using at the moment. It would also be great to know how much is attributable to livecheck, if possible. |
|
I think what I mostly want to know is: next time a maintainer finds that a release is a pre-release. Are they free to change the livecheck to GitHub latest to avoid having to check manually in the future, yes or no? |
7a3b1b9 to
fdeb956
Compare
It depends. If a formula has a # There can be a notable gap between when a version is tagged and a
# corresponding release is created, so we check the "latest" release instead
# of the Git tags.
livecheck do
url :stable
strategy :github_latest
endWe could consider revising this approach (or making exceptions) if there are formulae where we regularly run into this issue and the gap is less than an hour (but ideally still more than 30 minutes). An hour is just a general guideline, so we don't overuse the GitHub strategies (for now) simply because there's a short gap between tag/release and the PR happens to be created shortly after the version is tagged or the current release is slower than usual. When it comes to formulae where the This is something we've been doing since ~2020 but I haven't documented it partly because I didn't want it to be misinterpreted as an invitation to use the GitHub strategies broadly (i.e., until we're in a position where we can do so without it affecting CI, using them too little is safer than too much). I also initially received feedback about the livecheck documentation being long (and doing too much handholding) when I created it, so the Rui may be the only homebrew/core maintainer (besides myself) who creates this type of For some stats:
If we look into our rate limit usage and find that we always have more than enough to spare, we could consider adding When we go down that path, I could either handle those all at once (making it easier to revert if we run into rate limits) or roll them out in smaller batches (e.g., 100 at a time) with a day or more between PRs, so we can watch how the changes affect the rate limit before proceeding to the next batch. If we run into rate limit issues, we'll have to defer it until after we've made changes to improve the rate limit situation on CI. This would more than double the number of related checks, so a batched approach is likely better. To be clear, some of those require more than just |
Except we don't, see for example: #205107 and I know there are a bunch more like this. I'm also skipping over parts of your answer because I simply don't have time to read everything right now. |
I saw Though we have some maintainers who are vaguely aware of those guidelines, they're not documented and only loosely followed or enforced. As always, we can't expect adherence unless there's documentation and Rubocops. I'm working on expanding livecheck Rubocops and I should be able to add one to ensure there's an explanatory comment before the |
|
🤖 An automated task has requested bottles to be published to this PR. |
HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where<formula>is the name of the formula you're submitting?brew test <formula>, where<formula>is the name of the formula you're submitting?brew audit --strict <formula>(after doingHOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it passbrew audit --new <formula>?podman can push a tag for some time before the official release.
This
livecheckaims to capture the version from the href that will link out to GH releases, like this:My first time doing any
livecheckadditions, LMK if there's anything unusual I'm doing here!