Summary
Add conditional rule logic to Watchflow to apply stricter checks for first-time contributors. First-time contributors (users with no prior merged PRs) often need additional scrutiny, but applying the same rules to all contributors can create friction for newcomers.
Motivation
- First-time contributors may not be familiar with project conventions
- Additional validation (tests, docs, changelog) helps maintain quality
- Stricter rules for newcomers reduces risk of unexpected issues
- However, over-restricting can discourage contributions
Proposed Solution
Add conditional logic to the rule engine that allows rules to be applied only when certain conditions are met. For example:
Use Cases
-
First-time contributor checks
rules:
- name: Require Changelog
condition: contributor.is_first_time
- name: Require Tests
condition: contributor.pr_count == 0
- name: Require Description
condition: contributor.pr_count < 3
-
File-pattern based rules
- Only require tests for sensitive paths (e.g., src/auth/) for external contributors
-
Team-specific rules
- Only apply certain checks for external collaborators
- Relaxed rules for core team members
Proposed Implementation
Add a condition field to rules in rules.yaml:
rules:
- name: Require Changelog
condition: contributor.pr_count == 0 or files.match("src/auth/**")
parameters:
changelog_required: true
Available Conditions
- contributor.pr_count — Number of merged PRs by the contributor
- contributor.is_first_time — Shorthand for contributor.pr_count == 0
- contributor.trusted — User has merged PRs or is a CODEOWNER
- files.match(pattern) — Changed files match glob pattern
- risk.level — PR risk assessment level
Technical Approach
- Add a contributor context to the evaluation pipeline
- Parse condition in rules.yaml as an expression
- Evaluate condition before applying the rule
- If condition is false, skip the rule (log at debug level)
Benefits
- Flexibility — Tailor rules to contributor experience level
- Lower barrier — First-time contributors know exactly what's expected
- Reduced friction — Core team members don't get blocked by basic requirements
References
Reactions are currently unavailable
Summary
Add conditional rule logic to Watchflow to apply stricter checks for first-time contributors. First-time contributors (users with no prior merged PRs) often need additional scrutiny, but applying the same rules to all contributors can create friction for newcomers.
Motivation
Proposed Solution
Add conditional logic to the rule engine that allows rules to be applied only when certain conditions are met. For example:
Use Cases
First-time contributor checks
File-pattern based rules
Team-specific rules
Proposed Implementation
Add a condition field to rules in rules.yaml:
Available Conditions
Technical Approach
Benefits
References