Commit Graph

7 Commits

Author SHA1 Message Date
Enzo Martellucci
af961ce252 fix(database): address second round of modal validation review feedback
- Treat any non-empty validation object as blocking in the save guard;
  the previous  check missed object-shaped returns like
  the duplicate database_name error and let the save proceed
- Forward ssh_tunnel into build_db_for_connection_test so tunnel-only
  databases are reached through the tunnel during validation instead of
  being pinged directly, mirroring the existing test_connection flow
- Honor explicit parameters.ssh === False as authoritative; a stale
  ssh_tunnel payload no longer keeps SSH validation on after the user
  toggles the tunnel off
- Emit both  and  as missing credentials so the
  active SSH login pane always surfaces the field error (the backend
  doesn't know which method the user picked)
2026-05-27 13:33:33 +02:00
Enzo Martellucci
baf701c022 fix(database): address review feedback on modal validation regressions
- Drop private_key implies private_key_password check; the schema permits
  unencrypted private keys and the prior check rejected valid SSH configs
- Surface SSH feature-flag and missing-port errors as field-level
  SupersetError entries instead of raising 400s, so blur-driven validation
  shows field hints rather than hard toasts
- Return null from both stale paths in useDatabaseValidation so callers
  can distinguish discarded responses from real outcomes and skip caching
- Add isValidating to LabeledErrorBoundInputProps so the prop typechecks
  explicitly instead of via the [x: string]: any index signature
2026-05-27 12:47:56 +02:00
Enzo Martellucci
f846e106b8 fix(database): tighten validate_parameters SSH and bypass-engine paths
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>
2026-05-06 12:32:35 +02:00
Enzo Martellucci
86b3d8922c test(database): cover new validate command branches
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>
2026-05-06 11:21:53 +02:00
Beto Dealmeida
5af4e61aff feat: improve GSheets OAuth2 (#32048) 2025-03-03 12:55:54 -05:00
Maxime Beauchemin
e51b95ffa8 chore: enforce more ruff rules (#31447)
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
2024-12-18 17:41:34 -08:00
Beto Dealmeida
0415ed34ce feat: allow create/update OAuth2 DB (#30071) 2024-09-03 19:22:38 -04:00