feat: support NETLIFY_DB_BRANCH env var in db status command#8174
feat: support NETLIFY_DB_BRANCH env var in db status command#8174eduardoboucas merged 1 commit intomainfrom
NETLIFY_DB_BRANCH env var in db status command#8174Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis pull request adds support for specifying the remote database branch via the Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/commands/database/status-db.ts`:
- Around line 364-365: Remove the explanatory inline comment that duplicates
behavior for branch resolution; delete the comment line preceding the
declaration so the code reads simply as const branch = options.branch ??
process.env.NETLIFY_DB_BRANCH (no comment needed). Locate the comment that says
"`--branch` can also be supplied via the NETLIFY_DB_BRANCH env var." immediately
above the branch assignment and remove it, leaving the assignment as the
self-explanatory implementation.
🪄 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: 35ab0acf-12c5-4eee-b4f9-d2005e010900
📒 Files selected for processing (2)
src/commands/database/status-db.tstests/unit/commands/database/status-db.test.ts
| // `--branch` can also be supplied via the NETLIFY_DB_BRANCH env var. | ||
| const branch = options.branch ?? process.env.NETLIFY_DB_BRANCH |
There was a problem hiding this comment.
Remove explanatory inline behavior comment.
Line 364-365 documents what the code does; this should be expressed by code only.
Suggested cleanup
- // `--branch` can also be supplied via the NETLIFY_DB_BRANCH env var.
const branch = options.branch ?? process.env.NETLIFY_DB_BRANCHAs per coding guidelines, **/*.{ts,tsx,js,jsx}: Never write comments on what the code does; make the code clean and self-explanatory instead.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // `--branch` can also be supplied via the NETLIFY_DB_BRANCH env var. | |
| const branch = options.branch ?? process.env.NETLIFY_DB_BRANCH | |
| const branch = options.branch ?? process.env.NETLIFY_DB_BRANCH |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/commands/database/status-db.ts` around lines 364 - 365, Remove the
explanatory inline comment that duplicates behavior for branch resolution;
delete the comment line preceding the declaration so the code reads simply as
const branch = options.branch ?? process.env.NETLIFY_DB_BRANCH (no comment
needed). Locate the comment that says "`--branch` can also be supplied via the
NETLIFY_DB_BRANCH env var." immediately above the branch assignment and remove
it, leaving the assignment as the self-explanatory implementation.
🤖 I have created a release *beep* *boop* --- ## [25.1.0](v25.0.1...v25.1.0) (2026-04-21) ### Features * add `db migrations reset` command ([#8177](#8177)) ([3dd0f38](3dd0f38)) * add `db status` command ([#8173](#8173)) ([9bccaf9](9bccaf9)) * Add deploy_source to CLI deploy requests (EX-2032) ([#8155](#8155)) ([289933d](289933d)) * restructure db command files ([#8175](#8175)) ([794c2e0](794c2e0)) * support `NETLIFY_DB_BRANCH` env var in `db status` command ([#8174](#8174)) ([5647420](5647420)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: token-generator-app[bot] <82042599+token-generator-app[bot]@users.noreply.github.com>
Follow-up to #8173.