Repository navigation
feat(review): add review_defaults so org-wide workflows set defaults repositories can override - #303
Open
factory-nizar wants to merge 3 commits into
Open
factory-nizar wants to merge 3 commits into
factory-nizar wants to merge 3 commits into
Conversation
…repositories can override A workflow that reviews many repositories, such as one an organization ruleset requires, had to pass settings as action inputs, and nonempty inputs override each repository's .factory/review.yaml. The new review_defaults input takes YAML in the .factory/review.yaml format and sits below the base-branch file in precedence: built-in defaults, platform defaults, review_defaults, base-branch file, nonempty inputs. The input is wired through the root, review, security and prepare actions, the GitLab component template, and documented in the README, docs/setup.md and docs/gitlab-setup.md. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
factory-nizar
marked this pull request as ready for review
December 3, 2026 22:22
Contributor
🟡 Changes recommendedThe change adds organization defaults below repository configuration while preserving explicit input overrides. GitLab variable expansion can alter literal values in those defaults before parsing. All 212 existing tests across the four changed test files passed; targeted inline checks confirmed the path-matching consequence, but no live GitLab pipeline was run. 🔒 Security review: no findings. 1 open finding · What changedAdds the review_defaults YAML input to the GitHub actions and GitLab component, layers it between platform defaults and immutable base-branch configuration, identifies input-origin validation errors, and updates documentation and regression coverage.
Fix with an agentReply to a finding with a question, or comment |
GitLab expands variable references in job variables by default, so a review_defaults value such as an ignore path containing `$id` reached the config parser changed. Mark REVIEW_DEFAULTS `expand: false`. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
#287 reworded automaticReviewSkipReason but left this test expecting the old "automatic trigger labeled is disabled" text, so it fails on dev. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Factory Code Review: Web · Desktop
Part of AUT-3171. The installer side is Factory-AI/factory-mono#41603.
Problem
An organization ruleset can require one Droid review workflow on every repository. Factory-AI's "Require Droid Review" ruleset does this with
Factory-AI/droid-workflows/.github/workflows/droid-review.yml. That workflow can only pass settings as action inputs, and a nonempty input overrides the repository's base-branch.factory/review.yaml. So a repository cannot change a setting the org workflow passes, such asreview_depth.Repositories that wanted their own settings added their own
droid-review.yml. GitHub runs both workflows, so every pull request in those repositories gets two Droid reviews.Change
New
review_defaultsinput: YAML in the.factory/review.yamlformat. It sits below the repository's file, so an org-wide workflow can set defaults that each repository can still override.review_defaults(new).factory/review.yamlon the base branchwith:review_defaultssetting by setting. A list in the file replaces the list fromreview_defaults.Invalid review_defaults input: ..., so it is not mistaken for a problem in.factory/review.yaml.review_defaults(the default) changes nothing.The input is passed through the root,
review/,security/andprepare/actions (asREVIEW_DEFAULTS) and the GitLab component template, which marks the variableexpand: falseso GitLab does not expand$references in it (an ignore path such asapp/$id.tsstays as written). The README has a new "Organization defaults" section;docs/setup.mdanddocs/gitlab-setup.mdlist the input and the new precedence.Follow-up
Factory-AI/droid-workflowsshould move the settings it passes as inputs intoreview_defaults, so repositories under the ruleset can override them. That is a separate PR once this ships.Validation
bun teston the four changed test files: 212 pass, 0 fail. The new tests cover precedence against the file and inputs, list replacement, the error origin for invalid YAML, the GitLab template input and itsexpand: false, and the input and env wiring in every action.bun run typecheckandbun run format:checkpass.Factory-AI/conjures-spaces-playground#30(has a base-branch.factory/review.yaml; the file's values won where both set a key) andFactory-AI/pdlc-workshop-demo#22(no file; thereview_defaultsvalues applied).bun teston macOS: 2652 pass, 64 fail. The same 64 fail on a cleandevcheckout on the same machine; they need Linux-only paths such as/usr/bin/sha256sum.test: 2724 pass, 1 fail (review lifecycle production boundaries > leaves an earlier failing check the head's latest when an automatic trigger is skipped), which also fails ondev.review_defaultsset.