Repository navigation
Validate model short_description length in the CLI and schema - #6594
Conversation
6bdbdc7 to
a8dc8cf
Compare
| "description": "A colon-delimited triple of NAMESPACE:ANYTHING:NAME. Namespace must match your org's public namespace (if you have one)." | ||
| }, | ||
| "description": { | ||
| "short_description": { |
There was a problem hiding this comment.
is this different from our api? i guess should we keep it consistent?
There was a problem hiding this comment.
It is not different from our API, short_description is the correct key. The struct field is called Description and that's why I assume we got the key wrong in the schema (or maybe the key changed afterwards).
type ModuleComponent struct {
API string `json:"api"`
Model string `json:"model"`
Description *string `json:"short_description,omitempty"`
MarkdownLink *string `json:"markdown_link,omitempty"`
}
| Action: createActionCommandWithT[updateModuleArgs](UpdateModuleAction), | ||
| }, | ||
| { | ||
| Name: "validate", |
There was a problem hiding this comment.
i like this idea but i think this is more of a syntax check than a full validate. the only reason i think the distintiction matters is that you could pass this validate and still have errors (like uploading a duplicate model to the registry) that would fail during cloud build time. i don't a good proposal for a name or maybe the usage text could be more clear that this is a syntax check
There was a problem hiding this comment.
We could use maybe module lint-manifest?
a8dc8cf to
21ed1b9
Compare
app.viam.com rejects a model short_description over 100 characters, but nothing on the client side checks it, so modules only find out when a release runs `viam module update`. Mirror the limit in the CLI (update, upload, and a new offline `viam module validate` for CI) and in module.schema.json, whose model field was also misnamed `description`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The command only checks meta.json offline, so passing it does not mean an upload will succeed (e.g. a duplicate model is only caught by the registry). Name and describe it as a lint to set that expectation. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
46ea5b8 to
b2b10ba
Compare
Summary
Check model
short_descriptionlength on the client side, so modules catch it in CI instead of when a release fails. app.viam.com rejects descriptions over 100 characters, but only the server checks this. Today modules find out whenviam module updatefails mid-deploy (e.g. beanjamin).Changes
viam module validate: needs no credentials, so any module's PR CI can run it againstmeta.jsonmodule update/module uploadfail before the RPC: same check, with an error that names every offending modeldescription, but the CLI readsshort_description. It now hasmaxLength: 100, so editors that apply$schemaflag long descriptions as you typelen(), like app. JSON Schema counts code points, so the two only differ for non-ASCII textTesting
go test ./cli -run 'TestValidateManifestLimits|TestValidateModuleAction': covers the limit boundary, several offending models, and the command end to end without authClaude Code prompts used
🤖 Generated with Claude Code