Repository navigation
Give the management commands the project of the config file, with cloudId - #9
Merged
Merged
Conversation
…udId An entry may carry cloudId, the project's id in Meilisearch Cloud, and --project <name> gives it to update projects and delete projects; with --id it is a usage error, without cloudId a config error that names the ways to set it, on a command that takes no project a usage error. Three explicit ways set it: create projects --add-to-config, config add and the new config update with --project-cloud-id, and the new config sync-with-cloud, which lists the projects the token sees, sets cloudId by URL, adds the missing entries named after their project, never writes a key and never removes an entry. ADR 0006 records the rule: the Management API is consulted only when the command line asks for it. The maintainer guide no longer keeps "Cloud" to prose. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…config commands projectFlagForRoute in api-naming.ts says which flag of a Management API route --project <name> can fill; BaseCommand.init and the contract test both use it, so update teams --project would be refused like create projects --project. The --id/--project arbitration moves to config.ts beside resolveProjectConnection, with its unit tests. The "name already exists" check and the agent warning of the config commands are written once. Test helpers tempConfig and readJson replace the copied setup. From the simplify pass. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
…now "project limit reached" Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A project the file does not know is ignored: without its key, which the API does not return, an entry would serve no Meilisearch command. The report loses "added", the name collision cannot happen any more, and ADR 0006 records the alternative as rejected. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…apiKey Creation is the one moment the API returns it, and an entry without its key serves no Meilisearch command. sync-with-cloud still never writes a key. ADR 0006 records it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
15 tasks done
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
Give the management commands the project of the config file: an entry may carry
cloudId,--project <name>supplies it toupdate projectsanddelete projects, and three explicit ways set it:create projects --add-to-config,config addand the newconfig updatewith--project-cloud-id, and the newconfig sync-with-cloud. ADR 0006 records the decisions. Stacked on #7, which it needs; merges intomanagement-projects.Two new commands and one new flag in one pull request, at the maintainer's request; rule 10 says one per pull request.
Contract
config updateandconfig sync-with-clouddo not derive from a route and are recorded in the renamed table "Commands that do not derive from a route" ofcommands.md, which the contract test now ties to the code: every command without routes is listed, every listed command exists.--add-to-configjoins the CLI-owned flags of rule 6. The Management API's parent parameter{projectId}is--project-id(rule 4), because--projectis the global flagsrc/lib/output.ts, errors throughsrc/lib/errors.tssync-with-cloudcalls one function of the generated SDK with the clientBaseCommandbuilt, and declaresstatic api = "management"with no routeTests
--helpsnapshots: two new ones;create,updateanddelete projects,config addand every command updated on purpose, for the new flags and the--projectdescriptionsync-with-cloudsuccess with the three lists and the file written, a project the file does not know ignored,--team-idpassed through;config updatefields changed and kept, nothing to change, unknown project;create projects --add-to-configfile written with the master key asapiKey, name taken before any network call,--projectrefused;updateanddelete projectswith--project, withoutcloudId, with both, with neither;cloudIdparsed and refused when invalidpnpm lint,pnpm typecheck,pnpm testpass locally; the scenario ran against staging: a hand-written entry got itscloudIdfromsync-with-cloud, without key, andupdate projects --projectused it.--add-to-configwas not run against staging: it creates a projectSimplicity
simplifypass ran on the diffsrc/lib/:config.tsgainscloudIdin the entry,resolveCloudProjectIdbesideresolveProjectConnection,assertNoProject,parseProjectUrland theCONFIG_FILE_WARNINGof the config commands' help;api-naming.tsgainsadd-to-config, the--project-idrule andprojectFlagForRoute, the one place that says which flag of a route--projectcan fill, used byBaseCommand.initand by the contract test;BaseCommandgainscloudProjectId(), a one-line delegateDocs
docs/contract/:config.md(thecloudIdfield, the "Cloud projects" section, the principle that the Management API is consulted only on request),commands.md(rule 4, rule 6, the--projectrow, the config-file flag group, the renamed table with its two rows);CLAUDE.md(the "Cloud only in prose" rule dropped, as decided), the skill, the README, the changesetremovethenaddpoint is marked superseded by ADR 0006Housekeeping
oclif.manifest.jsonregenerated.changeset/first-version.mdNotes for the reviewer
cloudIdin camelCase;--add-to-configis a boolean and the entry takes the project's name;--add-to-configwrites the master key, the one moment the API returns it, andsync-with-cloudnever writes a key;config addkeeps--project-urlrequired and--project-cloud-idoptional;config updateexists;--project-idon sub-resources;sync-with-cloudsetscloudIdon existing entries only, adds none, and prints a report; no on-the-fly resolution.sync-with-cloudin one request:GET /api/v2/projectslists every project the token sees, checked on staging;--team-idnarrows it, and thenmissingis not computed, since an entry of another team would be reported wrongly.--projecton a management command that takes no project is a usage error, decided fromstatic routesthroughprojectFlagForRoute: a flag is never ignored in silence, and a futureupdate teams --projectis refused the same way.--project-urland--project-api-keyon a management command are still ignored, as before this change.apibut by routes: a command with routes derives from them, a command without is in the table.--idof theprojectscommands and--project-idof their sub-resources are the only optional path flags, because--projectcan fill them.🤖 Generated with Claude Code