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

Remove url do blocks #186501

Merged
merged 8 commits into from
Sep 25, 2024
Merged

Remove url do blocks #186501

merged 8 commits into from
Sep 25, 2024

Conversation

Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Sep 24, 2024

This PR removes the url do blocks that remain in homebrew/cask. These will be disallowed in official taps soon. See Homebrew/brew#18390 for more context, but essentially we want these removed for formulae.brew.sh API generation.

To be honest, this is the first time I've really played with livechecks, so let me know if those aren't correct.

Copy link
Member

@samford samford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work for your first time working with livecheck blocks 👍

If you agree with these comments/suggestions, I can push commits tomorrow to save you from having to commit/implement changes.

Casks/d/[email protected] Outdated Show resolved Hide resolved
Casks/k/[email protected] Outdated Show resolved Hide resolved
Casks/t/[email protected] Outdated Show resolved Hide resolved
Casks/t/[email protected] Outdated Show resolved Hide resolved
Casks/t/[email protected] Outdated Show resolved Hide resolved
Casks/v/[email protected] Outdated Show resolved Hide resolved
@Rylan12
Copy link
Member Author

Rylan12 commented Sep 25, 2024

If you agree with these comments/suggestions, I can push commits tomorrow to save you from having to commit/implement changes.

Please feel free to do that!

Also, worth noting that all of these except dolphin@dev are set to be deprecated in a few months, so it may not be worth spending too much of your time perfecting them for longevity.

@MikeMcQuaid
Copy link
Member

Also, worth noting that all of these except dolphin@dev are set to be deprecated in a few months, so it may not be worth spending too much of your time perfecting them for longevity.

Agreed 👍🏻

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to go when you are. As mentioned: not worth spending more than the minimal possible time on anything due to be deprecated soon.

MikeMcQuaid added a commit to Homebrew/brew that referenced this pull request Sep 25, 2024
We're removing these in
Homebrew/homebrew-cask#186501
so let's deprecate them too.
Rylan12 and others added 8 commits September 25, 2024 13:20
The directories that precede the dmg file are different for each
build, so we also need to capture those and store them in the cask
`version`.
All of the recent snapshot builds of `keepassxc` use a 2.8.0 version
in the filename. If we use the dmg file in the `/latest/` directory
and the version doesn't change between builds, then we will get a
checksum mismatch when the build is updated. Instead, we have to use
a fully-versioned URL that uses a build directory instead, as this
will remain static between builds.

Similarly, `/latest/` is an actual directory and not just a url that
redirects to the latest build, so checking the dmg file in that
directory won't give us the full URL with the build number in it.
With this setup, we have to find the newest build directory number
on the main snapshots page, then check the directory listing page
for that build directory to find the version in the dmg file name.
File names for nightly `transmission` releases only include a hash
but we also need the build number to be able to use a fully-versioned
URL. Using a `lastSuccessfulBuild` dmg URL would result in a 404 (Not
Found) response when the next build occurs, as the expected file
won't be available anymore. With that in mind, we need to use a
build-specific dmg URL.

This updates the cask to include the build number in the `version`
and to capture that information in the `livecheck` block regex.
Unfortunately the dmg URL on the `lastSuccessfulBuild` page doesn't
use a build number but we can identify the build number from other
areas of the page.
The file name version has remained consistent from the start of this
year (at least) but we should capture it in the `livecheck` regex
and include it in the cask `version`, so we can easily version bump
the cask if/when the version changes in the future.

Besides that, this reworks the `livecheck` block's `strategy` block
to better align with existing standards/patterns.
@samford
Copy link
Member

samford commented Sep 25, 2024

Pushed some commits to incorporate the suggestions/ideas above, so these should be good to go but do check my work. Some of these had version updates in the interim time, so I updated those in the process.

Considering that we were able to successfully use versioned URLs and create working livecheck blocks, I imagine these may have been using url do as a way of not having to deal with frequent version bumps for these casks (due to a fast release cadence). url do is a technical nuisance but I imagine this change may increase maintainer burden to some degree (until/unless there's a version throttling solution for casks).

@p-linnane p-linnane merged commit 993ae76 into master Sep 25, 2024
14 checks passed
@p-linnane p-linnane deleted the remove-url-do branch September 25, 2024 17:34
@Rylan12
Copy link
Member Author

Rylan12 commented Sep 25, 2024

Thanks @samford!

MikeMcQuaid added a commit to Homebrew/brew that referenced this pull request Sep 26, 2024
We're removing these in
Homebrew/homebrew-cask#186501
so let's deprecate them too.
kdesysadmin pushed a commit to KDE/homebrew-kde that referenced this pull request Nov 3, 2024
URL stanzas are deprecated in favor of livecheck:
Homebrew/homebrew-cask#186501

This pins the current latest version of `master` and adds a livecheck
stanza to make updating easier. In the future if this were upstreamed to
`homebrew-cask`, I believe the BrewTestBot could automatically update
the version + sha256 using this livecheck.

Reviewed-by: Yurii Kolesnykov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants