Skip to content

[Graphite MQ] Draft PR GROUP:spec_accf3e (PRs 39) - #44

Closed
graphite-app[bot] wants to merge 1 commit into
masterfrom
gtmq_spec_accf3e_1790955425782-fd50e654-0521-4708-b920-54d90d09b3c2
Closed

graphite-app[bot] wants to merge 1 commit into
masterfrom
gtmq_spec_accf3e_1790955425782-fd50e654-0521-4708-b920-54d90d09b3c2

Conversation

@graphite-app

@graphite-app graphite-app Bot commented Oct 2, 2026

Copy link
Copy Markdown

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:

#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 graphite-app Bot closed this Oct 2, 2026
@graphite-app
graphite-app Bot deleted the gtmq_spec_accf3e_1790955425782-fd50e654-0521-4708-b920-54d90d09b3c2 branch October 2, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant