Skip to content

feat(oci/skills): add DeleteTag and DeleteBuild for tag and artifact removal#73

Merged
rdimitrov merged 4 commits intomainfrom
ocisills-delete-tag
Apr 6, 2026
Merged

feat(oci/skills): add DeleteTag and DeleteBuild for tag and artifact removal#73
rdimitrov merged 4 commits intomainfrom
ocisills-delete-tag

Conversation

@samuv
Copy link
Copy Markdown
Contributor

@samuv samuv commented Apr 2, 2026

Summary

  • Adds DeleteTag(ctx, tag) which removes a tag entry from index.json via ORAS Untag without touching blobs; returns a 404-coded error when the tag does not exist
  • Adds DeleteBuild(ctx, tag) which wraps DeleteTag with lightweight orphaned-blob cleanup: resolves the digest before untagging, then walks the content graph (index → manifests → config/layers) and removes blob files only when no remaining tag still references the same digest
  • DeleteTag is kept as the low-level primitive for callers that explicitly want tag-only removal; DeleteBuild is the higher-level operation intended for the CLI (thv skill builds remove <tag>) where users expect the artifact to be fully gone

Test plan

  • task passes (lint + tests green, race detector enabled)
  • TestStore_DeleteTag: tag exists and is removed; tag does not exist returns 404; removing one tag does not affect sibling tags on the same digest
  • TestStore_DeleteBuild: tag and blobs removed when digest is orphaned; blobs retained when another tag shares the digest; returns 404 when tag does not exist

@samuv samuv changed the title feat(oci/skills): add DeleteTag to remove a tag without deleting blobs feat(oci/skills): add DeleteTag and DeleteBuild for tag and artifact removal Apr 2, 2026
@samuv samuv requested a review from JAORMX April 2, 2026 16:36
@rdimitrov rdimitrov merged commit 19372f0 into main Apr 6, 2026
5 checks passed
@rdimitrov rdimitrov deleted the ocisills-delete-tag branch April 6, 2026 09:02
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.

2 participants