Repository navigation
Match the Required Event Type Exactly in the Merge-Bot Contract - #4333
Conversation
requireTokensOn read the whole on: mapping as one string, so a branch filter naming the event type still passed. It is now requireEventTypes, which compares the values of each event's types: list exactly. A regression case puts the token in a branch filter. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
There was a problem hiding this comment.
🟡 Changes recommended
A moderate active finding remains because the validator tests do not cover the renamed requireEventTypes contract key, leaving a regression gap.
1 open issue
What changed in this PR
This pull request updates the merge-bot contract to match required event types only against workflow types: values, preventing branch filters or job names from satisfying the requirement.
Changes:
- Renames
requireTokensOntorequireEventTypesacross validation, schema, and contract data. - Supports event types declared as sequences or single strings.
- Adds regression coverage for misleading workflow text and scalar
types:values.
| File | Description |
|---|---|
| tests/test_audit_helpers.py | Updates merge-bot contract tests and adds event-type matching regression coverage. |
| spec/validate.py | Validates the renamed contract field and its array-of-strings shape. |
| spec/files.schema.json | Defines the requireEventTypes property in the contract schema. |
| spec/files.json | Applies requireEventTypes to the merge-bot workflow contract. |
| spec/audit.py | Extracts event types: values from parsed workflow YAML. |
| spec/audit_contract.py | Matches required event types against extracted values rather than unrelated workflow text. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4333 +/- ##
========================================
Coverage 79.14% 79.15%
========================================
Files 45 45
Lines 15920 15926 +6
========================================
+ Hits 12600 12606 +6
Misses 3320 3320
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
|
/review |
Action not completed
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |

Summary
Fixes a finding Copilot raised on the develop -> main promotion #4330. The merge-bot contract's
requireTokensOnread the wholeon:mapping as one string, so a branch filter namingauto_merge_disabledstill passed without a subscription.requireEventTypes. It compares the values of each event'stypes:list exactly, and a single-stringtypes:value counts as one type.types:.Local review
Two passes ran. The first raised the single-string
types:case, which a later commit fixed. The second found nothing.Closes on promotion: none
🤖 Generated with Claude Code