Fix validateOCITag to accept full OCI references#4088
Merged
Conversation
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>
rdimitrov
approved these changes
Mar 11, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--tagflag inthv skill buildaccepts both bare tags (v1.0) and full OCI references (ghcr.io/org/repo:v1.0) to matchdocker build -tsemantics. The CI skills workflow passes full references, butvalidateOCITag()rejected them because it prepended a dummy host, producing an invalid double-reference likedummy.invalid/repo:ghcr.io/org/repo:v1.0.validateOCITag→validateOCITagOrReferencewith two-branch validation: if the input contains/:@characters, validate as a full OCI reference viaParseReference; otherwise validate as a bare tag viaNewTagwith a dummy prefix. This reuses the same heuristic already used inparseOCIReference().Type of change
Test plan
task test)task lint-fix)Changes
pkg/skills/skillsvc/skillsvc.gopkg/skills/skillsvc/skillsvc_test.goDoes this introduce a user-facing change?
thv skill build --tag ghcr.io/org/repo:v1.0.0no longer fails validation. Previously only bare tags likev1.0.0were accepted.Generated with Claude Code