Skip to content

Comments

{CI} Fix homebrew formula test by creating dummy homebrew tap#32162

Merged
bebound merged 1 commit intoAzure:devfrom
bebound:fix-test-formula
Sep 29, 2025
Merged

{CI} Fix homebrew formula test by creating dummy homebrew tap#32162
bebound merged 1 commit intoAzure:devfrom
bebound:fix-test-formula

Conversation

@bebound
Copy link
Contributor

@bebound bebound commented Sep 24, 2025

Description

Test Homebrew Formula task fails with

== Install azure-cli.rb formula ==
Error: Homebrew requires formulae to be in a tap, rejecting:
  /Users/runner/work/1/a/homebrew/azure-cli.rb (/Users/runner/work/1/a/homebrew/azure-cli.rb)

To create a tap, run e.g.
  brew tap-new <user|org>/<repository>
To create a formula in a tap run e.g.
  brew create <url> --tap=<user|org>/<repository>

Homebrew 4.6.0 prohibits installing formula from path, see Homebrew/brew#20521. Need to create a dummy tap then install it.

Testing Guide

Task passed at
https://dev.azure.com/azclitools/public/_build/results?buildId=273283&view=logs&jobId=ebe8970d-a8af-5d7e-4086-8f4ce0be006b&j=ebe8970d-a8af-5d7e-4086-8f4ce0be006b&t=3f22f999-770c-5d06-3bb8-1a936f5d8384

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Sep 24, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd
Copy link

Hi @bebound,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Sep 24, 2025

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Collaborator

yonzhan commented Sep 24, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>


echo == Install azure-cli.rb formula ==
brew install --build-from-source $SYSTEM_ARTIFACTSDIRECTORY/homebrew/azure-cli.rb
# Need to create a dummy homebrew tap to install the formula
Copy link
Contributor Author

@bebound bebound Sep 24, 2025

Choose a reason for hiding this comment

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

This method is found in Homebrew/brew#18371 (comment)

It also mentions that:

Yea, installing formulae from paths is buggy and shouldn't be used. We should probably remove the ability to do that at some point.

So creating a tap is the recommended way to install formula.

PS: Setting HOMEBREW_DEVELOPER=1 is a another workaround but the owner says it changes a lot of the behaviour of Homebrew: Homebrew/brew#20414 (comment).

Copy link
Member

Choose a reason for hiding this comment

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

Homebrew keeps changing. We may want to release a ZIP or tar.gz package as soon as possible.

brew install --build-from-source $SYSTEM_ARTIFACTSDIRECTORY/homebrew/azure-cli.rb
# Need to create a dummy homebrew tap to install the formula
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
Copy link
Contributor Author

@bebound bebound Sep 24, 2025

Choose a reason for hiding this comment

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

tap-new requires Git user information; otherwise, the following error occurs:

linuxbrew@5ef95ab56d08:~$ brew tap-new dev/azure-cli
Warning: tap-new is a developer command, so Homebrew's
developer mode has been automatically turned on.
To turn developer mode off, run:
  brew developer off

Initialized empty Git repository in /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/dev/homebrew-azure-cli/.git/
Author identity unknown

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'linuxbrew@5ef95ab56d08.(none)')

PS: Although brew tap-new enables developer mode, it's not equal to HOMEBREW_DEVELOPER=1. Formula can't be installed directly from a path, even if developer mode is on.

git config --global user.name "Your Name"
brew tap-new dev/azure-cli
cp $SYSTEM_ARTIFACTSDIRECTORY/homebrew/azure-cli.rb $(brew --repository)/Library/Taps/dev/homebrew-azure-cli/Formula/
brew install --build-from-source dev/homebrew-azure-cli/azure-cli
Copy link
Contributor Author

Choose a reason for hiding this comment

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

--build-from-source is required. Otherwise, brew tries to install azure-cli from core repo.

brew install dev/homebrew-azure-cli/azure-cli
==> Fetching downloads for: azure-cli
==> Downloading https://ghcr.io/v2/homebrew/core/azure-cli/manifests/2.77.0
==> Fetching dev/azure-cli/azure-cli
==> Downloading https://ghcr.io/v2/homebrew/core/azure-cli/blobs/sha256:3722168cdfb5ee06e816a2d9e6644feb1e59a8ebe9dfe43858ba6f285b1b4c02
==> Installing azure-cli from dev/azure-cli
==> Pouring azure-cli--2.77.0.sonoma.bottle.tar.gz
🍺  /usr/local/Cellar/azure-cli/2.77.0: 16,043 files, 329.2MB
==> No outdated dependents to upgrade!

@bebound bebound marked this pull request as ready for review September 25, 2025 07:28
Copilot AI review requested due to automatic review settings September 25, 2025 07:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a CI/CD pipeline failure for Homebrew formula testing by addressing a breaking change in Homebrew 4.6.0 that prohibits installing formulas from direct file paths. The fix creates a dummy homebrew tap to enable formula installation.

  • Creates a dummy homebrew tap to comply with Homebrew 4.6.0 requirements
  • Copies the formula file to the tap directory and installs from the tap instead of a direct path

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +672 to +673
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

Using placeholder values for git configuration in CI/CD pipelines is not ideal. Consider using environment variables or more descriptive values like 'ci@azure-cli.local' and 'Azure CLI CI' to better reflect the automated nature of these commits.

Suggested change
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
git config --global user.email "ci@azure-cli.local"
git config --global user.name "Azure CLI CI"

Copilot uses AI. Check for mistakes.
@bebound bebound merged commit e2a6fac into Azure:dev Sep 29, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants