Add Watchflow governance rules (5 rules, 2 high-priority)#47
Add Watchflow governance rules (5 rules, 2 high-priority)#47dkargatzis wants to merge 1 commit intomainfrom
Conversation
📝 WalkthroughWalkthroughThe pull request replaces legacy PR governance rules in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In @.watchflow/rules.yaml:
- Around line 23-29: The rule block for required_workflows is missing
configuration in the parameters section so it can't enforce anything; update the
rule named "required_workflows" (the entry with description 'required_workflows:
Ensure CI workflows pass...') by populating its parameters with a non-empty list
of workflow identifiers (e.g., add a workflows or required_workflows key
containing the CI job names/IDs that must pass) and validate the names match
your CI workflow filenames/IDs so the rule actually enforces on pull_request
events.
- Around line 30-36: The rule's parameters are empty so the title_pattern check
never runs; add a parameters section including a title_pattern regex that
enforces Conventional Commits (e.g., a regex matching types like feat|fix|chore
etc., optional scope, and a subject) and an optional error_message/description
to surface on failure. Update the rule's parameters key to include title_pattern
(and optionally error_message) so the pull_request event uses that regex when
validating PR titles.
- Around line 9-15: The rule entry for max_pr_size has an empty parameters block
so it doesn't enforce anything; update the rule named max_pr_size to include
concrete parameter keys (for example add integer values for max_lines and/or
max_files) under its parameters section so the rule can enforce limits (e.g.,
parameters: { max_lines: 500, max_files: 50 }); keep the existing enabled,
severity, and event_types fields unchanged.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.watchflow/rules.yaml
🔇 Additional comments (2)
.watchflow/rules.yaml (2)
2-8: Consider whetherrequire_linked_issueandcode_ownersneed parameters.These rules have empty parameters. Verify whether Watchflow provides sensible defaults or if configuration is needed (e.g., issue reference patterns like
#\d+,fixes #\d+, or specific CODEOWNERS file paths).Also applies to: 16-22
1-36: Theparametersobjects are empty and need rule-specific configuration.Watchflow's schema does not require a
nameortypefield; rules are identified by theirdescriptionand configured through rule-specificparameters. However, the rules in this file all have emptyparameters: {}, which will prevent them from functioning. Each rule type needs configuration tailored to its purpose:
max_pr_sizerequiresmax_filesand/ormax_linesthresholdsrequired_workflowsrequiresworkflow_namesto checktitle_patternrequires apatternregex to enforcePopulate the parameters based on your governance requirements. See the Watchflow configuration guide for parameter examples per rule type.
Likely an incorrect or invalid review comment.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
| - description: 'max_pr_size: Limit PR size to prevent large, hard-to-review changes | ||
| and encourage focused contributions.' | ||
| enabled: true | ||
| severity: medium | ||
| event_types: | ||
| - pull_request | ||
| parameters: {} |
There was a problem hiding this comment.
Empty parameters will prevent max_pr_size from functioning.
The max_pr_size rule has no configured limit. Without specifying the maximum allowed lines or files, this rule cannot enforce any size constraint.
Suggested configuration
- description: 'max_pr_size: Limit PR size to prevent large, hard-to-review changes
and encourage focused contributions.'
enabled: true
severity: medium
event_types:
- pull_request
- parameters: {}
+ parameters:
+ max_lines: 400
+ max_files: 20🤖 Prompt for AI Agents
In @.watchflow/rules.yaml around lines 9 - 15, The rule entry for max_pr_size
has an empty parameters block so it doesn't enforce anything; update the rule
named max_pr_size to include concrete parameter keys (for example add integer
values for max_lines and/or max_files) under its parameters section so the rule
can enforce limits (e.g., parameters: { max_lines: 500, max_files: 50 }); keep
the existing enabled, severity, and event_types fields unchanged.
| - description: 'required_workflows: Ensure CI workflows pass before merging to maintain | ||
| code quality and prevent regressions.' | ||
| enabled: true | ||
| severity: critical | ||
| event_types: | ||
| - pull_request | ||
| parameters: {} |
There was a problem hiding this comment.
Empty parameters will prevent required_workflows from functioning.
This rule is marked critical but has no workflows specified. Without listing which CI workflows must pass, the rule cannot enforce anything.
Suggested configuration
- description: 'required_workflows: Ensure CI workflows pass before merging to maintain
code quality and prevent regressions.'
enabled: true
severity: critical
event_types:
- pull_request
- parameters: {}
+ parameters:
+ workflows:
+ - ci
+ - build
+ - test🤖 Prompt for AI Agents
In @.watchflow/rules.yaml around lines 23 - 29, The rule block for
required_workflows is missing configuration in the parameters section so it
can't enforce anything; update the rule named "required_workflows" (the entry
with description 'required_workflows: Ensure CI workflows pass...') by
populating its parameters with a non-empty list of workflow identifiers (e.g.,
add a workflows or required_workflows key containing the CI job names/IDs that
must pass) and validate the names match your CI workflow filenames/IDs so the
rule actually enforces on pull_request events.
| - description: 'title_pattern: Enforce Conventional Commits pattern to improve commit | ||
| message clarity and automation.' | ||
| enabled: true | ||
| severity: medium | ||
| event_types: | ||
| - pull_request | ||
| parameters: {} |
There was a problem hiding this comment.
Empty parameters will prevent title_pattern from functioning.
The description states this rule enforces "Conventional Commits pattern" but no regex pattern is provided. The rule needs the actual pattern to validate PR titles against.
Suggested configuration for Conventional Commits
- description: 'title_pattern: Enforce Conventional Commits pattern to improve commit
message clarity and automation.'
enabled: true
severity: medium
event_types:
- pull_request
- parameters: {}
+ parameters:
+ pattern: '^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?: .+'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - description: 'title_pattern: Enforce Conventional Commits pattern to improve commit | |
| message clarity and automation.' | |
| enabled: true | |
| severity: medium | |
| event_types: | |
| - pull_request | |
| parameters: {} | |
| - description: 'title_pattern: Enforce Conventional Commits pattern to improve commit | |
| message clarity and automation.' | |
| enabled: true | |
| severity: medium | |
| event_types: | |
| - pull_request | |
| parameters: | |
| pattern: '^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?: .+' |
🤖 Prompt for AI Agents
In @.watchflow/rules.yaml around lines 30 - 36, The rule's parameters are empty
so the title_pattern check never runs; add a parameters section including a
title_pattern regex that enforces Conventional Commits (e.g., a regex matching
types like feat|fix|chore etc., optional scope, and a subject) and an optional
error_message/description to surface on failure. Update the rule's parameters
key to include title_pattern (and optionally error_message) so the pull_request
event uses that regex when validating PR titles.
Add Watchflow Governance Rules
This PR adds automated governance rules for warestack/watchflow based on repository analysis of recent PR history and codebase patterns.
Repository Health Analysis Report: warestack/watchflow
This report provides a data-driven assessment of the current health of the warestack/watchflow repository based on hygiene metrics from the last 30 merged pull requests and repository context.
Summary and Recommendations
Addressing these areas will significantly improve repository health, code quality, and team collaboration effectiveness.
Recommended Rules
require_linked_issue: Block PRs without issue references to improve traceability and reduce drive-by contributions. - High
Rationale: The rule 'require_linked_issue' directly addresses the high Unlinked Issue Rate (40.0%), which impairs traceability and complicates impact analysis, by blocking PRs without linked issues to ensure all changes are properly tracked and reviewed.
max_pr_size: Limit PR size to prevent large, hard-to-review changes and encourage focused contributions. - Medium
Rationale: The max_pr_size rule is recommended to address the medium-severity issue of large PR sizes (average 428 lines), which hinder effective code review and increase the risk of defects. Limiting PR size encourages smaller, more focused contributions, improving review quality and reducing integration risks.
code_owners: Enforce CODEOWNERS approval to prevent bypassing critical code reviews and ensure vetted changes. - High
Rationale: The rule to enforce CODEOWNERS approval directly addresses the high Codeowner Bypass Rate of 35%, mitigating risks of unvetted changes in critical areas and ensuring that all pull requests undergo proper review by designated experts.
required_workflows: Ensure CI workflows pass before merging to maintain code quality and prevent regressions. - Critical
Rationale: The rule to require passing CI workflows before merging directly addresses the critical issue of 0% test coverage on new code by enforcing automated testing and quality checks, thereby preventing regressions and improving overall code reliability.
title_pattern: Enforce Conventional Commits pattern to improve commit message clarity and automation. - Medium
Rationale: Enforcing the Conventional Commits pattern improves commit message clarity and consistency, which supports better traceability and automation, directly addressing the high unlinked issue rate and issue-diff mismatch problems identified in the repository analysis.
Changes
.watchflow/rules.yamlwith the recommended governance rulesNext Steps
.watchflow/rules.yamlGenerated by Watchflow repository analysis.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.