-
Notifications
You must be signed in to change notification settings - Fork 16
Add Watchflow governance rules (5 rules, 2 high-priority) #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,35 +1,36 @@ | ||||||||||||||||||||||||||||||||
| rules: | ||||||||||||||||||||||||||||||||
| # Essential Open Source Rules | ||||||||||||||||||||||||||||||||
| - description: "Pull requests must have descriptive titles following conventional commit format" | ||||||||||||||||||||||||||||||||
| enabled: true | ||||||||||||||||||||||||||||||||
| severity: "medium" | ||||||||||||||||||||||||||||||||
| event_types: ["pull_request"] | ||||||||||||||||||||||||||||||||
| parameters: | ||||||||||||||||||||||||||||||||
| title_pattern: "^feat|^fix|^docs|^style|^refactor|^test|^chore|^perf|^ci|^build|^revert" | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - description: "New contributors require approval from at least one past contributor" | ||||||||||||||||||||||||||||||||
| enabled: true | ||||||||||||||||||||||||||||||||
| severity: "medium" | ||||||||||||||||||||||||||||||||
| event_types: ["pull_request"] | ||||||||||||||||||||||||||||||||
| parameters: | ||||||||||||||||||||||||||||||||
| min_past_contributors: 1 | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - description: "Code changes must include corresponding tests" | ||||||||||||||||||||||||||||||||
| enabled: true | ||||||||||||||||||||||||||||||||
| severity: "medium" | ||||||||||||||||||||||||||||||||
| event_types: ["pull_request"] | ||||||||||||||||||||||||||||||||
| parameters: | ||||||||||||||||||||||||||||||||
| pattern: "tests/.*\\.py$|test_.*\\.py$" | ||||||||||||||||||||||||||||||||
| condition_type: "files_match_pattern" | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - description: "Changes to critical files require review from code owners" | ||||||||||||||||||||||||||||||||
| enabled: true | ||||||||||||||||||||||||||||||||
| severity: "high" | ||||||||||||||||||||||||||||||||
| event_types: ["pull_request"] | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - description: "No direct pushes to main branch - all changes must go through PRs" | ||||||||||||||||||||||||||||||||
| enabled: true | ||||||||||||||||||||||||||||||||
| severity: "critical" | ||||||||||||||||||||||||||||||||
| event_types: ["push"] | ||||||||||||||||||||||||||||||||
| parameters: | ||||||||||||||||||||||||||||||||
| allow_force_push: false | ||||||||||||||||||||||||||||||||
| - description: 'require_linked_issue: Block PRs without issue references to improve | ||||||||||||||||||||||||||||||||
| traceability and reduce drive-by contributions.' | ||||||||||||||||||||||||||||||||
| enabled: true | ||||||||||||||||||||||||||||||||
| severity: high | ||||||||||||||||||||||||||||||||
| event_types: | ||||||||||||||||||||||||||||||||
| - pull_request | ||||||||||||||||||||||||||||||||
| parameters: {} | ||||||||||||||||||||||||||||||||
| - 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: {} | ||||||||||||||||||||||||||||||||
| - description: 'code_owners: Enforce CODEOWNERS approval to prevent bypassing critical | ||||||||||||||||||||||||||||||||
| code reviews and ensure vetted changes.' | ||||||||||||||||||||||||||||||||
| enabled: true | ||||||||||||||||||||||||||||||||
| severity: high | ||||||||||||||||||||||||||||||||
| event_types: | ||||||||||||||||||||||||||||||||
| - pull_request | ||||||||||||||||||||||||||||||||
| parameters: {} | ||||||||||||||||||||||||||||||||
| - 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: {} | ||||||||||||||||||||||||||||||||
|
Comment on lines
+23
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Empty parameters will prevent This rule is marked 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 |
||||||||||||||||||||||||||||||||
| - description: 'title_pattern: Enforce Conventional Commits pattern to improve commit | ||||||||||||||||||||||||||||||||
| message clarity and automation.' | ||||||||||||||||||||||||||||||||
| enabled: true | ||||||||||||||||||||||||||||||||
| severity: medium | ||||||||||||||||||||||||||||||||
| event_types: | ||||||||||||||||||||||||||||||||
| - pull_request | ||||||||||||||||||||||||||||||||
| parameters: {} | ||||||||||||||||||||||||||||||||
|
Comment on lines
+30
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Empty parameters will prevent 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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty parameters will prevent
max_pr_sizefrom functioning.The
max_pr_sizerule 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