Skip to content

Validate image tag format in config and improve error message#256

Open
anisaoshafi wants to merge 5 commits into
mainfrom
devx-859-improve-error-message-for-invalid-image-tags
Open

Validate image tag format in config and improve error message#256
anisaoshafi wants to merge 5 commits into
mainfrom
devx-859-improve-error-message-for-invalid-image-tags

Conversation

@anisaoshafi
Copy link
Copy Markdown
Collaborator

@anisaoshafi anisaoshafi commented May 20, 2026

Motivation

We don't validate the version tag in config.toml so users discover later in the flow some tags are not possible.
Also the error message was not pointing to the real issue.

Changes

  • Reject tags that don't conform to Docker's tag format rules at config load (invalid chars, leading ./-, >128 chars). Fails fast before any network or Docker operation.
  • Normalize tags with zero-padded calendar months (2026.04 → suggest 2026.4) before license validation
  • The suggested valid tag in error messages is computed from the previous calendar month, so it's a reasonable recent version.
  • License API error improvement: when the license API returns 400 with a licensing.license.format body, the error now says "unsupported image tag" instead of the generic token/subscription message, which is more actionable for the user.

a) Before // inaccurate message
image

b) Now: tag="3.99.99" // valid tag regex, but does't exist: license server complains
image

c) Now: tag="2026.04" // valid tag, previously failed with error a)
image

@anisaoshafi anisaoshafi force-pushed the devx-859-improve-error-message-for-invalid-image-tags branch 3 times, most recently from 851b957 to 837fed2 Compare May 20, 2026 11:42
@anisaoshafi anisaoshafi force-pushed the devx-859-improve-error-message-for-invalid-image-tags branch from 837fed2 to d2c64f5 Compare May 20, 2026 11:48
@anisaoshafi anisaoshafi marked this pull request as ready for review May 20, 2026 12:05
@anisaoshafi anisaoshafi requested a review from gtsiolis May 20, 2026 12:06
@gtsiolis
Copy link
Copy Markdown
Member

Cross-posting relevant decision to redirect this to support zero padding.

@anisaoshafi anisaoshafi marked this pull request as draft May 20, 2026 13:52
@anisaoshafi
Copy link
Copy Markdown
Collaborator Author

anisaoshafi commented May 20, 2026

Cross-posting relevant decision to redirect this to support zero padding.

Adjusted according to discussion [1] 🙏🏼

@anisaoshafi anisaoshafi marked this pull request as ready for review May 20, 2026 14:01
Copy link
Copy Markdown
Member

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UX LGTM, works as expected. 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants