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

get-api 1.0.9 #175582

Merged
merged 1 commit into from
Jun 6, 2024
Merged

get-api 1.0.9 #175582

merged 1 commit into from
Jun 6, 2024

Conversation

ikurek
Copy link
Contributor

@ikurek ikurek commented Jun 2, 2024

After making any changes to a cask, existing or new, verify:

Additionally, if adding a new cask:

  • Named the cask according to the token reference.
  • Checked the cask was not already refused (add your cask's name to the end of the search field).
  • Checked the cask is submitted to the correct repo.
  • brew audit --cask --new <cask> worked successfully.
  • HOMEBREW_NO_INSTALL_FROM_API=1 brew install --cask <cask> worked successfully.
  • brew uninstall --cask <cask> worked successfully.

@ikurek
Copy link
Contributor Author

ikurek commented Jun 2, 2024

I was not sure how to handle the versioning in this case - the URL is unversioned but it's possible to do brew livecheck with plist file, so I set the version to currently available one with the livecheck enabled

@krehel
Copy link
Member

krehel commented Jun 3, 2024

There is a Sparkle feed, but it appears to return a 403 unless some custom headers are provided (at least for me.) It's fronted by Cloudflare.

It also contains a versioned URL for use.

Tagging @samford for his inputs

@ikurek
Copy link
Contributor Author

ikurek commented Jun 3, 2024

It seems that https://getapi.io/osx/version.xml url is for internal use only, I wasn't able to access it (the same 403 error). I've also added auto_updates true in 0d26847 since there is a built-in option to install an update

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.

The unversioned cask URL (https://getapi.io/release/osx/getapi_latest) redirects to a versioned URL (https://files.getapi.io/macos/1.0.8/Get%20API.dmg) but only if you use a GET request.

Utils::Curl#curl_headers (which livecheck uses) contains some logic to retry a failing request using GET (instead of HEAD) but it doesn't work with the resulting response because the exit status is 8 ("weird server reply"). If we treat that as a usable response (like we do with 22), then we can use strategy :header_match here instead.

I was looking into this issue recently as I've seen ~22 other casks where HeaderMatch isn't working for the same reason. I created a tentative fix but I needed to finish going through the others before creating a PR. I just finished a minute ago, so here's the brew PR: Homebrew/brew#17412

If/when that's merged, we can update this PR to use strategy :header_match instead. Unless there's a reason not to, we may want to try using the versioned dmg URL as well.

@miccal miccal changed the title getapi 1.0.8 get-api 1.0.8 Jun 4, 2024
@samford samford changed the title get-api 1.0.8 get-api 1.0.9 Jun 5, 2024
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.

I pushed a commit to use the versioned dmg URL (from the getapi_latest redirection) and to update this to 1.0.9.

The brew PR to allow Utils::Curl#curl_headers to handle an 8 exist status ("weird server reply") has been merged, so I've updated the livecheck block to use the getapi_latest URL with the HeaderMatch strategy.

The existing `getapi_latest` URL redirects to a versioned dmg when
retrieved using a `GET` request, so this updates the cask `url` to
use the versioned URL instead.

A recent brew change in `Utils::Curl` allows us to use `HeaderMatch`
with the `getapi_latest` URL to successfully retrieve the latest
version without checking a different source (e.g., GitHub).
@miccal miccal added the ready to merge PR can be merged once CI is green label Jun 5, 2024
@miccal miccal merged commit 654bf97 into Homebrew:master Jun 6, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new cask ready to merge PR can be merged once CI is green
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants