[Graphite MQ] Draft PR GROUP:spec_accf3e (PRs 39) - #44
Closed
graphite-app[bot] wants to merge 1 commit into
Closed
graphite-app[bot] wants to merge 1 commit into
graphite-app[bot] wants to merge 1 commit into
Conversation
#39) ## Summary `--dry-run` swaps the HTTP client for one that prints the request and, instead of sending it, hands the SDK a stand-in `200`. The SDK accepts only an operation's documented success code. 28 of the 191 operations succeed with `201` alone: every `create`, plus `environment clone`, `environment publish`, `evaluation run` and `test run create`. Their dry runs printed the preview, then `API Error (HTTP 200): unknown status code returned`, and exited 1. The stand-in response now carries an `X-Vf-Dry-Run` header. While `--dry-run` is on, `output.Error`, which every generated command reports SDK errors through, does not report an error about that response (`internal/output/dryrun.go`). The flag check matters: a header is something any server reached with `--server-url` could send, and it must not turn that server's error into a silent success. Errors raised before the preview, such as a body that fails to serialize, carry no response and are still reported. Commands that already worked are unchanged, including the `{}` that a `200` operation prints with `--output-format json`. ## Before and after | | master | this PR | |---|---|---| | All 191 API commands, dry run with placeholder flags: commands that print the preview and then fail | 23 | 0 | | The other 5 of the 28, run by hand | all fail | all exit 0 | | `test/dry-run.test.ts` (6 cases) | 3 fail | 6 pass | ## Test plan - [x] `gofmt`, `go vet ./...` and `go test ./...` pass; `go.mod` is unchanged. - [x] `internal/output/dryrun_test.go`: the stand-in is not reported, in human and agent mode; a real response and a pre-send error still are. - [x] `internal/client/diagnostics_test.go`: the dry-run client marks its stand-in. Removing either half of the fix fails its test. - [x] `test/dry-run.test.ts`: `project create`, `environment publish` and `agent update` preview and exit 0. Agent mode and JSON output report no error. A request that cannot be built still fails, and so does a real response that carries the marker without `--dry-run`. - [x] Full suite with #37 applied: 84/84. With #37, #38 and the other three fixes from this batch: 102/102. - [ ] CI: `CLI behaviour` shows master's 4 existing failures until #37 merges.
graphite-app
Bot
deleted the
gtmq_spec_accf3e_1790955425782-fd50e654-0521-4708-b920-54d90d09b3c2
branch
October 2, 2026 15:37
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.
This draft PR was created by the Graphite merge queue.
Trunk will be fast forwarded to the HEAD of this PR when CI passes, and the original PRs will be closed.
The following PRs are included in this draft PR: