Skip to content

[Graphite MQ] Draft PR GROUP:spec_cdc3a7 (PRs 22) - #25

Closed
graphite-app[bot] wants to merge 1 commit into
masterfrom
gtmq_spec_cdc3a7_1788290959705-9b6e6eff-aba5-4945-9eef-e2b2fa721cb6
Closed

[Graphite MQ] Draft PR GROUP:spec_cdc3a7 (PRs 22)#25
graphite-app[bot] wants to merge 1 commit into
masterfrom
gtmq_spec_cdc3a7_1788290959705-9b6e6eff-aba5-4945-9eef-e2b2fa721cb6

Conversation

@graphite-app

@graphite-app graphite-app Bot commented Sep 1, 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:

…13656) (#22)

## Why

Nothing gates a pull request in this repo. The single workflow, `release.yaml`, fires only on `push: tags: v*` — so **no build, no vet, no test, and no lint has ever run on a PR or on master.** The only check today is Graphite's mergeability check.

That has already cost us twice:

- **Master once did not compile from a clean checkout** — `go.sum` was incomplete. Nobody noticed until someone tried to build it fresh.
- **`v0.232.0` failed at release time** and left six orphaned npm packages behind, from code that had merged cleanly days earlier.

Neither defect was exotic. There was simply nothing to catch it.

## What this adds

Three jobs, on `pull_request` and on push to `master`:

| Job | Runs |
|---|---|
| **go** | `go mod verify`, gofmt check, `go build ./...`, `go vet ./...`, `go test ./...` |
| **cli** | builds `./vf`, then the hermetic behaviour suite |
| **lint** | `oxlint` |

## Every gate was verified by reintroducing the defect it catches

Not by assuming it would work:

| Defect reintroduced | Result |
|---|---|
| Removed a required module from `go.sum` | `go build` **fails** |
| Removed a persisted edit **and its call site** | `go build` **passes** — `yarn test` **fails** |
| Added unformatted Go | gofmt check **fails** |
| Added a bad `Printf` verb | `go vet` **fails** |

**The second row is the point of this PR.** This CLI is generated by Speakeasy, and a handful of hand-written files ride across regenerations as persistent edits. A regeneration that drops one still compiles — nothing looks wrong. Deleting `internal/cli/docs.go` together with its `initDocsCmd` registration builds perfectly clean and fails six behaviour tests. **A build-only gate would have shipped it.** That is why the behaviour job is not redundant with the build job.

## The integration tests now exclude themselves instead of failing

`test/vf-*.test.ts` drive the real API. Without credentials, `createProject` sent `--workspace-id=undefined`, so `yarn test` reported **11 failures** for anyone without a token — including CI. A suite that is red by default carries no signal, and it meant the hermetic tests had no gate they could run behind.

`vitest.config.mts` now resolves credentials up front and excludes those files when absent, warning that it did so. Verified in both directions:

- no credentials → **5 files, 49 tests, all passing**
- credentials present → **21 files collected**, integration included again

Side effect worth having: `yarn test` now works on a fresh clone.

## The workflow caught two bugs in itself

Both fixed here, and worth reading as evidence the gate works.

**1. Yarn 3 ignores `setup-node`'s `.npmrc`.** The first run failed at install:

```
Request URL: https://registry.yarnpkg.com/@voiceflow/oxlint-config/-/oxlint-config-1.2.0.tgz
Response Code: 404
```

`NODE_AUTH_TOKEN` and `NPM_CONFIG_USERCONFIG` were both set and both ignored — yarn went to its own default registry unauthenticated. Yarn reads `YARN_NPM_*` instead, so that is what the workflow passes now.

**2. `oxfmt --check` reports 193 of 204 files as unformatted.** Formatting has never run in this repo, and the overwhelming majority of those files are Speakeasy output. Reformatting them produces a diff the next regeneration silently undoes; reformatting only the hand-written files still means touching every test file at once, which would collide with the open flag-ergonomics PR. **The format gate is left off rather than left permanently red** — which paths this repo wants to own is a decision worth making deliberately, not one to smuggle in behind a CI change.

`oxlint` itself passes (1 warning, 0 errors across 35 files), so it is a real blocking gate. **All three jobs block; the final run is fully green.**

## Follow-ups worth a ticket

- **`NPM_TOKEN` is publish-capable** and is now exposed to PR CI for dependency installation. A read-only automation token would be the right scope. (Fork PRs don't receive secrets, so the exposure is limited to branch PRs.)
- **A format gate.** Decide which paths to own (`test/`, `scripts/`, configs), reformat them once, then add `oxfmt --check` scoped to those paths.
- **`cmd/gendocs` is invoked by nothing**, so `docs/` is stale by construction — the repo's own test says so at `test/rewrite-docs.test.ts:84`.
- **Releases are hand-tagged.** Merges reach users only when someone remembers to cut a tag.
@graphite-app graphite-app Bot closed this Sep 1, 2026
@graphite-app
graphite-app Bot deleted the gtmq_spec_cdc3a7_1788290959705-9b6e6eff-aba5-4945-9eef-e2b2fa721cb6 branch September 1, 2026 19:31
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