ADFA-5123: Document docdb SQL-authoring gotchas from ADFA-5088 - #1666
Conversation
Add two lessons learned writing SQL migration scripts against documentation.db: a local copy's on-disk schema/content can be stale independent of git history (a stale copy caused a real near-miss in ADFA-5088 - a script validated against it would have silently overwritten curated production content), and the .bail on / guard-table pattern needed for a BEGIN/COMMIT script to actually be atomic against a bad or empty Brotli payload. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 Walkthrough
WalkthroughThe documentation now explains how to verify ChangesDocumentation database guidance
Estimated code review effort: 1 (Trivial) | ~3 minutes Mergeability Score: 🔵 Low · up to The documentation references a SQL script that is not included, so readers cannot verify the documented cleanup and directory-creation safeguards. The change remains localized and mergeable with explicit owner follow-up to add the script or correct the reference. Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Insecure /tmp filenames (CWE-377) were found and fixed in the ADFA-5088 docdb scripts after this doc's first pass - a fixed, guessable name under world-writable /tmp lets another local user pre-plant a symlink or race the write/read pair. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary
Adds two things learned writing SQL migration scripts against
documentation.dbduring ADFA-5088:.systemdot-command can hit a content-dependent shell-parsing failure when a line chains multiple operators — keep each line to one plaincommand | pipe > file. And.bail onis required forBEGIN/COMMITto actually be atomic (verified empirically: without it, a mid-script error still letsCOMMITthrough with whatever succeeded before it), plus a guard-table pattern for catching a failed/empty Brotli payload before it reaches the real table.Test plan
spotlessCheckpassesdocs/docdb/ADFA-5088-preference-tooltips.sql) is the actual working script from ADFA-5088, validated end-to-end against a realdocumentation.db🤖 Generated with Claude Code