Today we get a sorbet error when the user opts out, because `json` is
`{}`, so `json["private"]` is `nil`.
Given this function is used to check whether to send analytics, I assume
we should default to treating the repo as a private repo.
Refs: 8ef7a9dbd4/Library/Homebrew/utils/github/api.rb (L276)
- Add an `--organisation` flag to search a specific organisation.
- Wait for the GitHub API rate limit to reset before automatically
retrying.
- Use (much) fewer API calls by using organisation-wide API PR searches
rather than per-repository. This makes the rate limit easier to avoid
and also makes things much faster (with the trade-off of showing a max
PR count per-user rather than per-repository).
- Improve output to clarify when the max PR/commit count is reached.
- Move more logic and add more Sorbet signatures to the `GitHub` and
`Utils::Git` modules.
- Rename a few GitHub API methods.
- Remove a lot of (now unused) `GitHub` module methods.
- Add, use a `Tap#full_repository` method.
- Add `formula-analytics` as a deprecated tap.
This reduces the surface area of our `Kernel` monkeypatch and removes
the need to `include Kernel` in a bunch of modules.
While we're here, also move `Kernel#require?` to `Homebrew` and fully
scope the calls to it.
We need to `source utils/helpers.sh` before calling `odie`. We also
don't need to `source utils/wrapper.sh` again here, because we are
already in `utils/wrapper.sh`.
`HOMEBREW_FORCE_BREW_WRAPPER` can be used as a security/compliance
feature, but allowing it to be disabled by setting
`HOMEBREW_NO_FORCE_BREW_WRAPPER` leaves a pretty large hole in it that
allows it to be sidestepped.
Let's fix that by actually checking the path of the process that called
`brew`, and the verify that that path matches the configured value of
`HOMEBREW_NO_FORCE_BREW_WRAPPER`.
`ensure_formula_installed!` requires the `Formula` class to be loaded
before being called to work properly.
Let's guarantee that instead by implementing it as an instance method of
the `Formula` class.
See discussion at #20358.
- move some things out of `extend` that don't really fit there e.g.
`Module`s that are included but not doing any
overriding/monkeypatching
- move some code into `extend/os` to fix all remaining
`rubocop:todo Homebrew/MoveToExtendOS`s
- remove some unneeded `bundle` skipper code that doesn't really make
sense given our current bottling strategy
- extract some `Pathname` extensions to `extend/pathname` for separate
files
- move a `ENV` `Kernel` extension into `kernel.rb`
- `odeprecate` a seemingly unused backwards compatibility method
- move `readline_nonblock` from a monkeypatch to a
`ReadlineNonblock.read` method as its only used in one place
- fix up a link in documentation
- Remove a bunch of non-actionable/unnecessary noise in GitHub Actions
CI.
- Limit number of threads used to generate analytics API data to avoid
reproducible failures producing errors and requiring retries.
- Move to Debian Old Stable for testing non-system `glibc`.
- Remove unneeded core taps/updates.
- Improve naming of CI jobs to clarify purpose i.e. we're testing
things work on Linux, not Ubuntu specifically.
- Remove dedicated non-online/non-generic Linux `brew tests` jobs from
3 to 1.
Co-authored-by: Rylan Polster <rslpolster@gmail.com>