watchflow icon indicating copy to clipboard operation
watchflow copied to clipboard

bug: PR status check violations not detected when defined in rules.yaml

Open dimeloper opened this issue 1 year ago • 2 comments

Description:

Pull requests with failing status checks (such as required CI jobs) are currently not surfacing violations in Watchflow, even when corresponding rules are present and enabled in .watchflow/rules.yaml.

This gap reduces the effectiveness of automated governance, as checks intended to block low-quality or noncompliant code can be bypassed without surfacing formal rule violations. Reproduction steps, example configuration, and open technical questions are provided below.

Steps to Reproduce:

  • Define a rule in .watchflow/rules.yaml that requires PR status checks (e.g., ci/test, lint) to pass.
  • Open a pull request that intentionally fails one of these checks.
  • Observe that Watchflow does not report a violation on the PR.

Example rule:

rules:
  - id: status-check-required
    name: Status Check Required
    description: All PRs must pass required status checks
    enabled: true
    severity: high
    event_types: [pull_request]
    parameters:
      checks: [ci/test, lint]

Expected behavior:

Any failed status check matching a defined, enabled rule should result in a violation clearly surfaced by Watchflow.

Questions:

  • Is there an existing processor for status or check_run events that should detect these failures?
  • Are there known gotchas or required config details for enabling check-based violation rules?

dimeloper avatar Jul 24 '25 14:07 dimeloper

My issue was similar to @dimeloper, only I've used a different rule. (Commit messages must follow conventional commits format (feat/fix/etc).)

So, after pushing 2 commits that passed the rule, I pushed another commit that intentionally violates the rule but the check passed. ⬇️

Image

junyap95 avatar Jul 25 '25 07:07 junyap95

Thanks @dimeloper @junyap95 for raising this!

I confirm that currently Watchflow isn’t flagging failed status checks as violations. At the moment, there isn’t a processor for check_run events - but it should.

dkargatzis avatar Jul 25 '25 15:07 dkargatzis