devcontainers / cli

A reference implementation for the specification that can create and configure a dev container from a devcontainer.json.
https://containers.dev
MIT License
1.54k stars 218 forks source link

Unable to resolve features with complex (but valid) semantic versions #557

Open fightingsleep opened 1 year ago

fightingsleep commented 1 year ago

The devcontainer CLI is able to resolve features with simple versions like this:

devcontainer features info manifest myociregistry.com/devcontainers/features/myfeature:1.0.2

However, it is not able to resolve features with more complex versions like this:

devcontainer features info manifest myociregistry.com/devcontainers/features/myfeature:1.0.2-ABC

or

devcontainer features info manifest myociregistry.com/devcontainers/features/myfeature:1.0.2+ABC

Both 1.0.2-ABC and 1.0.2+ABC are valid semantic versions. You can check with this regex checker linked from semver.org. However, the CLI will fail to resolve features with those versions.

1.0.2-ABC results in a No manifest found! error, and 1.0.2+ABC results in:

'1.0.2+ABC failed validation. Expected digest to match regex '/^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$/''

Looks like that regex doesn't even allow + in the version.

Is this the expected behaviour? Are we limited to simple versions?

joshspicer commented 1 year ago

That's correct that today only a simple x.y.z version will be recognized by the implementation. Our sub-command that publishes Features will also expect to see the x.y.z pattern, and will republish x, x.y, and x.y.z for each new x.y.z version.