feat: add deprecation messaging for legacy Netlify DB extension#8141
feat: add deprecation messaging for legacy Netlify DB extension#8141
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughIn experimental mode ( Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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
🧹 Nitpick comments (1)
src/commands/database/status.ts (1)
80-80: Remove the explanatory inline comment.The condition already makes the intent clear, so this comment is redundant and can be removed.
Suggested change
- // Show deprecation warning if a legacy extension DB is detected if (databaseUrlEnv?.key === 'NETLIFY_DATABASE_URL') {As per coding guidelines,
Never write comments on what the code does; make the code clean and self-explanatory instead.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/commands/database/status.ts` at line 80, Remove the redundant inline comment "// Show deprecation warning if a legacy extension DB is detected" that sits above the condition which detects a legacy extension DB in the status command handler; leave the condition and deprecation warning logic intact (no code changes other than deleting that comment) so the intent is expressed by the condition itself.
🤖 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/database.ts`:
- Line 96: Update the CLI help text for the "db init" command so the
.description() string reflects the command's actual behavior (it only displays a
deprecation/migration message rather than initializing a DB). Locate the
.description('Initialize a new database for the current site') call in the
database command setup (the db init command definition) and replace the text
with a concise message like "Display deprecation/migration notice for database
initialization" or "Show deprecation/migration instructions for db init" so help
output matches runtime behavior.
---
Nitpick comments:
In `@src/commands/database/status.ts`:
- Line 80: Remove the redundant inline comment "// Show deprecation warning if a
legacy extension DB is detected" that sits above the condition which detects a
legacy extension DB in the status command handler; leave the condition and
deprecation warning logic intact (no code changes other than deleting that
comment) so the intent is expressed by the condition itself.
🪄 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: bc262789-4240-48dc-997a-76e06439801b
📒 Files selected for processing (2)
src/commands/database/database.tssrc/commands/database/status.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
🎉 Thanks for submitting a pull request! 🎉
Summary
Adds deprecation messaging to the CLI for users of the legacy Netlify DB extension, ahead of the Netlify DB primitive GA launch on April 21. https://linear.app/netlify/issue/RUN-2729/update-cli-behavior-on-legacy-netlifydb
db init: Re-registered in the new CLI flow as an informational command. Instead of "command not found," users get a message that databases are now auto-provisioned via @netlify/db, plus a migration link for legacy extension users.db status: WhenNETLIFY_DATABASE_URLis detected (indicating a legacy extension DB), shows a deprecation warning with a link to ntl.fyi/db-migration after the normal status output.Old CLI users are handled separately by extension-side gating (PR #255).
For us to review and ship your PR efficiently, please perform the following steps:
passes our tests.
A picture of a cute animal (not mandatory, but encouraged)