-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
livecheck: crates.io strategy #9507
Conversation
d1d7c71
to
8b91b40
Compare
From what I'm seeing, we don't currently have any formulae in homebrew/core that use a crate as the Could you explain a bit about what category of formulae would benefit from this strategy (with examples, if possible)? We usually add a strategy in response to a demonstrated need (i.e., multiple formulae doing something similar in their |
Emphasis on the currently Homebrew/homebrew-core#66697 😁 I'm guessing that asking upstream to retroactively tag commits is no go (#9505 (comment)). And something tells me this isn't an isolated case and we might bump into it again so I decided to take care of it.
So to answer your question, the only category of formulae that would benefit from this strategy are weird ones without tagged releases on Github 🤷 I guess this falls into:
FWIW even though we agree that this was a stupid challenge and it shouldn't land in it was very much worth it. I figured out that all livecheck strategies lack (fake) user agent making them susceptible to data access restrictions like in crates.io case (https://crates.io/policies#crawlers). This brings me to the next question. @samford how do you feel about me doing some actually useful PR ensuring Homebrew's fake Safari user agent is used for all livecheck requests? |
8b91b40
to
11645a3
Compare
Meanwhile, I aligned it with existing strategies by going back to matching URLs using regex and applying stuff from #9510 |
9cc7d16
to
4e1951c
Compare
4e1951c
to
f7fca88
Compare
There was one problematic formula in the past where I floated the idea of switching Let's see how Homebrew/homebrew-core#66697 and #9505 play out before we move forward with this livecheck strategy. If the
I'm glad you asked, as I have some local changes hanging around that address this as part of something larger. I've encountered issues with a small number of other websites in the past, which is why I made sure to add support for user agents as part of working on something else. I haven't created a PR for this yet because I promised not to work on notable livecheck PRs until my open documentation PR is pretty much done (or at least closer to merging). I've been working on the docs PR a lot this week and I'm getting close to pushing a revision, so I should be working on livecheck's internals again very soon. At that time, I'll be creating a bunch of PRs for changes I've been sitting on, so it would be best to hold off for now. Thanks for the offer, though! |
It is kinda comforting to know I'm not the only one that hit that bummer. And you can definitely expect me to fix exotic and things not worth touching 😄
It is equally satisfying to fix things myself or just see them being fixed by others so go ahead and make it better 🚀 |
In light of #9505 being closed without merging, I think we should follow suit here. As mentioned before, we create new strategies based on a demonstrated need in enough formulae/casks and that's not the case here yet. With that in mind, I'm going to close this but feel free to save a patch or stash these changes in case the situation changes in the future. Thanks for your understanding, @vladimyr! |
It was the logical thing to do 👍 |
brew style
with your changes locally?brew tests
with your changes locally?brew man
locally and committed any changes?This adds a new livecheck strategy for software obtained from crates.io. Note that crates.io doesn't let bots access their data (https://crates.io/policies#crawlers) so docs.rs is used instead.