Skip to content

Fix validateOCITag to accept full OCI references#4088

Merged
JAORMX merged 1 commit intomainfrom
fix-validate-oci-tag-or-reference
Mar 11, 2026
Merged

Fix validateOCITag to accept full OCI references#4088
JAORMX merged 1 commit intomainfrom
fix-validate-oci-tag-or-reference

Conversation

@JAORMX
Copy link
Copy Markdown
Collaborator

@JAORMX JAORMX commented Mar 11, 2026

Summary

  • The --tag flag in thv skill build accepts both bare tags (v1.0) and full OCI references (ghcr.io/org/repo:v1.0) to match docker build -t semantics. The CI skills workflow passes full references, but validateOCITag() rejected them because it prepended a dummy host, producing an invalid double-reference like dummy.invalid/repo:ghcr.io/org/repo:v1.0.
  • Rename validateOCITagvalidateOCITagOrReference with two-branch validation: if the input contains /:@ characters, validate as a full OCI reference via ParseReference; otherwise validate as a bare tag via NewTag with a dummy prefix. This reuses the same heuristic already used in parseOCIReference().

Type of change

  • Bug fix

Test plan

  • Unit tests (task test)
  • Linting (task lint-fix)

Changes

File Change
pkg/skills/skillsvc/skillsvc.go Rename + rewrite validator to accept full OCI refs; update call site
pkg/skills/skillsvc/skillsvc_test.go Rename test, add valid/invalid full-reference cases, update error string

Does this introduce a user-facing change?

thv skill build --tag ghcr.io/org/repo:v1.0.0 no longer fails validation. Previously only bare tags like v1.0.0 were accepted.

Generated with Claude Code

The --tag flag in `thv skill build` accepts both bare tags (v1.0) and
full OCI references (ghcr.io/org/repo:v1.0) to match `docker build -t`
semantics. The CI workflow passes full references but validateOCITag()
rejected them because it prepended a dummy host, producing an invalid
double-reference.

Rename to validateOCITagOrReference with two-branch validation: if the
input contains /:@ characters, validate as a full reference via
ParseReference; otherwise validate as a bare tag via NewTag with a
dummy prefix. This reuses the same heuristic from parseOCIReference().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Mar 11, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.50%. Comparing base (db56f7f) to head (bb9f6b6).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4088      +/-   ##
==========================================
- Coverage   68.55%   68.50%   -0.05%     
==========================================
  Files         447      447              
  Lines       45663    45670       +7     
==========================================
- Hits        31305    31288      -17     
- Misses      11940    11964      +24     
  Partials     2418     2418              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JAORMX JAORMX merged commit 0642921 into main Mar 11, 2026
39 of 41 checks passed
@JAORMX JAORMX deleted the fix-validate-oci-tag-or-reference branch March 11, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants