Skip to content

refactor(code-review): remove feature flags#2764

Merged
alex-alecu merged 4 commits intomainfrom
chore/drop-review-feature-flags
Apr 27, 2026
Merged

refactor(code-review): remove feature flags#2764
alex-alecu merged 4 commits intomainfrom
chore/drop-review-feature-flags

Conversation

@alex-alecu
Copy link
Copy Markdown
Contributor

@alex-alecu alex-alecu commented Apr 23, 2026

Summary

  • Run the GitHub and GitLab merge-commit skip check before cancelling in-flight reviews, and add handler tests so "Update branch" or rebase merge commits do not leave a PR or MR without an active review.
  • Remove the three code review feature flags so new reviews always dispatch as v2, always include PR gate behavior, and always reuse the last completed review for continuation when available.
  • Simplify the personal and organization review config responses plus the settings form by dropping flag-derived UI fields while keeping existing agent_version, v1 event streaming, and admin reporting paths unchanged.

Verification

  • Not run manually; reproducing these webhook-driven review flows requires GitHub or GitLab events, so I validated the branch with local automated checks instead.

Visual Changes

N/A (small settings-form visibility change only; no screenshots captured)

Reviewer Notes

  • The final PR scope is intentionally limited to two commits: the merge-commit cancellation fix and the review-flag removal. The earlier broader refactor was reset away before this diff was rebuilt.
  • agent_version storage/admin views and the legacy v1 streaming/event paths are intentionally still present; this PR only removes the feature-flag gates around them.

When a pull_request.synchronize / merge_request.update event arrives with a merge-commit head (e.g. clicking GitHub's 'Update branch' button), the review was being cancelled before the merge-commit skip check ran, leaving the PR with no active review. Reorder so the merge-commit check runs first and bails out without touching existing reviews. Extract the decision into small pure helpers for unit testing.
@alex-alecu alex-alecu force-pushed the chore/drop-review-feature-flags branch from b687583 to 4d251cc Compare April 24, 2026 02:52
@alex-alecu alex-alecu changed the title refactor(code-review): simplify review flow refactor(code-review): remove feature flags Apr 24, 2026
Comment thread apps/web/src/lib/code-reviews/dispatch/dispatch-pending-reviews.ts
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Apr 24, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • apps/web/src/lib/code-reviews/db/code-reviews.ts
  • apps/web/src/lib/code-reviews/db/code-reviews.test.ts

Reviewed by gpt-5.4-20260305 · 812,131 tokens

@alex-alecu
Copy link
Copy Markdown
Contributor Author

Manual test passed.

Tested:

  • GitLab merge_request.update webhook replay with a two-parent merge-commit head through the local Next.js webhook route.
  • GitLab merge_request.update webhook replay with a normal one-parent head through commit-status, reaction, payload preparation, and review-worker dispatch paths.

Verified:

  • Merge commit returned 200 with "Skipped merge commit", persisted a processed webhook event, created no review row for the merge SHA, and preserved the pre-existing active review.
  • Normal commit returned 202 with "Code review queued" and persisted exactly one new GitLab review row with agent_version = v2.
  • Dispatch payload included agentVersion = v2, gateThreshold = warning, and the configured thinking-effort variant, and GitLab side effects were requested for pending commit status, eyes reaction, and superseded-review cancellation.

@alex-alecu alex-alecu merged commit 9808635 into main Apr 27, 2026
19 checks passed
@alex-alecu alex-alecu deleted the chore/drop-review-feature-flags branch April 27, 2026 13:08
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.

2 participants