This repository was archived by the owner on Nov 3, 2026. It is now read-only.
Repository navigation
feat(cli): report a missing config as JSON to --json callers - #46
Closed
gold-silver-copper wants to merge 6 commits into
Closed
gold-silver-copper wants to merge 6 commits into
gold-silver-copper wants to merge 6 commits into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
gold-silver-copper
force-pushed
the
refactor/drop-meta-worktree-identity
branch
from
October 28, 2026 21:08
c9d943f to
677d302
Compare
…ing config [[tasks/harmony-2794]]
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 and why
atc's workspace provider must talk to meta only through
meta … --json(no reading meta's files, env vars or layout). To decide whether a directory belongs to a meta workspace at all, it needs meta to say so. Todaymeta project list --recursive --jsonoutside a workspace exits 1 with only a stderr message, the same as any real failure, so atc had to look for meta's config file names on disk itself.With
--json(before or after the command), meta's "Could not find meta config file" branch inmeta_cli/src/main.rsnow also prints one JSON object on stdout:{"error":{"code":"config_not_found","message":"Could not find meta config file '.meta.yaml'\nSearched from /some/dir up to root"}}--json, the output is unchanged (stdout stays empty). The one behaviour change, with or without--json, is in a.worktrees/<name>directory with no config; see below.codeis the contract; the message is for people. Rebased on refactor!: meta_cli reads only .meta.yaml #47 (tasks/harmony-2878,.meta.yamlonly).config_not_foundrather than "not a workspace": an explicit--configthat doesn't exist reaches the same error inside a workspace, and, for plugin commands, inside a worktree set (see below). Callers that pass no--config(atc) can read it as "no meta workspace here".Every command that needs a config goes through this branch (plugin commands and
meta exec);context,init, plugin management, help andgit clonedon't.Inside a
.worktrees/<name>directory with no config (for example a plaingit worktree add .worktrees/x), meta took a "degraded" path that ran any command as a raw program in the set's checkouts, someta project list --jsontried to run aprojectbinary and printed loop results. Now a command that a plugin claims gets the same config-not-found error there (as JSON with--json), the same as outside a workspace: plugin commands need a config.meta execkeeps running in the set's checkouts. Which commands count as plugin commands depends on the installed plugins: without meta-project installed,meta project listthere still runs aprojectprogram from PATH, as before. The error code is built in one helper,config_not_found, used by both places.Tests
json_callers_without_a_config_get_a_json_error(tests/json_errors.rs, not unix-gated, so Windows CI runs it too):project list --recursive --jsonand--json git worktree listoutside a workspace exit with status 1, print the JSON error withcode = "config_not_found", and repeat the message on stderr;--configthat doesn't exist, inside a workspace, gives the same error;.meta.yamlfails without claimingconfig_not_found;meta --json exec -- trueoutside a workspace gives the same error.a_plugin_command_in_a_plain_git_worktree_needs_a_config(tests/plugin_routing.rs): in a plain Git worktree under.worktrees/xwith no config,meta --json touch(claimed by a fake plugin) exits 1 withconfig_not_foundand runs nothing;meta exec -- touch ranstill runs there. It fails without the change.The existing
missing_config_errors_are_escapednow also checks that a non-JSON run prints nothing on stdout.cargo test -p metaafter the rebase on #47: all pass.Related
Task:
[[tasks/harmony-2794]]Related: gitkb/meta_project_cli#22 (project aliases in
project list --json, same branch) is also needed by atc#606.(Any bot-generated summary appended below is not part of this description.)