Three correctness fixes to ValidateDatabaseParametersCommand:
1. Bypass engines (bigquery, datastore, snowflake) now also surface
database_name uniqueness errors and SSH tunnel field errors during
progressive validation, instead of silently passing.
2. The SSH feature-flag and database-port guards now fire when the UI
marks parameters.ssh, not just when the ssh_tunnel payload is
non-empty — the form sends an empty tunnel object in early stages.
3. The "parameters are missing" message for SSH tunnel fields now
interpolates the %(missing)s placeholder via gettext, so the
response surfaces the actual missing fields instead of the literal
token.
Adds unit tests for each branch and removes the now-unused
_validate_database_name helper.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
When the validate_parameters request failed without a structured error
body (e.g. network drop), getValidation returned an empty object that
the caller could not distinguish from "validation passed" — and the
blur dedup cache was already updated, so the same form state would never
revalidate until the user changed a field.
Have getValidation return null on unexpected failure and only update
the snapshot cache after a usable response.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The two ``show error alerts on dynamic form`` cases relied on a single
60s ``should('not.be.disabled')`` after typing five fields, but the
``{ timeout: 60000 }`` option on ``.should()`` is not honoured the way
it is on the query — the assertion still uses the project's 8s default
and times out before the chained validation calls complete.
Match the master cadence: explicitly blur each field and wait for the
``@validateParams`` interception before moving on, so the button-state
assertion only fires once validation is settled.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds unit tests for the duplicate-database-name check (create + update
paths, plus the bypass-engine path), the SSH tunnel feature-flag and
db-port guards, and the SSH tunnel field-level error collection
(missing required fields, missing credentials, private key without
password). Brings patch coverage on commands/database/validate.py up
from ~44%.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
userEvent.type fires keystrokes serially through React's event system,
which races with the new debounced validation: ports rendered as number
inputs lose values mid-typing, and dynamic-form tests time out at the
20s default while tabbing between five fields. userEvent.paste also
no longer supplies a clipboardData object the Select onPaste handler can
read.
Switch the affected interactions to fireEvent.change/blur (single-shot,
no per-key validation churn) and revert the paste case to fireEvent.paste,
matching the master form. Behavior under test is unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The blur-debounced validation can fire multiple in-flight requests as the
user types across fields. Without sequencing, an earlier request that
returns later overwrites the result of a newer one, leaving the modal
showing stale errors and keeping the Connect button disabled even after
the form is fully valid.
Track a per-call request id and only update validation state when the
response corresponds to the latest request.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>