Skip to content

fix(scripts): make apply-repo-settings.sh ruleset comparison key-order independent; narrow rollout-merge-queue.sh's merge_group heuristic #101

Closed as not planned

Description

@bketelsen

Problem

Observed during the 2026-08-19 merge-queue rollout (core ADR-0042):

  1. scripts/apply-repo-settings.sh compares the live ruleset and the desired body with jq -c without sorting keys. GitHub returns conditions.ref_name as {exclude, include}; the script builds {include, exclude}, so the tag ruleset (and the branch ruleset on a second run) is always planned as "repaired" even when identical — a harmless no-op PUT, but the dry run is noisy and the script is not truthfully idempotent. Fix: compare with jq -S -c (sorted keys) on both sides, and prove a second run plans nothing.
  2. scripts/rollout-merge-queue.sh flags every workflow triggered on pull_request/pull_request_target that lacks merge_group; on updex that flagged claude-code-review.yml and labeler.yml, which produce no required check, so the run needed --allow-missing-merge-group. Better: map the live ruleset's required contexts to the workflows/jobs that produce them (gh api repos/{r}/actions/workflows + job names, or the check-runs' app/name on a recent head) and flag only those.

Acceptance

  • A dry run of apply-repo-settings.sh against a conformant repository plans 0 changes (shown in the PR with a before/after run).
  • rollout-merge-queue.sh frostyard/updex dry-run no longer skips updex and no longer needs --allow-missing-merge-group when only non-required workflows lack merge_group.
  • shellcheck clean; npm run check green.

Filed from the rollout session; both were worked around by hand on 2026-08-19 (all five repositories now carry the queue).

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions