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

cmd/audit: fix type error in cask livecheck url audit #16443

Conversation

apainintheneck
Copy link
Contributor

@apainintheneck apainintheneck commented Jan 7, 2024

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

This got updated recently in 42a42c9 to split out the livecheck audits and as a result of that the type signature for the #validate_url_for_https_availablity method got updated.

This did not account for the possibility that the livecheck url was nil. I've added a nil check here since it makes no sense to try and validate a nil url and we have nil checks for the other two http availability audits already. Plus, the livecheck blocks are audited thoroughly already for syntax.

This should fix the audit error mentioned in #16438 (comment).

CC: @reitermarkus @bevanjkay

This got updated recently in 42a42c9
to split out the livecheck audits and as a result of that the type
signature for the #validate_url_for_https_availablity method got updated.

This did not account for the possibility that the livecheck url was nil.
I've added a nil check here since it makes no sense to try and validate
a nil url and we have nil checks for the other two http availability
audits already. Plus, the livecheck blocks are audited thoroughly already
for syntax.
@apainintheneck apainintheneck added bug Reproducible Homebrew/brew bug critical Critical change which should be shipped as soon as possible. labels Jan 8, 2024
@apainintheneck apainintheneck merged commit b3751bc into Homebrew:master Jan 8, 2024
26 checks passed
@MikeMcQuaid
Copy link
Member

Thanks @apainintheneck!

@reitermarkus
Copy link
Member

Thanks!

So when is the url nil exactly? When there is a livecheck without a url?

I'm confused how it happened for Homebrew/homebrew-cask#163945 given there is a livecheck with a url.

@bevanjkay
Copy link
Member

bevanjkay commented Jan 8, 2024

It was on a monterey runner which has

livecheck do
  skip "Legacy version"
end

@github-actions github-actions bot added the outdated PR was locked due to age label Feb 8, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/brew bug critical Critical change which should be shipped as soon as possible. outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants