Skip to content

refactor(review): remove the REVIEW_DEFAULTS config layer - #312

Open
eric-factory wants to merge 1 commit into
devfrom
eric/rm-review-defaults
Open

eric-factory wants to merge 1 commit into
devfrom
eric/rm-review-defaults

Conversation

@eric-factory

@eric-factory eric-factory commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Factory Code Review: Web · Desktop

Description

Removes the REVIEW_DEFAULTS config layer that #305 added (commit acd10d4), before it reaches a release.

REVIEW_DEFAULTS let Factory supply review.yaml keys that sit between the built-in defaults and a repository's base-branch .factory/review.yaml. Its only caller was Factory's hosted org-wide code review. That review set security_block_on_critical and security_block_on_high to false so that a security finding would not fail the "Droid Review" check, which the install's GitHub ruleset made required. The hosted install no longer creates that ruleset, and its caller no longer sets the variable, so nothing uses the layer.

The rest of #305 (hosted review reporting like the Actions workflow) is unchanged.

Changes

File Change
src/core/review/config.ts Remove reviewDefaults() and its spread in resolveReviewUxConfig. The precedence goes back to built-in defaults < base-branch review.yaml < nonempty inputs. ReviewConfigError drops the source argument and reason field, which only the REVIEW_DEFAULTS error used. (+3 / -24)
test/core/review/config.test.ts Remove the REVIEW_DEFAULTS describe block (5 cases) and the afterEach import it used. (+1 / -49)
README.md, docs/setup.md Remove REVIEW_DEFAULTS from the documented precedence. (+2 / -2)

config.ts, config.test.ts, and the edited docs lines now match their state before acd10d4. No action input, workflow, or script ever read the variable.

Confirming there is no other caller

  • git grep -i 'review_defaults|reviewDefaults|review-defaults' on this repo's dev finds only the lines removed here.
  • Factory's backend never sets the variable on its default branch. The change that set it for org-wide automations is being dropped there. An unset or ignored variable changes nothing in droid-action, so the two changes can land in either order.

Verification

Run locally with Bun 1.4.5, the version CI uses:

  • bun run typecheck: pass
  • bun run format:check: pass
  • bun test: 2787 pass, 1 fail. The failure is returns original selected paths without exposing them in prompt artifacts (test/github/data/review-artifacts.test.ts). It fails the same way on unmodified dev, and in dev's own CI run for 74950f0 (2792 pass, 1 fail). This PR doesn't touch that code. The 5 fewer tests are the removed REVIEW_DEFAULTS cases.

REVIEW_DEFAULTS (acd10d4, #305) let Factory set review.yaml keys below
a repository's base-branch .factory/review.yaml. Its only caller was
Factory's hosted org-wide code review, which set
security_block_on_critical and security_block_on_high to false so a
security finding would not fail the "Droid Review" check that the
install's GitHub ruleset required. The hosted install no longer creates
that ruleset, and its caller no longer sets the variable, so nothing
uses the layer.

resolveReviewUxConfig is back to built-in defaults < base-branch
review.yaml < nonempty inputs, and ReviewConfigError drops the source
argument and reason field that only the REVIEW_DEFAULTS error used.
The README and setup guide no longer describe the layer. The rest of
#305 (hosted review reporting like the Actions workflow) is unchanged.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@eric-factory
eric-factory marked this pull request as ready for review December 5, 2026 14:08
@factory-droid

factory-droid Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

🟢 Looks good to merge

No issues found in 94994d3. Validation checks were blocked by missing dependencies: the existing configuration tests could not load yaml (0 passed), and type checking could not find tsc. The candidate list is empty, so there are no findings to approve or reject; the full diff was read.

🔒 Security review: no findings.

What changed

Removes the REVIEW_DEFAULTS environment configuration layer and its five test cases, simplifies ReviewConfigError, and updates the documented precedence to built-in defaults, immutable base-branch configuration, then nonempty inputs.

Area Files Summary
Review configuration src/​core/​review/​config.ts Stops reading REVIEW_DEFAULTS and removes the error source argument and reason field used by that layer.
Configuration tests test/​core/​review/​config.test.ts Removes five REVIEW_DEFAULTS cases and their afterEach cleanup import.
Documentation README.md, docs/​setup.md Removes the Factory-supplied environment defaults layer from configuration precedence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant