Skip to content

Feat: Add Configurable Discovery Validation Capabilities - #37

Merged
ClassicMMT merged 3 commits into
mainfrom
configurable-discovery-validation
Jul 31, 2026
Merged

Feat: Add Configurable Discovery Validation Capabilities#37
ClassicMMT merged 3 commits into
mainfrom
configurable-discovery-validation

Conversation

@ClassicMMT

@ClassicMMT ClassicMMT commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Required for datamasque-cli PR.

@ClassicMMT
ClassicMMT marked this pull request as draft July 19, 2026 22:45
@ClassicMMT ClassicMMT self-assigned this Jul 19, 2026
@ClassicMMT ClassicMMT changed the title Add Configurable Discovery Validation Capabilities Feat: Add Configurable Discovery Validation Capabilities Jul 19, 2026
@ClassicMMT
ClassicMMT force-pushed the configurable-discovery-validation branch 2 times, most recently from 8b85d87 to ab9865a Compare July 20, 2026 03:15
@ClassicMMT
ClassicMMT requested a review from kanewilliams July 20, 2026 19:55
@ClassicMMT
ClassicMMT force-pushed the configurable-discovery-validation branch from ab9865a to 922e121 Compare July 20, 2026 20:10
@ClassicMMT
ClassicMMT changed the base branch from main to typed-safe-data-preview July 20, 2026 20:12
@ClassicMMT
ClassicMMT requested review from kw-datamasque and removed request for kanewilliams July 20, 2026 21:22
@kw-datamasque

Copy link
Copy Markdown

Some preliminary comments for now. Will give it a proper review once a few other PRs settle.

Comment thread datamasque/client/discovery_config_libraries.py Outdated
Comment thread datamasque/client/models/discovery_config.py Outdated
Comment thread datamasque/client/models/status.py Outdated
Comment thread datamasque/client/base.py Outdated
Base automatically changed from typed-safe-data-preview to main July 24, 2026 00:52
@ClassicMMT
ClassicMMT force-pushed the configurable-discovery-validation branch 9 times, most recently from dba5ba1 to 2a74f0b Compare July 30, 2026 21:34
- Add `validate_discovery_config` and `validate_discovery_config_library`.
- Add `validation_error_details` to `DiscoveryConfig` and `usage_count` to
  `DiscoveryConfigLibrary`.
- Reject configs and libraries with no YAML content, with an error that says
  how to fix it.
- Ensure validating leaves nothing behind, even when it fails.
- Let pydantic parse the nested errors payload instead of a custom validator
- Add DataMasqueArgumentError
@ClassicMMT
ClassicMMT force-pushed the configurable-discovery-validation branch from 2a74f0b to 59d92d9 Compare July 30, 2026 22:04
@cph-datamasque

Copy link
Copy Markdown
Collaborator

As discussed - I don't think we should be doing things like creating temporary objects in this code. Obviously the proper thing to do is introduce a dedicated server API (may not be too hard?), but failing that, the CLI could keep doing it, like it does for rulesets.

If you're introducing the ArgumentError (is OK, though python's ValueError does the job perfectly well), it should be consistent everywhere across the library.

Keep the validation_errors aliasing until we do the refactor, that's a useful consistency fix. Likewise the usage_count and error checking (empty id/yaml field) are good to have.

The changelog says you added update_discovery_config, but that already existed.

- Move temp file logic to cli
- Removed DataMasqueArgumentError
@ClassicMMT
ClassicMMT marked this pull request as ready for review July 30, 2026 22:53
@ClassicMMT

Copy link
Copy Markdown
Contributor Author

@cph-datamasque

Have moved the temp objects to the cli.
Removed the argument error - don't need it anymore since handling can be done in the cli.
Kept the rest and updated the changelog.

@ClassicMMT
ClassicMMT merged commit 7470a13 into main Jul 31, 2026
9 checks passed
@ClassicMMT
ClassicMMT deleted the configurable-discovery-validation branch July 31, 2026 00:56
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.

3 participants