fix(datastore): fence the npm deprecate write (#1902 stack: 2/3)

This part closes the tombstone window on the npm deprecate. NpmVersionDeprecateWriter.DeprecateVersions takes the resolved repository id, refuses a nil context and zero ids before it opens a transaction, rolls back through resolveTxOnReturn, and fences the transaction first with the fenceRepositoryAlive helper from the part below. The deprecate handler bounds the write at lifecycle.TombstoneTimeout and answers the repository-tier 404 repository_not_found when the fence refuses, and the npm metrics doc and code-label comment name the new producers. It builds only on the fence helper below and carries its own guard, integration race and handler tests.

Stack

This merge request is part 2 of 3 of one reviewed change (vespian_gl/issue-1902-close-the-repository-tombstone-window), split into a stack so each part is reviewable on its own. Merge the parts in this order, bottom first:

  1. !3979 (merged) fix(datastore): fence the npm dist-tag write (#1902 (closed) stack: 1/3) (merged)
  2. !3980 (merged) fix(datastore): fence the npm deprecate write (#1902 (closed) stack: 2/3) (this merge request)
  3. !3961 (merged) fix(datastore): fence the container tag upsert (#1902 (closed) stack: 3/3)

!3979 (merged), the part below it, has merged. This merge request targets main. !3961 (merged), the part above it, targets this one and merges after it.

Related to #1902 (closed)

Edited by Pawel Rozlach

Merge request reports

Loading
Loading