You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(telemetry): consistent invocation ID per run and telemetry acceptance tests (#271)
* fix(telemetry): consistent invocation ID per run and add telemetry test infra
- root.go: set invocation ID only when empty so all API requests in one CLI run
share the same invocation_id (fixes multiple IDs when gateway PreRun calls
ValidateAPIKey then connection PreRun overwrote telemetry)
- pkg/cmd: add TestInvocationIDPersistsAcrossMultipleInitTelemetryCalls (fails
without fix, passes with it)
- test/acceptance: recording proxy (StartRecordingProxy, AssertTelemetryConsistent,
RunListenWithTimeout, RunWithEnv, NewCLIRunnerWithConfigPath/NoCI), telemetry_test.go
proxy-based tests, TestTelemetryInvocationIDConsistentWhenValidateAPIKeyInPreRun,
TestTelemetryListenProxy in listen_test.go, README section
Made-with: Cursor
* docs(cli): use 'hookdeck gateway connection' in connection command examples
Update Example strings in connection create, delete, get, list, and upsert
so help text shows the preferred gateway-scoped form instead of the
deprecated root-level 'hookdeck connection'.
Made-with: Cursor
* chore(docs): regenerate REFERENCE.md from Cobra metadata
Run go run ./tools/generate-reference after connection example updates
so REFERENCE.md reflects hookdeck gateway connection in examples.
Made-with: Cursor
* chore(acceptance): run telemetry tests in slice 1, remove unreproducible test
- Tag telemetry_test.go with 'telemetry' (was 'connection'); run in slice 1 with request, event
- CI and run_parallel.sh: add telemetry to slice 1 tags
- Remove TestTelemetryThreeRequestsOneCommandPath (three-request bug not reproducible with current CLI)
Made-with: Cursor
* test(acceptance): move listen telemetry proxy test under telemetry tag
- Add telemetry_listen_test.go (//go:build telemetry) with TestTelemetryListenProxy
- Remove test from listen_test.go so matrix slices with telemetry disabled never run it
- CI/run_parallel: single go test -tags=telemetry (no separate listen invocation)
- README: document telemetry-tagged proxy tests
Made-with: Cursor
* fix(ci): force telemetry on for acceptance-telemetry job
- Set HOOKDECK_CLI_TELEMETRY_DISABLED=0 so repo/org defaults cannot disable headers
- AssertTelemetryConsistent: clearer fatal when all telemetry headers empty
- run_parallel.sh and README match CI
Made-with: Cursor
* fix(acceptance): tag JSON config tests so telemetry job runs telemetry only
- Add //go:build connection|destination|source to *_config_json* and connection_rules_json tests
- Untagged *_test.go files were included in go test -tags=telemetry (acceptance-telemetry CI)
- README + AGENTS: document that untagged tests also run in the telemetry job
Made-with: Cursor
* acceptance: retry CLIRunner on transient HTTP 502 with logging
- Run, RunWithEnv, RunFromCwd: up to 4 attempts, 2s backoff
- Detect 502 via CLI error patterns only (not 503/504)
- Log each retry and final give-up with output excerpts
- Document in README; add basic-tagged detection tests
Made-with: Cursor
Copy file name to clipboardExpand all lines: AGENTS.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -274,6 +274,10 @@ go run cmd/hookdeck/main.go login --help
274
274
- **Always run tests** when changing code: unit tests (`go test ./pkg/...`) and, for CLI-facing changes, acceptance tests (`go test ./test/acceptance/...`). Do not skip tests to avoid failures.
275
275
- When running commands (build, test, acceptance tests), if you see **TLS/certificate errors** (e.g. `x509: certificate verify failed`, `tls: failed to verify certificate`), **permission errors** (e.g. `operation not permitted` when writing to the Go module cache), or similar failures that look environment-related, the command is likely running inside a **sandbox**. **Prompt the user** and **re-run the command with elevated permissions** (e.g. `required_permissions: ["network"]`for tests that need API access, or `["all"]` to disable the sandbox) so the operation can succeed. Do not treat a build or test as passed if stderr shows these errors, even when the process exit code is 0.
276
276
277
+
### GitHub CLI (`gh`)
278
+
- Use the **[GitHub CLI](https://cli.github.com/) (`gh`)** to read GitHub data and perform actions from the shell: **workflow runs and job logs** (e.g. `gh run list`, `gh run view <run-id> --log-failed`, `gh run view <run-id> --job <job-id> --log`), **PRs and checks** (`gh pr view`, `gh pr checks`, `gh pr diff`), **API access** (`gh api`), and creating or updating PRs, issues, and releases.
279
+
- Install and authenticate `gh` where needed (e.g. `gh auth login`). If `gh` fails with TLS, network, or permission errors, re-run with **network** or **all** permissions when the agent sandbox may be blocking access.
280
+
277
281
## 6. Documentation Standards
278
282
279
283
### Command help text (Short and Long)
@@ -355,7 +359,7 @@ if apiErr, ok := err.(*hookdeck.APIError); ok {
355
359
Acceptance tests require a Hookdeck API key. See [`test/acceptance/README.md`](test/acceptance/README.md) for full details. Quick setup: create `test/acceptance/.env` with `HOOKDECK_CLI_TESTING_API_KEY=<key>`. The `.env` file is git-ignored and must never be committed.
356
360
357
361
### Acceptance tests and feature tags
358
-
Acceptance tests in `test/acceptance/` are partitioned by **feature build tags** so they can run in parallel (two slices in CI and locally). Each test file must have exactly one feature tag (e.g. `//go:build connection`, `//go:build request`). The runner (CI workflow or `run_parallel.sh`) maps features to slices and passes the corresponding `-tags="..."`; see [test/acceptance/README.md](test/acceptance/README.md) for slice mapping and setup. **Every new acceptance test file must have a feature tag**; otherwise it is included in every build and runs in both slices (duplicated). Use tags to balance and parallelize; same commands and env for local and CI.
362
+
Acceptance tests in `test/acceptance/` are partitioned by **feature build tags** so they can run in parallel (matrix slices plus a separate `acceptance-telemetry` job in CI; see [test/acceptance/README.md](test/acceptance/README.md)). Each `*_test.go` file must have exactly one feature tag (e.g. `//go:build connection`, `//go:build request`, `//go:build telemetry`). **Untagged test files are included in every `-tags=...` build**, including `-tags=telemetry` only, so non-telemetry tests would run in the telemetry job—do not add untagged `*_test.go` files. Use tags to balance and parallelize; same commands and env for local and CI.
Copy file name to clipboardExpand all lines: REFERENCE.md
+86-42Lines changed: 86 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,12 +59,14 @@ hookdeck login [flags]
59
59
| Flag | Type | Description |
60
60
|------|------|-------------|
61
61
|`-i, --interactive`|`bool`| Run interactive configuration mode if you cannot open a browser |
62
+
|`--local`|`bool`| Save credentials to current directory (.hookdeck/config.toml) |
62
63
63
64
**Examples:**
64
65
65
66
```bash
66
67
$ hookdeck login
67
68
$ hookdeck login -i # interactive mode (no browser)
69
+
$ hookdeck login --local # save credentials to .hookdeck/config.toml
68
70
```
69
71
## Logout
70
72
@@ -103,8 +105,6 @@ hookdeck whoami
103
105
```bash
104
106
$ hookdeck whoami
105
107
```
106
-
107
-
Output includes the current project type (Gateway, Outpost, or Console).
108
108
<!-- GENERATE_END -->
109
109
## Projects
110
110
@@ -114,7 +114,7 @@ Output includes the current project type (Gateway, Outpost, or Console).
114
114
115
115
### hookdeck project list
116
116
117
-
List and filter projects by organization and project name substrings. Output shows project type (Gateway, Outpost, Console). Outbound projects are excluded from the list.
117
+
List and filter projects by organization and project name substrings
118
118
119
119
**Usage:**
120
120
@@ -126,16 +126,15 @@ hookdeck project list [<organization_substring>] [<project_substring>] [flags]
126
126
127
127
| Flag | Type | Description |
128
128
|------|------|-------------|
129
-
|`--output`|`string`| Output format: `json` for machine-readable list (id, org, project, type, current)|
130
-
|`--type`|`string`| Filter by project type: `gateway`, `outpost`, or `console`|
129
+
|`--output`|`string`| Output format: json |
130
+
|`--type`|`string`| Filter by project type: gateway, outpost, console |
131
131
132
132
**Examples:**
133
133
134
134
```bash
135
135
$ hookdeck project list
136
136
Acme / Ecommerce Production (current) | Gateway
137
137
Acme / Ecommerce Staging | Gateway
138
-
139
138
$ hookdeck project list --output json
140
139
$ hookdeck project list --type gateway
141
140
```
@@ -161,14 +160,11 @@ hookdeck project use [<organization_name> [<project_name>]] [flags]
161
160
$ hookdeck project use
162
161
Use the arrow keys to navigate: ↓ ↑ → ←
163
162
? Select Project:
164
-
▸ [Acme] Ecommerce Production
165
-
[Acme] Ecommerce Staging
166
-
[Acme] Ecommerce Development
167
-
168
-
Selecting project [Acme] Ecommerce Staging
163
+
▸ Acme / Ecommerce Production (current) | Gateway
164
+
Acme / Ecommerce Staging | Gateway
169
165
170
166
$ hookdeck project use --local
171
-
Pinning project [Acme] Ecommerce Staging to current directory
transformations, events, requests, metrics, and MCP server.
220
216
221
217
The gateway command group provides full access to all Event Gateway resources.
222
-
**Gateway commands require the current project to be a Gateway project** (inbound or console). If your project type is Outpost or you have no project selected, run `hookdeck project use` to switch to a Gateway project first.
223
218
224
219
**Usage:**
225
220
@@ -282,22 +277,22 @@ hookdeck gateway connection list [flags]
282
277
283
278
```bash
284
279
# List all connections
285
-
hookdeck connection list
280
+
hookdeck gateway connection list
286
281
287
282
# Filter by connection name
288
-
hookdeck connection list --name my-connection
283
+
hookdeck gateway connection list --name my-connection
289
284
290
285
# Filter by source ID
291
-
hookdeck connection list --source-id src_abc123
286
+
hookdeck gateway connection list --source-id src_abc123
292
287
293
288
# Filter by destination ID
294
-
hookdeck connection list --destination-id dst_def456
289
+
hookdeck gateway connection list --destination-id dst_def456
0 commit comments