You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cli): correct hub push --fail-if-modified comparison and extend to control docs
Addresses review feedback on the strict-push comparison:
- Normalise the local document the same way Hub stores it (rewriting the
$id to the latest version and applying default fields via
updateDocumentMetadata) before comparing, so a version-only difference
(e.g. another committer auto-bumped Hub) or an absent `description` no
longer reports a false "has changed".
- Guard against an empty/unreadable latest-version body: surface a clear
"could not read" error instead of silently reporting "has changed".
- Point users at --change-type in the modified-document error message.
- Extend --fail-if-modified to `control-requirement` and
`control-configuration` push (same normalise-and-compare model).
- Add Commander argv wiring tests so the flag plumbing is covered.
Claude-Session: https://claude.ai/code/session_01QiHAHdi4d4mCoy4wku5s2v
- Resources span architectures, patterns, standards, control-requirements, control-configurations, namespaces, and domains (which subcommands exist varies per verb).
62
-
-`hub push architecture|pattern|standard` auto-bumps by default (creates a new version off the latest). The `--fail-if-modified` flag switches to a strict, non-bumping mode: a brand-new mapping is still created at `1.0.0`, an unchanged document is skipped, and a document that differs from the latest published version fails the push. Content comparison uses `canonicalEqual` from `@finos/calm-shared` (key-order-insensitive).
62
+
-`hub push` auto-bumps by default (creates a new version off the latest). The `--fail-if-modified` flag (supported on `architecture`, `pattern`, `standard`, `control-requirement` and `control-configuration`) switches to a strict, non-bumping mode: a brand-new mapping is still created at `1.0.0`, an unchanged document is skipped, and a document that differs from the latest published version fails the push. The local document is normalised the same way Hub stores it (via `updateDocumentMetadata`/`updateControlDocumentMetadata`) before comparing with `canonicalEqual` from `@finos/calm-shared`, so a version-only or defaulted-field difference is not mistaken for a content change.
0 commit comments