feat(cli): tighten column-selection UX in init / schema build#398
feat(cli): tighten column-selection UX in init / schema build#398coderdan wants to merge 1 commit intodan/init-agent-handofffrom
Conversation
- Lift eql_v2_encrypted columns out of the multiselect; show them as a
"will be kept as-is" note and merge them into the schema automatically.
Closest we can get to "displayed but not toggleable" given clack has
no disabled-row affordance.
- Drop required:true. Empty submissions now route to an explicit recovery:
warn-and-reprompt with no priors, or "Skip encryption for the <x> table?"
confirm when at least one other table has been configured this run.
- Confirmation summary after >=1 column picked, with re-prompt on no.
- All-already-encrypted edge case: skip the multiselect and confirm
"keep as-is?" so we never offer an empty picker.
- selectTableColumns return type is now a discriminated
{ kind: 'schema' | 'skip' | 'cancel' } so the outer loop tells skip
from cancel.
- Filter eql_v2_* tables out of introspection. eql_v2_configuration is
EQL's own configuration store; encrypting it would break EQL itself.
🦋 Changeset detectedLatest commit: 76e37c0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value). 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 |
Closes #396.
Stacked on #395 — review #395 first.
Summary
Three closely related fixes to the per-table column picker used by
stash initandstash schema build:required: trueon the multiselect and handles the empty case explicitly: warn-and-reprompt if no other tables have been configured this run, or offer "Skip encryption for the<x>table" as an explicit escape if priors exist.eql_v2_encryptedare surfaced above the prompt as a "will be kept as-is" note and merged into the schema automatically. clack has no disabled-row affordance, so this is the closest we get to "displayed but not selectable". If every column in a table is already encrypted, the multiselect is skipped and we just confirm "keep as-is?".eql_v2_*(e.g.eql_v2_configuration) is excluded from introspection so it never appears as a candidate — encrypting EQL's own configuration store would brick EQL.Plus a small UX win: after a user picks ≥1 column, init reads back the selection (
Encrypt 3 columns in "users" (email, name, and ssn)?) and lets them back out into the picker if they misclicked.API change
selectTableColumnsnow returns a discriminated{ kind: 'schema' | 'skip' | 'cancel' }sobuildSchemasFromDatabasecan tell "user skipped this one table" from "user cancelled the whole flow". The outer return shape (SchemaDef[] | undefined) is unchanged.Out of scope
introspectDatabasestill only scans thepublicschema. Filed #397 to track the broader question of multi-schema support — would expand the surface here meaningfully and is better as its own change.Test plan
buildColumnDefs,joinNames,pgTypeToDataType,allSearchOps) — 18 new tests inlib/__tests__/introspect.test.ts.stash initagainst a project that already has one EQL column on a re-run; confirm pre-encrypted columns appear as a "kept as-is" note (not in the picker), the multiselect requires ≥1 new pick, and the confirmation summary fires before moving on.<x>table?" prompt appears.eql_v2_configurationdoes not appear in the table list.