Repository navigation
test(image): cover docker tag validation - #976
Merged
Merged
Conversation
Add table-driven tests for IsValidDockerTag and ValidateTags in pkg/image.
✅ Deploy Preview for devsydev canceled.
|
✅ Deploy Preview for images-devsy-sh canceled.
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 15 |
| Duplication | 0 |
AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
Signed-off-by: Samuel K <skevetter@pm.me>
skevetter
marked this pull request as ready for review
August 10, 2026 03:08
skevetter
enabled auto-merge (squash)
August 10, 2026 03:08
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.
Package reviewed
pkg/image— image reference parsing and validation used by thedevsy build/devsy pushcommands.Issue found
pkg/imagehad no test coverage forIsValidDockerTagandValidateTags, despite these functions guarding user-supplied tags before they reach the registry. Tag validation is security- and correctness-relevant (an invalid tag can fail a push deep in the Docker client with an opaque error), so the lack of tests made regressions easy to miss.Change
Added table-driven tests in
pkg/image/image_test.go:TestIsValidDockerTag— valid tags (semver, numeric, underscore,latest, max-size 128 chars) and invalid tags (leading dot, leading hyphen, embedded slash, embedded colon, embedded space, non-ascii, over-max).TestValidateTags— nil slice returns no error, a valid slice returns no error, and the first-invalid-tag is reported with the offending value in the message.No behavioral change to production code. A
latestTag = "latest"constant was extracted in the test file to satisfygoconst(the value recurred across table cases).Verification
task cli:format— clean.task cli:lint:ci— 0 new issues.go test ./pkg/image/...— PASS.pkg/git(TestRepoCloneFromInfoHelper, stale git-lfs filter assertion onorigin/main) fails — unrelated to this change.This PR was created by an AI agent as part of an automated daily package review job.