Skip to content

fix: validate load target cda#236

Open
krowvin wants to merge 1 commit into
mainfrom
fix-185-validate-target-cda
Open

fix: validate load target cda#236
krowvin wants to merge 1 commit into
mainfrom
fix-185-validate-target-cda

Conversation

@krowvin

@krowvin krowvin commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • validate load target CDA URLs before load commands proceed
  • probe the generated OpenAPI document when available
  • fall back to the CDA landing page for local builds that expose the UI without the generated spec route
  • use a 2.5 second probe timeout
  • add --skip-target-cda-check and CWMS_CLI_SKIP_TARGET_CDA_CHECK for cases where the preflight should be bypassed
  • add regression coverage for valid CDA, non-CDA, invalid URL, request failure, flag bypass, and env-var bypass cases

Why

Load dry-runs and copy operations should fail early when --target-cda points somewhere that is not a CDA instance. This prevents users from validating or starting a load command against the wrong service, while still giving operators a bypass for unusual local or network conditions.

Validation

  • poetry run pytest tests/load/test_cda_target_validation.py tests/commands/test_load_location_ids.py tests/commands/test_load_location_ids_bygroup.py tests/load/test_timeseries_data.py -q
  • poetry run pytest -q
  • poetry check (warnings only for existing Poetry metadata deprecations)
  • CLI negative check against local non-CDA service
  • CLI positive check against a local CDA-like landing page

@krowvin krowvin force-pushed the fix-185-validate-target-cda branch from cf8a717 to 3aa4f87 Compare July 11, 2026 23:04
@krowvin krowvin marked this pull request as ready for review July 12, 2026 00:28
@krowvin krowvin requested a review from Enovotny as a code owner July 12, 2026 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant