Repository navigation
Add meili get version - #35
Merged
Merged
Conversation
A singleton resource, so rule 2 gives `get version`, and the route has neither a path nor a query parameter: the command is `get health` with a key action, `version`, the one the document declares on it. That key action is the whole difference between the two: `GET /health` declares none and answers without a key, `GET /version` refuses one the instance does not accept, which the tests pin at exit 3. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
What
Add
meili get version, the one route ofGET /version.Contract
docs/contract/commands.md, and each route is reachable by a distinct set of flags, or the exception is recorded with its reason (or this pull request changes the contract and nothing else)src/lib/output.ts, errors throughsrc/lib/errors.ts$EDITOR; adeletecommand spreadsBaseCommand.confirmFlagsand its examples carry--yesfetchoutsidesrc/lib/clients/Tests
--helpsnapshot added or updated on purposepnpm lint,pnpm typecheck,pnpm testpass locallySimplicity
src/lib/, is used by this command, and is named belowDocs
docs/contract/updated for every name, flag, variable or code this change adds or renames, or nothing to updateHousekeeping
oclif.manifest.jsonregeneratedNotes for the reviewer
No shared code added, no dependency, no exception. The command is fifteen lines: the resource is a singleton, so rule 2 gives
get versionand the route has neither a path nor a query parameter. It is the smallest command of the tree,get healthwith a key action.Two things worth a look:
keyActions = ["version"]. The document declaresBearer: ["version", "*"]on this route, so the specific action isversion, notversion.get: the contract test reads it from the document and would fail on the other spelling. It is also what makes this command different fromget health, which declaressecurity: []and works without a key.The error case is the key the instance refuses, 403 with
invalid_api_key, exit 3, snapshotted in the unit test and run for real in the integration test with a wrong key. There is no 404 to pin here: the route takes nothing.Ran the
simplifyskill on the diff: reuse, simplification and altitude, which found two small things, both applied — the msw handler's comment restated its three field names, and the changeset line explained the key action at a level its neighbours do not, which belongs here rather than in the changelog. I did not run the efficiency angle: the command makes one call, sets up no fixture and declares no flag of its own.🤖 Generated with Claude Code
Summary by CodeRabbit
meili get versionto retrieve the Meilisearch instance version and build information.