This is not relevant information for third-party taps and requires
network requests to `endoflife.date` so it's best to avoid them
in this case.
Closes https://github.com/Homebrew/brew/issues/17531
- Only two audits were using this: `audit_keg_only_reason` and `audit_text`,
and they weren't using any of its text processing methods, so there's little
reason to keep it around.
- The "`keg_only_reason` shouldn't contain 'HOMEBREW_PREFIX'" audit can easily
be replaced with a RuboCop since that's "just" text parsing.
- The "tests should invoke binaries with `bin/<command>`" audit had to stay as
a FormulaAudit because it requires accessing attributes about the Formula
like its name, aliases, which RuboCop can't get to, but it was easy to move the
singular "read the text in the file" line from `FormulaTextAuditor`.
* tap: take ownership of synced_versions_formulae.json
* formula: add synced_with_other_formulae? logic
Signed-off-by: Michael Cho <michael@michaelcho.dev>
- Some repositories occasionally change their licenses. For example they
release a version of the software with one license and then decide to change
the license later.
- Now that `?ref=` is a parameter to the GitHub Repositories License API,
we can use that in the license audit to check if the license of the specific
release matches the one declared in the formula.
The `#audit_stable_version` check was previously part of
`#audit_revision_and_version_scheme` and duplicates some of the
logic to identify previous version information. To avoid the
duplication, this extracts the logic into a `#committed_version_info`
method that can be called in both audits. The method stores the
information in instance variables, so we don't repeat the collection
process if it has already run.
The "stable version should not decrease" formula audit currently
prevents us from being able to create bottles when downgrading a
formula version. We previously worked around this by bumping
`version_scheme` but this wasn't an intended use case and we now
avoid using it for this purpose.
We can handle simple formula downgrades by reverting changes in a
syntax-only PR but that isn't sufficient when we need new bottles
(i.e., if additional changes have been made to the formula in the
interim time). In the latter case, the only available solution may be
to revert all changes made after the previous version using a
syntax-only PR and then create another PR to reintroduce the other
changes and create new bottles.
To avoid the aforementioned approach, this splits the stable version
audit into a separate method, so we can use `brew audit
--except=stable_version` to selectively skip it.
Ensure that `FormulaVersions` correctly also looks at older paths for
sharded formulae.
While we're here, also cleanup `FormulaVersions` a bit to have more
signatures, cleanup dead code, make more code private, improve
variable naming.
This supports the use of `*-staging` branches in the future for projects
similar to the OpenSSL migration (e.g. Python migration). We already
have branch protections set for these branches, so it makes sense to
keep using them with the supporting code.
1. Adjust audit so that it ignore conflicts only for `brew audit --tap`.
This is useful because it prevents us from trying to migrate a formula
to `openssl@3` before all its dependencies have also been migrated.
2. Exempt only PRs that target a branch called
`openssl-migration-staging`.