Summary
As a Nullstone user, I want Nullstone to automatically detect when an embedded module has changed on a GitOps-tracked branch and publish a new build version — so that my infrastructure always reflects the latest committed module without any manual publishing step.
Background
When a user merges changes to a GitOps-tracked branch, Nullstone already detects changes to IaC declaration files and triggers an infrastructure sync. Embedded modules extend this behavior: Nullstone must also inspect the merge commit for changes to module paths, and if detected, publish a new build version before the IaC sync runs.
Change detection must be reliable and efficient. Two layers are used:
- Git diff (efficiency layer): Check whether any files under the module path appear in the merge commit diff. If not, skip the module entirely.
- Content hash (source of truth): Package the module and compare its hash to the last published version. Only publish if the hash differs. This handles edge cases where a diff is present but the effective content is unchanged (e.g., whitespace-only changes, reverted edits).
Acceptance Criteria
Git Diff Detection
Content Hash Comparison
Versioning
Publish Outcome
Force Publish
Observability
Technical Notes
- The deterministic archive must produce identical hashes for identical file contents regardless of file metadata (timestamps, permissions). Standard practice: sort files by path, strip metadata before hashing.
- The content hash and last published version ref are stored per-module-per-repo in Nullstone's backend, keyed by
(org, repo, module-name).
- The git diff check uses the merge commit's diff, not a comparison against
HEAD~1, to correctly handle squash merges and force pushes.
Out of Scope
- PR-level plan previews (referenced in the epic as a future feature).
- Publishing on push to non-GitOps-tracked branches.
- Promoting build versions to release channels.
Summary
As a Nullstone user, I want Nullstone to automatically detect when an embedded module has changed on a GitOps-tracked branch and publish a new build version — so that my infrastructure always reflects the latest committed module without any manual publishing step.
Background
When a user merges changes to a GitOps-tracked branch, Nullstone already detects changes to IaC declaration files and triggers an infrastructure sync. Embedded modules extend this behavior: Nullstone must also inspect the merge commit for changes to module paths, and if detected, publish a new build version before the IaC sync runs.
Change detection must be reliable and efficient. Two layers are used:
Acceptance Criteria
Git Diff Detection
Content Hash Comparison
Versioning
0.0.0-<short-git-sha>.version:, that version is used as the base (e.g.,1.2.0-<short-sha>).Publish Outcome
Force Publish
force-publish: trueflag on the module declaration in.nullstone/config.yml.force-publish: trueis set, Nullstone skips the content hash comparison and always publishes on the next GitOps event.force-publishflag (sets it tofalse) in config after a successful forced publish.ns modules publish <module-name> --force(see Story 4).Observability
Technical Notes
(org, repo, module-name).HEAD~1, to correctly handle squash merges and force pushes.Out of Scope