Skip to content

feat(fxconfig): add basic snapshot validation helper and tests#228

Open
sachin9058 wants to merge 1 commit into
hyperledger:mainfrom
sachin9058:feat/fxconfig-snapshot-validation
Open

feat(fxconfig): add basic snapshot validation helper and tests#228
sachin9058 wants to merge 1 commit into
hyperledger:mainfrom
sachin9058:feat/fxconfig-snapshot-validation

Conversation

@sachin9058

Copy link
Copy Markdown
Contributor

Type of change

  • New feature
  • Test update

Description

This PR introduces a minimal validation helper for snapshot-like data structures to ensure basic structural correctness before processing.

The validation checks:

  • non-empty channel
  • presence of namespaces
  • non-empty namespace names
  • non-empty key sets
  • valid (non-empty) keys

The goal is to provide a lightweight guard against malformed snapshot input, helping prevent issues during transformation or export stages.

Unit tests are included to cover both valid and invalid scenarios.

Additional details (Optional)

  • Implemented as a standalone utility under internal/validation to keep the scope minimal
  • No changes to existing logic or public APIs
  • Tests include success and edge-case validation (empty channel, namespaces, keys, etc.)

Validation:

  • go test ./tools/fxconfig/... -count=1 passed
  • make lint passed

Related issues

Closes #227

Signed-off-by: Sachin Kumar <sachinkumar905846@gmail.com>
@sachin9058 sachin9058 force-pushed the feat/fxconfig-snapshot-validation branch from 2d2ab31 to 504d3cc Compare May 2, 2026 08:01
@sachin9058

Copy link
Copy Markdown
Contributor Author

Hi @cendhu @mbrandenburger,

I’ve opened this PR to add a minimal snapshot validation helper with unit tests.

The goal is to introduce a lightweight validation step for snapshot-like data structures without affecting existing logic.

Would really appreciate your feedback whenever you get a chance. Happy to refine this further based on your suggestions.

Thanks!

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.

Add snapshot validation step before processing in migration/export flow

1 participant