Skip to content

Add content_hash tracking and extract composer package (Phase 1)#74

Open
swalkinshaw wants to merge 1 commit intomainfrom
incremental-sync-phase-1
Open

Add content_hash tracking and extract composer package (Phase 1)#74
swalkinshaw wants to merge 1 commit intomainfrom
incremental-sync-phase-1

Conversation

@swalkinshaw
Copy link
Copy Markdown
Member

Phase 1 of #52

Foundation for incremental sync: compute and store content hashes at update time so the future sync step can diff against deployed_hash to find what needs uploading to R2.

  • Migration 024: add content_hash, deployed_hash, content_changed_at columns to packages table
  • New internal/composer/ module - pure functions for Composer serialization and hashing with no I/O
  • Add SerializePackage() for tagged/dev file splitting and HashVersions() for lightweight content hashing
  • Compute content_hash in update step after NormalizeAndStoreVersions; only advance content_changed_at when hash actually changes
  • Hash includes trunk_revision so dev-trunk SVN reference changes trigger re-sync

This has no breaking changes by design and does not populate new data yet. Backfill of the new columns with happen naturally during builds + deploys.

Foundation for incremental sync: compute and store content hashes at
update time so the future sync step can diff against deployed_hash
to find what needs uploading to R2.

- Migration 024: add content_hash, deployed_hash, content_changed_at
  columns to packages table
- Extract internal/composer/ from internal/repository/ (format.go,
  serialize.go, hash.go) — pure functions for Composer serialization
  and hashing with no I/O
- Add SerializePackage() for tagged/dev file splitting and
  HashVersions() for lightweight content hashing
- Compute content_hash in update step after NormalizeAndStoreVersions;
  only advance content_changed_at when hash actually changes
- Hash includes trunk_revision so dev-trunk SVN reference changes
  trigger re-sync
- repository/ re-exports from composer/ for builder.go compatibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant