Skip to content

fix: harden replication before v0.1.0 - #3

Merged
vmvarela merged 3 commits into
masterfrom
fix/replication-safety
Oct 24, 2026
Merged

vmvarela merged 3 commits into
masterfrom
fix/replication-safety

Conversation

@vmvarela

@vmvarela vmvarela commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Problem

Replicating releases newest-first left the destination's Latest pointing to an old version (v0.1.0 instead of v0.27.0 in the real fixture). Replication also modified global Git authentication and could partially push refs; HTTP requests had no explicit timeout.

Result

  • Preserve the source's explicit Latest selection after reconciling releases/assets, including manually selected older releases.
  • Add --dry-run and configurable --timeout (30 minutes per operation), Ctrl-C cancellation, atomic Git pushes and process-scoped credentials.
  • Validate topic limits and duplicate/empty release tags before writes; reject detected LFS pointers, including historical ones, rather than silently producing an incomplete replica.
  • Retry selected read failures at most twice, respecting bounded server delays; never blindly replay mutating requests.
  • Verify downloaded asset size/SHA-256 before deleting an existing destination asset. Client state is per replication instance for isolated tests.
  • Prepare a release-published binary workflow and cross-compile six OS/architecture combinations in CI. No version has been published.

Validation

All checks passed on f6221023f3a90494ff4f8257f0f4a80ca43e8e4d:

  • CI: gofmt, dependency consistency, race-enabled tests, vet, build, govulncheck and six cross-builds.
  • CodeQL: passed.
  • Real E2E: dry-run followed by two successful reconciliations; verified 35 releases, 798 asset digests, refs, metadata, topics, labels, Latest and stable asset IDs.

Regression tests use a fake HTTP server and local Git repositories for pagination, explicit Latest, dry-run without writes, label upserts, topic/tag rejection, bounded read-only retries, timeouts/cancellation, LFS detection, rejected atomic pushes, preservation of destination-only refs and download integrity failures without deleting existing assets.

Boundaries and follow-ups

No pruning or persistent state branch. Git pushes are atomic, but the entire Git/API replication is not a transaction. Asset replacement remains non-atomic after a validated download. Full release publishing will be exercised when a release is published.

Deferred enhancements: #4 (GHES), #5 (LFS transfer), #6 (recoverable asset replacement), #7 (assets without digests), #8 (component selection). Documented in README. Do not merge without owner approval.

@vmvarela vmvarela removed the run-e2e label Oct 24, 2026
@vmvarela
vmvarela marked this pull request as ready for review October 24, 2026 06:00
@vmvarela
vmvarela merged commit 295162c into master Oct 24, 2026
10 checks passed
@vmvarela
vmvarela deleted the fix/replication-safety branch October 24, 2026 06:55
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.

1 participant