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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action fails with "No available formula" #51

Closed
derrabus opened this issue Feb 22, 2023 · 6 comments 路 Fixed by phrase/openapi#297
Closed

Action fails with "No available formula" #51

derrabus opened this issue Feb 22, 2023 · 6 comments 路 Fixed by phrase/openapi#297

Comments

@derrabus
Copy link

Hello. 馃憢馃徎

PHPStan uses your very helpful GitHub action to bump their Homebrew package on each release. It has served us well for a while, but recently it started to fail:

Error: No available formula with the name "phpstan".

Examples:

This is the workflow, PHPStan is using: https://github.com/phpstan/phpstan/blob/34881e639fcadb85cbca23dfae27afbb783102ac/.github/workflows/release-homebrew.yml

Bumping the formula manually on a Mac, running brew bump-formula-pr --version 1.10.0 phpstan still works.

@ondrejmirtes
Copy link

Last successful run: https://github.com/phpstan/phpstan/actions/runs/4204946177

I'm not sure if that's the reason for the failures, but I'm not sure about this line:

revision: ${{ github.event.release.target_commitish }}

GitHub Actions put 1.10.x there (even for releases on 1.9.x), but it should be a commit SHA instead?

@dawidd6
Copy link
Owner

dawidd6 commented Feb 22, 2023

In the successful run we have:

==> Fetching /home/linuxbrew/.linuxbrew/Homebrew...
From https://github.com/Homebrew/brew
 * [new branch]          faster_tests     -> origin/faster_tests
   ebed4f564..a59f5eb52  master           -> origin/master
 * [new branch]          type-requirement -> origin/type-requirement
 * [new tag]             3.6.21           -> 3.6.21
 * [new tag]             4.0.0            -> 4.0.0
 * [new tag]             4.0.1            -> 4.0.1

==> Resetting /home/linuxbrew/.linuxbrew/Homebrew...
Switched to and reset branch 'master'
branch 'master' set up to track 'origin/master'.
Your branch is up to date with 'origin/master'.

==> Fetching /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core...
From https://github.com/Homebrew/homebrew-core
   fea3[23](https://github.com/phpstan/phpstan/actions/runs/4204946177/jobs/7296330987#step:2:26)3bc2c..c2f709e[26](https://github.com/phpstan/phpstan/actions/runs/4204946177/jobs/7296330987#step:2:29)eb  master     -> origin/master

==> Resetting /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core...
Reset branch 'master'
branch 'master' set up to track 'origin/master'.

In the failed run we only have:

==> Fetching /home/linuxbrew/.linuxbrew/Homebrew...
From https://github.com/Homebrew/brew
   8ff2e29aa..853b33bcd  master           -> origin/master
 * [new branch]          shellcheck-shfmt -> origin/shellcheck-shfmt
 * [new branch]          sponsors-maintainers-man-completions -> origin/sponsors-maintainers-man-completions
 * [new tag]             4.0.2            -> 4.0.2
 * [new tag]             4.0.3            -> 4.0.3

==> Resetting /home/linuxbrew/.linuxbrew/Homebrew...
Switched to and reset branch 'master'
branch 'master' set up to track 'origin/master'.
Your branch is up to date with 'origin/master'.

There seems to be no core-tap on Ubuntu runner images anymore and it is most likely a bug in brew after transition to installing from API.

@dawidd6
Copy link
Owner

dawidd6 commented Feb 22, 2023

I can reproduce this in container:

linuxbrew@79a9a22eb3a3:~$ brew tap             
homebrew/core
linuxbrew@79a9a22eb3a3:~$ brew untap homebrew/core
Untapping homebrew/core...
Untapped 3 commands and 6533 formulae (6,885 files, 601.0MB).
linuxbrew@79a9a22eb3a3:~$ brew tap
linuxbrew@79a9a22eb3a3:~$ brew bump-formula-pr --version=1.20.0 phpstan
Warning: bump-formula-pr is a developer command, so Homebrew's
developer mode has been automatically turned on.
To turn developer mode off, run:
  brew developer off

Error: No available formula with the name "phpstan".
linuxbrew@79a9a22eb3a3:~$ brew tap homebrew/core
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

==> Tapping homebrew/core
Cloning into '/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 1422011, done.
remote: Counting objects: 100% (750/750), done.
remote: Compressing objects: 100% (339/339), done.
remote: Total 1422011 (delta 430), reused 724 (delta 411), pack-reused 1421261
Receiving objects: 100% (1422011/1422011), 546.14 MiB | 10.55 MiB/s, done.
Resolving deltas: 100% (991979/991979), done.
Tapped 3 commands and 6534 formulae (6,886 files, 600.8MB).
linuxbrew@79a9a22eb3a3:~$ brew bump-formula-pr --version=1.20.0 phpstan
==> Downloading https://github.com/phpstan/phpstan/releases/download/1.20.0/phpstan.phar
curl: (22) The requested URL returned error: 404                              

Error: Failed to download resource "phpstan"
Download failed: https://github.com/phpstan/phpstan/releases/download/1.20.0/phpstan.phar

Ideally this should be fixed in brew, a "costly" workaround for you (for now) would be to execute brew tap homebrew/core before the Action. Also another option is to transform this Action to be a container-based one, or you could run it in container yourself (look at the workflows in this repo for example).

@dawidd6
Copy link
Owner

dawidd6 commented Feb 22, 2023

Anyway, this commit 0a4c212 should fix this but will also prolong the Action execution I'm afraid.

@derrabus
Copy link
Author

Thank you for analyzing and fixing the issue. As soon as PHPStan makes another release, we'll know if it worked. 馃檪

@derrabus
Copy link
Author

The last release successfully triggered a formula bump:

Thank you very much for the quick fix! I'm closing the issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants