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
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
src/auth/) for external contributorsTeam-specific rules
Proposed Implementation
Add a
conditionfield to rules inrules.yaml:Available Conditions
contributor.pr_count— Number of merged PRs by the contributorcontributor.is_first_time— Shorthand forcontributor.pr_count == 0contributor.trusted— User has merged PRs or is a CODEOWNERfiles.match(pattern)— Changed files match glob patternrisk.level— PR risk assessment levelTechnical Approach
contributorcontext to the evaluation pipelineconditionin rules.yaml as an expressionBenefits
References
/reviewersand/riskcommands that already assess contributor history