Repository navigation
Conversation
Signed-off-by: ASVLCII <308706627+ASVLCII@users.noreply.github.com>
|
|
|
All checks and EasyCLA are green now. Feel free to merge when you're ready. |
|
I am happy with these changes, I would also want the opinion of Matt Bain on this though. |
|
Sounds good, happy to wait for Matt's review. The fixture move I mentioned is still outstanding on my side. |
rocketstack-matt
left a comment
There was a problem hiding this comment.
Design and tests look right — flows are matched by unique-id and correctly wired into hasChanges/summary/JSON output. Two things before merge: this branch conflicts with main (a parallel PR added MetadataDiffResult to the same ArchitectureDiffResult union), and the CLI README's diff section doesn't mention flows yet (it still documents/shows only Nodes/Relationships in the --format summary output).
| controlItemsModified: { [controlId: string]: ControlItemDiffResult }; | ||
| } | ||
|
|
||
| export interface FlowDiffResult { |
There was a problem hiding this comment.
Nit: this is the only composed result interface here without a doc comment (AdrDiffResult/ControlDiffResult above both have one).
|
@ASVLCII are you able to resolve the conflicts and add the doc comment? |
|
Resolved the conflict with current main, including both flow and metadata diff results. Added the FlowDiffResult doc comment, moved flow cases into diff-test-architectures.json, and updated the CLI summary docs to include flows. The focused diff suites pass locally with 89 tests, and the scoped diff check is clean. The merge brings in whitespace warnings from unrelated upstream files, which I left unchanged. CI is running on the update. |
rocketstack-matt
left a comment
There was a problem hiding this comment.
The build is broken by an unclosed doc comment in diff-types.ts, which is why every CI job is red. Everything else is small.
| flowsSame: CalmFlowSchema[]; | ||
| } | ||
|
|
||
| /** |
There was a problem hiding this comment.
This /** never closes, so MetadataDiffResult is swallowed by the comment and every CI job fails on TS2552: Cannot find name 'MetadataDiffResult'. Restoring the original comment also completes the doc-comment nit above.
| /** | |
| /** | |
| * Represents the result of diffing two CALM Metadata Schema objects. | |
| */ |
| ...flowsDiff, | ||
| ...flowsDiff, |
There was a problem hiding this comment.
flowsDiff is spread twice. Harmless at runtime, but it looks like a merge artefact.
| ...flowsDiff, | |
| ...flowsDiff, | |
| ...flowsDiff, |
| }; | ||
| } | ||
|
|
||
| export function diffFlows(flowsA: CalmFlowSchema[], flowsB: CalmFlowSchema[]): FlowDiffResult { |
There was a problem hiding this comment.
Flows without a unique-id all collapse onto one Map key, so a removed id-less flow can be reported as unchanged: two id-less flows on side A and one on side B gives flowsSame: 1, flowsRemoved: 0, and --exit-code passes. diffNodesAndRelationships guards the same case by surfacing id-less items under invalidItems so they count as a change. Happy for this to be a follow-up issue if you'd rather keep this PR tight.
(non-blocking nit) The other exported sub-diffs all carry a JSDoc; this one doesn't.
| export function diffFlows(flowsA: CalmFlowSchema[], flowsB: CalmFlowSchema[]): FlowDiffResult { | |
| /** | |
| * Core diff function for CALM flow arrays. Flows are matched by `unique-id` and classified as added, removed, modified or unchanged. | |
| */ | |
| export function diffFlows(flowsA: CalmFlowSchema[], flowsB: CalmFlowSchema[]): FlowDiffResult { |
| { | ||
| "unique-id": "read-flow", | ||
| "name": "Read flow", | ||
| "description": "Writes a record.", |
There was a problem hiding this comment.
(non-blocking nit) read-flow still says "Writes a record."
| "description": "Writes a record.", | |
| "description": "Reads a record.", |
|
Closing due to inactivity - please feel free to reopen if you get the chance to look back into this @ASVLCII |
|
I missed your September 27 review, @rocketstack-matt. Sorry about that. The unclosed doc comment is a real build break, and I also missed the duplicate flowsDiff spread and the id-less flow case you flagged. I'll work through those and the remaining doc nits, then rerun the checks before reopening. The earlier local result doesn't cover the review findings. |
|
@ASVLCII we are having some requests to get this feature up and running, any chance we could step up the timeline? |
|
Yep @aamanrebello, I owe you the fixes and let this sit too long. I'm prioritizing the outstanding review now: the broken doc comment, duplicate flowsDiff spread, and handling for flows without IDs. I'll rerun the build and regression tests before reopening, then post the results here. Sorry for the delay. |
|
@ASVLCII a small reminder |
|
@aamanrebello @rocketstack-matt, sorry for the delay. The review fixes are pushed in 868fdbc, and the branch is current with main. The broken JSDoc, duplicate spread and missing flow IDs are addressed. Verification results are in the PR description, including the four coverage shortfalls reproduced unchanged on upstream. The separate verification workflow is not in the patch. GitHub reports |
Description
Fixes #2998. Include flows in architecture diffs, JSON output, summaries and
--exit-code. Match flows byunique-id; report missing IDs underinvalidItemsso they cannot silently pass the change gate.Addresses the outstanding review: close the metadata JSDoc, remove the duplicate spread, preserve invalid nodes and relationships when composing flow results, use fixture-based tests, and update the CLI documentation. Pattern diffs retain optional flow fields.
AI-assisted: Codex helped restore, review and verify this patch.
Type of Change
Affected Components
cli/)calm-lab/)calm-models/)shared/)Commit Message Format
Commits use Conventional Commits. Existing commits and authorship are preserved; upstream updates are merged without rewriting history.
Testing
Verified on GitHub-hosted Linux runners with Node 26.3.1 and Java 21, not the Windows host:
Coverage limitations:
@calmstudio/calm-core,@calmstudio/extensions,@calmstudio/mcpand@calmstudio/studiofall below their configured coverage thresholds. All four failures reproduce with identical percentages on unmodified upstream8bac0ba7; no thresholds were changed. The full-test checkbox remains unchecked because the coverage command is not green. The verification-only workflow is not part of this PR.Checklist