Skip to content

Update tooling and workflows to current Homebrew conventions - #46

Merged
andrew merged 4 commits into
mainfrom
homebrew-conventions
Aug 8, 2026
Merged

Update tooling and workflows to current Homebrew conventions#46
andrew merged 4 commits into
mainfrom
homebrew-conventions

Conversation

@p-linnane

Copy link
Copy Markdown
Contributor

Aligns the Ruby tooling and the three workflows with current Homebrew
conventions. No advisory data or policy changes; details are in the commits.

Also fixes the duplicate pull request guard in the bot workflows: gh pr list --head takes a bare branch name, so the owner:branch form matched nothing and
every run would have tried to recreate an open pull request.

Run RuboCop from the default Rake task over the Gemfile, Rakefile and
the lib and spec trees. Passing those paths explicitly is required: the
org-synced .rubocop.yml sets `AllCops: Include: ["**/*.rbi"]`, which
replaces rather than extends the default globs, so a bare `rubocop`
scans nothing here.

The two source changes are RuboCop-driven and behaviour-preserving:
Dir.glob has sorted by default since Ruby 3.0, and Style/MutableConstant
is configured as `strict`.

Signed-off-by: Patrick Linnane <patrick@linnane.io>
Restrict push to main, add merge_group, and adopt the standard shell
defaults, concurrency group, empty top-level permissions with job-scoped
grants, job timeouts, names and repository owner guard.

Install check-jsonschema through setup-homebrew and
cache-homebrew-prefix instead of pip, matching the synced actionlint.yml
in this repository. That file already caches a prefix, so workflow-key
is required to keep the two caches isolated.

Pin the OSV schema to v1.9.0 rather than tracking main. That is the
release adding the Homebrew ecosystem, and its id pattern registers the
BREW- prefix these advisories use.

Validate via find -print0 | xargs -n 500 so the file list cannot outgrow
ARG_MAX, and fail explicitly when no advisories are found rather than
passing a literal glob to check-jsonschema. Covered by a regression
test asserting the batching invariant.

Signed-off-by: Patrick Linnane <patrick@linnane.io>
Adopt the standard shell defaults, serialising concurrency groups, empty
top-level permissions with job-scoped grants, job names, a repository
owner guard so forks do not run the schedule, and a timeout on
Regenerate. Hoist the shared HOMEBREW_* variables to the workflow level;
HOMEBREW_NO_INSTALL_FROM_API stays step-scoped because setup-homebrew
deliberately unsets it.

Replace the hardcoded git identity with git-user-config, which resolves
to the same values, and push with git-try-push. Both branches are
rebuilt from main on every run, so the push needs no_lease: the default
--force-with-lease has no remote-tracking ref to compare against in a
shallow checkout.

Fix the duplicate pull request guard. `gh pr list --head` filters on
GraphQL headRefName, which takes a bare branch name, so an owner:branch
argument matches nothing and every run would try to recreate an open
pull request and fail. Filter forks with isCrossRepository instead.

Signed-off-by: Patrick Linnane <patrick@linnane.io>
Signed-off-by: Patrick Linnane <patrick@linnane.io>
Copilot AI lite review requested due to automatic review settings August 8, 2026 05:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Aligns repository Ruby tooling and GitHub Actions workflows with current Homebrew conventions, while preserving advisory data/policy behavior. Also corrects the bot workflows’ “duplicate PR” guard by using a bare branch name with gh pr list --head.

Changes:

  • Add RuboCop to the Ruby toolchain and run style checks in CI via bundle exec rake (default task runs RuboCop + RSpec).
  • Modernize workflows (defaults shell, concurrency, least-privilege permissions, Homebrew setup actions) and fix automated PR creation guard logic.
  • Add/adjust tests to validate workflow behavior (bounded schema validation batches) and minor spec refactors.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
spec/workflows_spec.rb Adds coverage asserting schema validation runs in bounded batches rather than globbing advisories/*.json.
spec/repology_index_spec.rb Refactors test fixture construction for readability; behavior unchanged.
Rakefile Adds RuboCop rake task and makes default task run RuboCop + specs.
lib/repology_index.rb Freezes OVERRIDES_PATH constant to avoid mutable constant string.
lib/advisory_index.rb Removes unnecessary Dir.glob(...).sort while preserving deterministic output via later sorting.
Gemfile.lock Locks RuboCop and dependencies; records Ruby version and bundler version.
Gemfile Declares Ruby version from .ruby-version and adds RuboCop dependency.
CONTRIBUTING.md Documents local dev commands (bundle exec rake) and workflow lint tooling.
.github/workflows/validate.yml Updates validation/test workflow conventions and validates advisories via `find ...
.github/workflows/regenerate.yml Updates regeneration workflow conventions; uses standardized Homebrew git actions and fixes PR guard logic.
.github/workflows/ingest.yml Updates ingest workflow conventions; uses standardized Homebrew git actions and fixes PR guard logic.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@andrew
andrew enabled auto-merge August 8, 2026 07:54
@andrew
andrew merged commit 42f813b into main Aug 8, 2026
7 checks passed
@andrew
andrew deleted the homebrew-conventions branch August 8, 2026 07:54
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 this pull request may close these issues.

3 participants