Skip to content

Match the Required Event Type Exactly in the Merge-Bot Contract - #4333

Merged
ptr727 merged 3 commits into
developfrom
promo-4330-event-types
Nov 22, 2026
Merged

ptr727 merged 3 commits into
developfrom
promo-4330-event-types

Conversation

@ptr727

@ptr727 ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes a finding Copilot raised on the develop -> main promotion #4330. The merge-bot contract's requireTokensOn read the whole on: mapping as one string, so a branch filter naming auto_merge_disabled still passed without a subscription.

  • The key is now requireEventTypes. It compares the values of each event's types: list exactly, and a single-string types: value counts as one type.
  • Regression cases put the token in a branch filter and in a single-string 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

ptr727 and others added 2 commits November 21, 2026 17:34
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]>
Copilot AI lite review requested due to automatic review settings November 22, 2026 01:37
@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head d2c519f342508156c21a2931c03a2bcb29670993, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

🟡 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 requireTokensOn to requireEventTypes across 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

Comment thread tests/test_audit_helpers.py Resolved
@codecov

codecov Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.15%. Comparing base (b9bb7db) to head (827f980).

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           
Flag Coverage Δ
python-3.13 79.15% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Action not completed

Head commit changed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 827f980bb84ecfbbd934adf76713da738febfe54, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727
ptr727 merged commit 66dd36c into develop Nov 22, 2026
14 checks passed
@ptr727
ptr727 deleted the promo-4330-event-types branch November 22, 2026 02:09
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.

2 participants