Skip to content

feat: use differ v4 as default implementation#502

Merged
bzp2010 merged 2 commits into
mainfrom
bzp/feat-default-differ-v4
Jun 28, 2026
Merged

feat: use differ v4 as default implementation#502
bzp2010 merged 2 commits into
mainfrom
bzp/feat-default-differ-v4

Conversation

@bzp2010

@bzp2010 bzp2010 commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Description

Use differ v4 as the default implementation.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible

Summary by CodeRabbit

  • New Features
    • The newer differ behavior is now enabled by default.
    • You can still opt out by setting the feature flag to false or 0 (case/whitespace-insensitive).
  • Bug Fixes
    • Updated feature-flag default and evaluation so the runtime experience matches the intended default behavior more reliably.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b3e2adfd-0639-4847-bc84-be9b28bf538a

📥 Commits

Reviewing files that changed from the base of the PR and between 682d05b and 37479c6.

📒 Files selected for processing (1)
  • libs/differ/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • libs/differ/src/index.ts

📝 Walkthrough

Walkthrough

ENABLE_DIFFER_V4 in libs/differ/src/index.ts now defaults to enabled unless set to "false" or "0", and the environment value is trimmed and lowercased before comparison.

Changes

DifferV4 default gate flip

Layer / File(s) Summary
ENABLE_DIFFER_V4 opt-out default
libs/differ/src/index.ts
Gate expression changed from ['true','1'].includes(... ?? '') to !['false','0'].includes((... ?? 'true').trim().toLowerCase()), and the comment was updated.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • api7/adc#498: Modifies the same ENABLE_DIFFER_V4 gate and Differ selection in libs/differ/src/index.ts.

Suggested reviewers

  • LiteSun
  • guoqqqi
🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
E2e Test Quality Review ⚠️ Warning The PR flips a runtime feature gate, but there’s no E2E/regression test proving @api7/adc-differ resolves to V4 by default or honors ENABLE_DIFFER_V4=false/0. Add a small E2E/regression test that imports the package root and asserts default V4 plus opt-out cases (false, 0, whitespace-trimmed values).
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly states the main change: making differ v4 the default implementation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Security Check ✅ Passed Only the default differ engine flips to v4; no secret logging, auth, TLS, storage, or ownership issues were introduced in the changed code.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bzp/feat-default-differ-v4

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@libs/differ/src/index.ts`:
- Around line 4-7: The ENABLE_DIFFER_V4 gate in index.ts only treats exact
'false' and '0' as opt-out, so legacy values like FALSE, False, or an empty env
var now incorrectly enable DifferV4. Update the logic around ENABLE_DIFFER_V4 to
normalize the environment value before checking it, and preserve the old
behavior for blank or case-variant opt-out values while still defaulting new
installs to DifferV4. Keep the fix localized to the feature-gate constant so the
DifferV3/DifferV4 selection remains backward compatible.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b4609f68-73ee-4a70-a7c1-9baf0ccd3076

📥 Commits

Reviewing files that changed from the base of the PR and between b884105 and 682d05b.

📒 Files selected for processing (1)
  • libs/differ/src/index.ts

Comment thread libs/differ/src/index.ts Outdated
@bzp2010
bzp2010 merged commit 144101e into main Jun 28, 2026
32 checks passed
@bzp2010
bzp2010 deleted the bzp/feat-default-differ-v4 branch June 28, 2026 14:37
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