In a repository manager, how do copy, move and property-based promotion differ in storage, audit trail and what consumers can resolve?
answer
- where the artifact lives afterwards
- two paths, one path, one path plus metadata
- staging URL after a move
- checksum storage makes copies cheap
- matrix parameter with a plus sign
basics
~20 sCopy leaves the artifact in staging and release; move takes it out of staging; property-based promotion leaves it in place and changes metadata that consumers must filter on. They differ in disk use, history kept and who can still resolve it.
solid answer
~40 sA **copy** puts the artifact in the release repository and leaves it in staging, so staging consumers keep working and staging's history stays intact; on storage that keeps one binary per checksum, the copy costs metadata rather than disk. A **move** leaves exactly one location, which is tidy, but anything still resolving the staging path now gets a not-found. **Property-based promotion** moves nothing: it sets metadata such as a `status` property in Artifactory or a label in Harbor. That is cheap and keeps one location, but the repository still serves the artifact to anyone who does not filter, so consumers must ask for it explicitly, for example with Artifactory's mandatory matrix parameter `;status+=prod`. A metadata write is also only as protected as the permission to make it.
code
http · 3 linesGET /artifactory/payments-maven-dev-local/org/example/app/1.4.2/app-1.4.2.jar;status+=prod HTTP/1.1
HTTP/1.1 404 Not Foundgo deeper
Recall that copy leaves two locations, move leaves one, and property-based promotion leaves the artifact in place and changes its metadata.
Explain the storage and consumer effects: why copies are cheap on checksum-addressed storage, why a move breaks staging consumers, and why metadata promotion needs consumers to filter.
Spot the failure modes in practice: a pipeline broken by a move, a partial move of an index without its images, or a consumer using a non-mandatory filter that pulls unlabelled builds.
Weigh enforcement against convenience: repository boundaries are hard and permission-backed, metadata is cheap but only as strict as every consumer's filter and the annotate permission.
## Three ways to promote **Promotion** takes an artifact that passed testing in a **staging repository** and makes it available as a release, without rebuilding it. Repository managers offer three mechanisms: 1. **Copy**: the artifact is placed in the release repository and also stays in staging. 2. **Move**: the artifact is placed in the release repository and removed from staging. 3. **Property- or label-based promotion**: the artifact stays where it is and a piece of metadata on it changes, for example from a development status to a released one. All three keep the bytes, and therefore the checksum, unchanged. They differ in where the artifact can be found afterwards, how much storage it uses, what history survives and how consumers tell a released artifact from a candidate. ## Copy A copy gives the artifact a second path. Staging still serves it, so test pipelines that resolve from staging carry on unaffected, and staging's own record of the artifact stays intact. - **Storage**: on a repository manager or registry that stores each binary once and lets several paths reference it, a copy adds metadata, not a second set of bytes. OCI registries work this way by design: blobs are addressed by digest, and the distribution specification notes a registry may store only one copy of a layer whose digest matches. Within one registry, a release repository can reuse a blob already in staging with a cross-repository blob mount, `POST /v2/<name>/blobs/uploads/?mount=<digest>&from=<other_name>`. - **Cleanup**: because release holds its own reference, deleting the staging path later does not remove what release serves. Space is only freed when no path references the binary any more and the store's own garbage collection or compaction has run. - **Audit**: both paths exist, so you can see the candidate where it was tested and the release where it is served. ## Move A move leaves one path. That is clear ("where is version 1.4.2? in release"), but it has costs: - **Broken consumers**: anything still resolving the staging path gets a not-found response afterwards. - **Lost context**: staging no longer shows the artifact, so the evidence of where it was tested lives only in logs or metadata. - **Partial moves**: for structured formats, moving one file may not move what it depends on. Artifactory's documentation for its Helm OCI repositories warns that moving, copying or deleting an index manifest does not automatically include the images it lists; both must be selected. ## Property- or label-based promotion Here nothing moves. The artifact carries metadata, and promotion changes it: - In **Artifactory**, explicit **properties** are user-defined key-value strings on an artifact, and the documentation lists promotion and state management among their uses. They can be set through the UI, the REST API, the CLI or as **matrix parameters** on the deploy URL, such as `;status=DEV`. - In **Harbor**, **labels** (global or project-level) are attached to artifacts, and a replication rule can filter on them. The benefit is one location and a cheap, metadata-only promotion. The catch is that the repository still serves the artifact to everyone who does not filter. Artifactory resolves with matrix parameters in two modes: | Query | Artifact has `status=prod` | Artifact has no `status` | Artifact has `status=DEV` | |---|---|---|---| | `;status=prod` (non-conflicting) | served | **served** | not found | | `;status+=prod` (mandatory) | served | not found | not found | So a consumer that wants only released artifacts must use the **mandatory** form; the plain form also returns artifacts that were never labelled at all. Two further limits apply. Artifactory documents property and property-set values as guidance, not strictly enforced, and adding or editing properties needs only the **Annotate** permission. In Harbor, a project **Developer** can add and remove labels. Whoever can write the metadata can promote. ## Side by side | | Copy | Move | Property or label | |---|---|---|---| | Locations afterwards | two | one | one | | Extra disk | little, with checksum-addressed storage | none | none | | Staging consumers | keep working | get not-found | keep working, unfiltered | | Promotion enforced by | repository permissions | repository permissions | consumers filtering on metadata | ## Choosing - Use **copy** when you want the release repository to be a hard trust boundary and staging to keep its history. - Use **move** when staging must not keep released artifacts and nothing resolves staging after approval. - Use **properties or labels** to *record* promotion state, build numbers and approvals, and rely on them for *enforcement* only where every consumer filters on them.
- After a copy-based promotion, does running cleanup on the staging repository free disk space?Only for binaries nothing else references. On checksum-addressed storage the release path still references the same binary, so deleting the staging path removes a reference, not the bytes. Space comes back for candidates that were never promoted, and only once the store's own garbage collection or compaction runs.
- Why can property-based promotion and copy-based promotion be combined rather than chosen between?They answer different questions. Copying into a release repository enforces who may publish a release through repository permissions. Properties on the promoted artifact record the build number, revision or approval ticket and stay searchable. Using both gives a hard boundary plus a queryable record.
- A move keeps the old staging URL working through a redirect.
- Copying a promoted artifact always doubles its disk usage.
- A plain matrix parameter returns only artifacts carrying that property.
- Property values in Artifactory are strictly enforced like a schema.
- Moving an index manifest automatically moves every image it lists.