Skip to content

fix(cli): include flows in architecture diffs - #3046

Open
ASVLCII wants to merge 1 commit into
finos:mainfrom
ASVLCII:fix/diff-flows
Open

ASVLCII wants to merge 1 commit into
finos:mainfrom
ASVLCII:fix/diff-flows

Conversation

@ASVLCII

@ASVLCII ASVLCII commented Sep 1, 2026

Copy link
Copy Markdown

Description

Fixes #2998. calm diff now includes top-level flows. Flows match by unique-id; a changed flow is reported as modified.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds new functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🎨 Code style/formatting changes
  • ♻️ Refactoring (no functional changes)
  • ⚡ Performance improvements
  • ✅ Test additions or updates
  • 🔧 Chore (maintenance, dependencies, CI, etc.)

Affected Components

  • CLI (cli/)
  • Schema (calm/)
  • CALM AI (calm-ai/)
  • CALM Hub (calm-hub/)
  • CALM Hub UI (calm-hub-ui/)
  • CALM Server (calm-server/)
  • CALM Widgets (calm-widgets/)
  • Documentation (docs/)
  • Shared (shared/)
  • VS Code Extension (calm-plugins/vscode/)
  • Dependencies
  • CI/CD

Testing

  • I have tested my changes locally
  • I have added/updated unit tests
  • All existing tests pass

Focused model and shared diff tests pass. The focused commands exit non-zero only because the repository applies global coverage thresholds to a single-file run.

Checklist

  • My commits follow the conventional commit format
  • I have updated documentation if necessary
  • I have added tests for my changes (if applicable)
  • My changes follow the project's coding standards

Signed-off-by: ASVLCII <308706627+ASVLCII@users.noreply.github.com>
@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 1, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: ASVLCII / name: ASVLCII (d26b2cc)

@github-actions github-actions Bot added the shared label Sep 1, 2026
@ASVLCII

ASVLCII commented Sep 1, 2026

Copy link
Copy Markdown
Author

All checks and EasyCLA are green now. Feel free to merge when you're ready.

Comment thread shared/src/commands/diff/diff-core.ts
};

it('detects added, removed, modified, and unchanged flows', () => {
const base = { ...testArchitectures.baseArchitecture, flows: [flow] } as CalmArchitectureSchema;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we perhaps create new architectures within ./fixtures/diff-test-architectures.json? This is the current convention in these specs, rather than relying on the base architecture. Maybe we could update the base architecture to add flows: [flow] and then create a new architecture based on changed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that fits the existing specs better. I'll move these cases into diff-test-architectures.json, add the flow to the base fixture, and derive the changed case from it. Keeps the test setup consistent with the rest of the file.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with Aman's convention point — worth moving before merge so the flow test cases match the rest of the file.

@aamanrebello

Copy link
Copy Markdown
Contributor

I am happy with these changes, I would also want the opinion of Matt Bain on this though.

@ASVLCII

ASVLCII commented Sep 5, 2026

Copy link
Copy Markdown
Author

Sounds good, happy to wait for Matt's review. The fixture move I mentioned is still outstanding on my side.

@rocketstack-matt rocketstack-matt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this is the only composed result interface here without a doc comment (AdrDiffResult/ControlDiffResult above both have one).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

calm diff does not compare flows: deleting a flow reports no changes and --exit-code returns 0

3 participants