You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ruleset pr-quality parameter require_code_owner_review has drifted from the codified standard: expected true, actual false. The codified JSON (standards/rulesets/pr-quality.json) is the source of truth (#575/#580); run scripts/apply-rulesets.sh --repo petry-projects/markets to converge.
Add a repo-local, idempotent applier script (and static bats test) that converges the pr-quality repository ruleset to the codified standard — restoring require_code_owner_review: true — mirroring the existing apply-code-quality-ruleset.sh reference/fallback pattern.
Context
The codified source of truth is standards/rulesets/pr-quality.json in petry-projects/.github; the org-level scripts/apply-rulesets.sh is canonical.
This repo already keeps repo-local reference/fallback appliers (e.g. .github/scripts/apply-code-quality-ruleset.sh) but had none for pr-quality. This change adds the missing pr-quality applier so the repo carries an accurate, runnable representation of the standard.
CODEOWNERS already has a catch-all owner, so require_code_owner_review is enforceable once the ruleset parameter is restored.
Implementation Checklist
.github/scripts/apply-pr-quality-ruleset.sh — new idempotent create/update of the pr-quality ruleset using the exact codified payload (require_code_owner_review: true, required_approving_review_count: 1, required_review_thread_resolution: true, dismiss_stale_reviews_on_push: true, require_last_push_approval: true, allowed_merge_methods: ["squash"], bypass actors, ~DEFAULT_BRANCH). Executable, set -euo pipefail, requires GH_TOKEN.
Tests to Write
.github/scripts/tests/apply-pr-quality-ruleset.bats — static content assertions (no live API): script exists + executable, set -euo pipefail, targets petry-projects/markets, ruleset name pr-quality, type: pull_request, and require_code_owner_review set to true.
Test Command
bats .github/scripts/tests/ (plus bash .dev-lead/scripts/dev-lead-lint.sh for shellcheck)
Added repo-local idempotent applier .github/scripts/apply-pr-quality-ruleset.sh that converges the pr-quality ruleset, restoring require_code_owner_review: true
Added static bats test .github/scripts/tests/apply-pr-quality-ruleset.bats (TDD: written first, confirmed red, then green)
Verified the script's payload is byte-for-byte equivalent (order-insensitive) to the codified source of truth standards/rulesets/pr-quality.json in petry-projects/.github
Approach
The codified JSON in petry-projects/.github is the source of truth and the org-level scripts/apply-rulesets.sh is canonical. This repo already keeps repo-local reference/fallback appliers (e.g. apply-code-quality-ruleset.sh) but had none for pr-quality. This change adds the missing pr-quality applier, mirroring that established pattern, so the repository carries an accurate, runnable representation of the standard. CODEOWNERS already has a catch-all owner, so require_code_owner_review is enforceable once the parameter is restored.
Test Results
$ bats .github/scripts/tests/apply-pr-quality-ruleset.bats
1..9
ok 1 script exists and is executable
ok 2 script uses set -euo pipefail
ok 3 script targets petry-projects/markets repo
ok 4 script requires GH_TOKEN
ok 5 script manages the pr-quality ruleset
ok 6 script configures a pull_request rule
ok 7 script sets require_code_owner_review to true (issue #323)
ok 8 script codifies the remaining pr-quality parameters
ok 9 script is idempotent (creates or updates by existing id)
$ shellcheck --severity=warning -x .github/scripts/apply-pr-quality-ruleset.sh
(clean)
$ bash .dev-lead/scripts/dev-lead-lint.sh
[lint] all checks passed
# Payload equivalence vs standards/rulesets/pr-quality.json:
PAYLOAD MATCHES CODIFIED STANDARD (order-insensitive)
Note: two pre-existing failures in the unrelated pr-review-mention-workflow.bats are environmental (the runner's yq is the Python variant, which uses different query syntax than the mikefarah yq those tests expect). They are untouched by this change.
Files Changed
.github/scripts/apply-pr-quality-ruleset.sh (new): idempotent create/update of the pr-quality ruleset with the full codified parameter set — required_approving_review_count: 1, require_code_owner_review: true, required_review_thread_resolution: true, dismiss_stale_reviews_on_push: true, require_last_push_approval: true, allowed_merge_methods: ["squash"], standard bypass actors, ~DEFAULT_BRANCH.
.github/scripts/tests/apply-pr-quality-ruleset.bats (new): static content assertions, no live API calls.
Notes
A ruleset update is a whole-object PUT/POST (not a per-parameter PATCH), so the script necessarily codifies the complete pr-quality payload; it is verified identical to the org standard rather than adding anything beyond it.
Actual server-side convergence still requires running the canonical org apply-rulesets.sh (or this repo-local fallback with an administration:write token); this change ensures the repo's codified representation is correct and runnable.
Codify the pr-quality repository ruleset (with require_code_owner_review: true) as a repo-local, idempotent apply script plus a bats test suite, mirroring the existing apply-code-quality-ruleset.sh pattern, so the standard is version-controlled and can be applied to converge the repo.
Background
The compliance finding reports the pr-quality ruleset parameter require_code_owner_review drifted from true (expected) to false (actual). The codified source of truth is petry-projects/.github/standards/rulesets/pr-quality.json. This repo already codifies its code-quality ruleset in a repo-local fallback script (.github/scripts/apply-code-quality-ruleset.sh); there is no equivalent for pr-quality yet. The org's apply-rulesets.sh (canonical) plus this repo-local script converge the live setting; applying the live GitHub setting itself requires an admin token and is out of scope for this code change.
Implementation Checklist
.github/scripts/apply-pr-quality-ruleset.sh — new idempotent create/update script for the pr-quality ruleset matching the codified standard (require_code_owner_review: true, required_approving_review_count: 1, required_review_thread_resolution: true, dismiss_stale_reviews_on_push: true, require_last_push_approval: true, allowed_merge_methods: ["squash"], bypass actors, ~DEFAULT_BRANCH condition)
Tests to Write
.github/scripts/tests/apply-pr-quality-ruleset.bats — static-content assertions: script exists/executable, set -euo pipefail, targets petry-projects/markets, declares pr-quality ruleset, requires GH_TOKEN, and asserts require_code_owner_review is set to true (the drifted parameter) plus the other codified pull_request parameters
Test Command
bats .github/scripts/tests/*.bats (plus shellcheck --severity=warning -x .github/scripts/apply-pr-quality-ruleset.sh and bash .dev-lead/scripts/dev-lead-lint.sh)
Created .github/scripts/apply-pr-quality-ruleset.sh — idempotent create/update script for the pr-quality ruleset, codifying require_code_owner_review: true (the drifted parameter) plus the full pull_request rule from the org standard
Created .github/scripts/tests/apply-pr-quality-ruleset.bats — 12 static-content assertions (TDD: written first, confirmed red, then green)
Approach
The pr-quality parameter require_code_owner_review drifted to false; expected true. This repo already codifies its code-quality ruleset as a repo-local, idempotent fallback script (apply-code-quality-ruleset.sh) but had no pr-quality equivalent. I mirrored that established pattern, sourcing the exact ruleset shape from the codified standard petry-projects/.github/standards/rulesets/pr-quality.json (fetched directly to verify every value). The org's canonical apply-rulesets.sh plus this repo-local script converge the live GitHub setting.
Codified pull_request parameters: required_approving_review_count: 1, require_code_owner_review: true, required_review_thread_resolution: true, dismiss_stale_reviews_on_push: true, require_last_push_approval: true, allowed_merge_methods: ["squash"], with the standard's bypass_actors and ~DEFAULT_BRANCH condition.
Test Results
ok 23 script disables Claude (1236702) auto-trigger
ok 24 script uses set -euo pipefail
ok 25 script targets petry-projects/markets repo
ok 26 script wires in secret_scanning_non_provider_patterns enablement (issue #227)
ok 27 script exists and is executable
ok 28 script uses set -euo pipefail
ok 29 script targets petry-projects/markets repo
ok 30 script PATCHes secret_scanning_non_provider_patterns to enabled
ok 31 script requires GH_TOKEN
ok 32 workflow file exists
ok 33 workflow is valid YAML
ok 34 pr-review-mention job skips Bot-typed senders (issue #307 fix)
ok 35 uses: ref stays pinned to the pr-review-mention/v2-stable channel
ok 36 trigger events are unchanged
ok 37 job-level pull-requests: write permission is preserved
Also verified: shellcheck --severity=warning -x clean on the new script; jq payload validates and emits require_code_owner_review = true; bash .dev-lead/scripts/dev-lead-lint.sh passes.
Files Changed
.github/scripts/apply-pr-quality-ruleset.sh (new): idempotent script that creates/updates the pr-quality ruleset per the codified standard
.github/scripts/tests/apply-pr-quality-ruleset.bats (new): static-assertion test suite for the script
Notes
Applying the live GitHub ruleset setting requires an administration:write admin token and is out of scope for this code change; the CI workflow / apply-repo-settings mechanism with GH_TOKEN_ADMIN handles live application. This change codifies and tests the standard so it is version-controlled and reproducible.
The repo's bats tests are static-content assertions (no live API calls), consistent with all existing apply-*-ruleset tests.
Follow-up (optional): wire apply-pr-quality-ruleset.sh into a workflow if the org wants automated live application, matching whatever mechanism drives apply-code-quality-ruleset.sh.
Detail: Ruleset pr-quality parameter require_code_owner_review has drifted from the codified standard: expected true, actual false. The codified JSON (standards/rulesets/pr-quality.json) is the source of truth (#575/#580); run scripts/apply-rulesets.sh --repo petry-projects/markets to converge.
Detail: Ruleset pr-quality parameter require_code_owner_review has drifted from the codified standard: expected true, actual false. The codified JSON (standards/rulesets/pr-quality.json) is the source of truth (#575/#580); run scripts/apply-rulesets.sh --repo petry-projects/markets to converge.
Activity
don-petry commentedon Jul 17, 2026
Dev-Lead Implementation Plan
Issue: #323 — Compliance: ruleset-drift-pr-quality-require_code_owner_review
Scope
Add a repo-local, idempotent applier script (and static bats test) that converges the
pr-qualityrepository ruleset to the codified standard — restoringrequire_code_owner_review: true— mirroring the existingapply-code-quality-ruleset.shreference/fallback pattern.Context
standards/rulesets/pr-quality.jsoninpetry-projects/.github; the org-levelscripts/apply-rulesets.shis canonical..github/scripts/apply-code-quality-ruleset.sh) but had none forpr-quality. This change adds the missingpr-qualityapplier so the repo carries an accurate, runnable representation of the standard.CODEOWNERSalready has a catch-all owner, sorequire_code_owner_reviewis enforceable once the ruleset parameter is restored.Implementation Checklist
.github/scripts/apply-pr-quality-ruleset.sh— new idempotent create/update of thepr-qualityruleset using the exact codified payload (require_code_owner_review: true,required_approving_review_count: 1,required_review_thread_resolution: true,dismiss_stale_reviews_on_push: true,require_last_push_approval: true,allowed_merge_methods: ["squash"], bypass actors,~DEFAULT_BRANCH). Executable,set -euo pipefail, requiresGH_TOKEN.Tests to Write
.github/scripts/tests/apply-pr-quality-ruleset.bats— static content assertions (no live API): script exists + executable,set -euo pipefail, targetspetry-projects/markets, ruleset namepr-quality,type: pull_request, andrequire_code_owner_reviewset totrue.Test Command
bats .github/scripts/tests/(plusbash .dev-lead/scripts/dev-lead-lint.shfor shellcheck)don-petry commentedon Jul 17, 2026
Dev-Lead: Implementation Complete
Plan Execution
.github/scripts/apply-pr-quality-ruleset.shthat converges thepr-qualityruleset, restoringrequire_code_owner_review: true.github/scripts/tests/apply-pr-quality-ruleset.bats(TDD: written first, confirmed red, then green)standards/rulesets/pr-quality.jsoninpetry-projects/.githubApproach
The codified JSON in
petry-projects/.githubis the source of truth and the org-levelscripts/apply-rulesets.shis canonical. This repo already keeps repo-local reference/fallback appliers (e.g.apply-code-quality-ruleset.sh) but had none forpr-quality. This change adds the missingpr-qualityapplier, mirroring that established pattern, so the repository carries an accurate, runnable representation of the standard.CODEOWNERSalready has a catch-all owner, sorequire_code_owner_reviewis enforceable once the parameter is restored.Test Results
Note: two pre-existing failures in the unrelated
pr-review-mention-workflow.batsare environmental (the runner'syqis the Python variant, which uses different query syntax than the mikefarahyqthose tests expect). They are untouched by this change.Files Changed
.github/scripts/apply-pr-quality-ruleset.sh(new): idempotent create/update of thepr-qualityruleset with the full codified parameter set —required_approving_review_count: 1,require_code_owner_review: true,required_review_thread_resolution: true,dismiss_stale_reviews_on_push: true,require_last_push_approval: true,allowed_merge_methods: ["squash"], standard bypass actors,~DEFAULT_BRANCH..github/scripts/tests/apply-pr-quality-ruleset.bats(new): static content assertions, no live API calls.Notes
pr-qualitypayload; it is verified identical to the org standard rather than adding anything beyond it.apply-rulesets.sh(or this repo-local fallback with anadministration:writetoken); this change ensures the repo's codified representation is correct and runnable.don-petry commentedon Jul 21, 2026
Dev-Lead Implementation Plan
Issue: #323 — Compliance: ruleset-drift-pr-quality-require_code_owner_review
Scope
Codify the
pr-qualityrepository ruleset (withrequire_code_owner_review: true) as a repo-local, idempotent apply script plus a bats test suite, mirroring the existingapply-code-quality-ruleset.shpattern, so the standard is version-controlled and can be applied to converge the repo.Background
The compliance finding reports the
pr-qualityruleset parameterrequire_code_owner_reviewdrifted fromtrue(expected) tofalse(actual). The codified source of truth ispetry-projects/.github/standards/rulesets/pr-quality.json. This repo already codifies itscode-qualityruleset in a repo-local fallback script (.github/scripts/apply-code-quality-ruleset.sh); there is no equivalent forpr-qualityyet. The org'sapply-rulesets.sh(canonical) plus this repo-local script converge the live setting; applying the live GitHub setting itself requires an admin token and is out of scope for this code change.Implementation Checklist
.github/scripts/apply-pr-quality-ruleset.sh— new idempotent create/update script for thepr-qualityruleset matching the codified standard (require_code_owner_review: true,required_approving_review_count: 1,required_review_thread_resolution: true,dismiss_stale_reviews_on_push: true,require_last_push_approval: true,allowed_merge_methods: ["squash"], bypass actors,~DEFAULT_BRANCHcondition)Tests to Write
.github/scripts/tests/apply-pr-quality-ruleset.bats— static-content assertions: script exists/executable,set -euo pipefail, targetspetry-projects/markets, declarespr-qualityruleset, requiresGH_TOKEN, and assertsrequire_code_owner_reviewis set totrue(the drifted parameter) plus the other codifiedpull_requestparametersTest Command
bats .github/scripts/tests/*.bats(plusshellcheck --severity=warning -x .github/scripts/apply-pr-quality-ruleset.shandbash .dev-lead/scripts/dev-lead-lint.sh)don-petry commentedon Jul 21, 2026
Dev-Lead: Implementation Complete
Plan Execution
.github/scripts/apply-pr-quality-ruleset.sh— idempotent create/update script for thepr-qualityruleset, codifyingrequire_code_owner_review: true(the drifted parameter) plus the fullpull_requestrule from the org standard.github/scripts/tests/apply-pr-quality-ruleset.bats— 12 static-content assertions (TDD: written first, confirmed red, then green)Approach
The
pr-qualityparameterrequire_code_owner_reviewdrifted tofalse; expectedtrue. This repo already codifies itscode-qualityruleset as a repo-local, idempotent fallback script (apply-code-quality-ruleset.sh) but had nopr-qualityequivalent. I mirrored that established pattern, sourcing the exact ruleset shape from the codified standardpetry-projects/.github/standards/rulesets/pr-quality.json(fetched directly to verify every value). The org's canonicalapply-rulesets.shplus this repo-local script converge the live GitHub setting.Codified
pull_requestparameters:required_approving_review_count: 1,require_code_owner_review: true,required_review_thread_resolution: true,dismiss_stale_reviews_on_push: true,require_last_push_approval: true,allowed_merge_methods: ["squash"], with the standard'sbypass_actorsand~DEFAULT_BRANCHcondition.Test Results
Also verified:
shellcheck --severity=warning -xclean on the new script;jqpayload validates and emitsrequire_code_owner_review = true;bash .dev-lead/scripts/dev-lead-lint.shpasses.Files Changed
.github/scripts/apply-pr-quality-ruleset.sh(new): idempotent script that creates/updates thepr-qualityruleset per the codified standard.github/scripts/tests/apply-pr-quality-ruleset.bats(new): static-assertion test suite for the scriptNotes
administration:writeadmin token and is out of scope for this code change; the CI workflow /apply-repo-settingsmechanism withGH_TOKEN_ADMINhandles live application. This change codifies and tests the standard so it is version-controlled and reproducible.apply-*-rulesettests.apply-pr-quality-ruleset.shinto a workflow if the org wants automated live application, matching whatever mechanism drivesapply-code-quality-ruleset.sh.don-petry commentedon Jul 24, 2026
Weekly Compliance Audit (2026-07-24)
This finding is still open.
Detail: Ruleset
pr-qualityparameterrequire_code_owner_reviewhas drifted from the codified standard: expectedtrue, actualfalse. The codified JSON (standards/rulesets/pr-quality.json) is the source of truth (#575/#580); runscripts/apply-rulesets.sh --repo petry-projects/marketsto converge.Standard: standards/github-settings.md#pr-quality--standard-ruleset-all-repositories
don-petry commentedon Jul 31, 2026
Weekly Compliance Audit (2026-07-31)
This finding is still open.
Detail: Ruleset
pr-qualityparameterrequire_code_owner_reviewhas drifted from the codified standard: expectedtrue, actualfalse. The codified JSON (standards/rulesets/pr-quality.json) is the source of truth (#575/#580); runscripts/apply-rulesets.sh --repo petry-projects/marketsto converge.Standard: standards/github-settings.md#pr-quality--standard-ruleset-all-repositories
feat: implement issue #323 — Compliance: ruleset-drift-pr-quality-req…
feat: implement issue #323 — Compliance: ruleset-drift-pr-quality-req…
feat: implement issue #323 — Compliance: ruleset-drift-pr-quality-req…
feat: implement issue #400 — Compliance: ruleset-bypass-dependabot-co…