CCM-19694: Config validation#64
Open
m-houston wants to merge 3 commits into
Open
Conversation
Cherry-pick the shared validation and validation-reporting work onto CCM-19694 without the supplier reports package. Includes config-store integrity validation, excel-parser mapping validation/reporting, and publisher error-detail propagation.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a shared “config-store integrity” validation layer to catch cross-record/business-rule inconsistencies that schema validation alone can’t detect, and wires it through the Excel parser plus both DynamoDB and EventBridge publishers so they fail early with more actionable diagnostics.
Changes:
- Added
validateConfigStoreIntegrity()in@supplier-config/file-storeto validate promotedletter-variant→pack-specification/supplier-packmappings andvolume-group/supplier-allocationreferences, including diagnostic detail lines. - Added Excel-parser support to run integrity validation against parsed workbook data and report grouped per-variant warnings via CLI.
- Updated both publishers to run integrity validation after schema validation and include diagnostic detail lines in thrown error summaries; updated GitHub composite actions to better resolve bundles when referenced by commit SHA.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/file-store/src/validation/entity-schemas.ts | Centralises entity→schema mapping using source-domain schemas. |
| packages/file-store/src/validation/config-store-validator.ts | Switches to shared schema map import for schema validation. |
| packages/file-store/src/validation/config-store-integrity-validator.ts | Implements cross-record integrity validation + diagnostics for promoted variants. |
| packages/file-store/src/types.ts | Extends ValidationIssue with optional details lines. |
| packages/file-store/src/index.ts | Exports integrity validator from package entrypoint. |
| packages/file-store/src/tests/config-store-validator.test.ts | Updates schema mocking to match new per-entity schema imports. |
| packages/file-store/src/tests/config-store-integrity-validator.test.ts | Adds unit coverage for integrity rules and diagnostic output. |
| packages/excel-parser/src/mapping-validation.ts | Builds an in-memory store from parse results and runs shared integrity validation as warnings. |
| packages/excel-parser/src/mapping-validation-report.ts | Groups and formats mapping warnings per variant with deduped detail lines. |
| packages/excel-parser/src/index.ts | Re-exports new mapping validation/report APIs. |
| packages/excel-parser/src/cli-parse.ts | Adds --check-mappings option and grouped warning output. |
| packages/excel-parser/src/tests/mapping-validation.test.ts | Adds regression tests for mapping validation warnings. |
| packages/excel-parser/src/tests/mapping-validation.specifications.test.ts | Adds synthetic diagnostics coverage without relying on real workbook IDs. |
| packages/excel-parser/src/tests/mapping-validation-report.test.ts | Tests warning grouping/deduping/formatting logic. |
| packages/excel-parser/src/tests/cli-parse.formatting.test.ts | Ensures inputs produce multiple warnings sharing detail lines for grouping. |
| packages/excel-parser/README.md | Documents new mapping validation CLI option + API usage. |
| packages/excel-parser/package.json | Adds dependency on @supplier-config/file-store to consume shared validation. |
| packages/eventbridge-publisher/src/run.ts | Runs integrity validation pre-publish; includes details lines in error summaries. |
| packages/eventbridge-publisher/src/tests/run.test.ts | Adds tests for integrity-validation failure mode and detail inclusion. |
| packages/ddb-publisher/src/run.ts | Runs integrity validation pre-audit/publish; includes details lines in error summaries. |
| packages/ddb-publisher/src/tests/run.test.ts | Adds tests for integrity-validation failure mode and detail inclusion. |
| actions/eventbridge-publish/action.yml | Enhances bundle resolution: attempts tag resolution for commit SHA refs; falls back to workflow artifacts by commit/branch. |
| actions/ddb-publish/action.yml | Same bundle-resolution enhancement as eventbridge-publish action. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds shared config-store integrity validation, surfaces those validation results through the Excel parser, and ensures the DynamoDB/EventBridge publishers fail early with clearer error output when the config is incomplete or internally inconsistent.
What changed
packages/file-storevalidateConfigStoreIntegrity()for cross-record/business-rule validation.letter-variantrecords, including:pack-specificationrecordssupplier-packrecordsPRODsupplier packs must be inAPPROVEDstate to count as validvolume-grouprecords must existvolume-grouprecords must have an associatedsupplier-allocationdetails?: string[]to sharedValidationIssue.packages/excel-parservalidateIncompleteMappings()to run the shared integrity validation against parsed workbook data.packages/ddb-publisherpackages/eventbridge-publisherWhy
Previously, schema validation alone could succeed even when promoted variants did not have valid downstream mappings for publication.
This PR adds a shared integrity-validation layer so incomplete or inconsistent promoted configurations are caught before publish, and the resulting errors are much easier to interpret.
Validation
The following checks were run locally:
Type of changes
Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.