Skip to content

Commit d8be7e6

Browse files
authored
Merge pull request #213 from hookdeck/feat/phase-5a-gateway-resources
feat: Agentic DX phase 5a: CLI — gateway group, source management, connection deprecation notice
2 parents 4301f93 + 2a461ea commit d8be7e6

121 files changed

Lines changed: 12269 additions & 2372 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Run GoReleaser
2121
uses: goreleaser/goreleaser-action@v5
2222
with:
23-
version: v2.10.2
23+
version: v2.12.1
2424
args: release -f .goreleaser/mac.yml --clean
2525
env:
2626
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
@@ -51,7 +51,7 @@ jobs:
5151
- name: Run GoReleaser
5252
uses: goreleaser/goreleaser-action@v5
5353
with:
54-
version: v2.10.2
54+
version: v2.12.1
5555
args: release -f .goreleaser/linux.yml --clean
5656
env:
5757
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
@@ -70,7 +70,7 @@ jobs:
7070
- name: Run GoReleaser
7171
uses: goreleaser/goreleaser-action@v5
7272
with:
73-
version: v2.10.2
73+
version: v2.12.1
7474
args: release -f .goreleaser/windows.yml --clean
7575
env:
7676
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
@@ -143,7 +143,7 @@ jobs:
143143
- name: Build npm binaries with GoReleaser
144144
uses: goreleaser/goreleaser-action@v5
145145
with:
146-
version: v2.10.2
146+
version: v2.12.1
147147
args: build -f .goreleaser/npm.yml --clean --skip validate
148148
env:
149149
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-npm-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Install GoReleaser
2727
uses: goreleaser/goreleaser-action@v5
2828
with:
29-
version: v2.10.2
29+
version: v2.12.1
3030
install-only: true
3131

3232
- name: Run npm build tests

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Run GoReleaser
2525
uses: goreleaser/goreleaser-action@v5
2626
with:
27-
version: v2.10.2
27+
version: v2.12.1
2828
args: release --skip=publish --snapshot -f .goreleaser/mac.yml --clean
2929
env:
3030
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
@@ -56,7 +56,7 @@ jobs:
5656
- name: Run GoReleaser
5757
uses: goreleaser/goreleaser-action@v5
5858
with:
59-
version: v2.10.2
59+
version: v2.12.1
6060
args: release --skip=publish --snapshot -f .goreleaser/linux.yml --clean
6161
env:
6262
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
@@ -75,7 +75,7 @@ jobs:
7575
- name: Run GoReleaser
7676
uses: goreleaser/goreleaser-action@v5
7777
with:
78-
version: v2.10.2
78+
version: v2.12.1
7979
args: release --skip=publish --snapshot -f .goreleaser/windows.yml --clean
8080
env:
8181
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ __debug_bin
1717
node_modules/
1818
.env
1919
test-scripts/.install-test/
20+
21+
# Temporary OpenAPI spec download (large; do not commit)
22+
.plans/openapi-2025-07-01.json

.goreleaser/linux.yml

Lines changed: 19 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -52,46 +52,24 @@ nfpms:
5252
formats:
5353
- deb
5454
- rpm
55-
dockers:
56-
- goos: linux
57-
goarch: amd64
58-
ids:
55+
# dockers_v2 uses buildx to build multi-arch manifests in one step,
56+
# avoiding the "is a manifest list" error from the legacy dockers + docker_manifests flow
57+
dockers_v2:
58+
- ids:
5959
- hookdeck-linux
60-
image_templates:
61-
- "hookdeck/hookdeck-cli:{{ .Tag }}-amd64"
62-
- "{{ if not .Prerelease }}hookdeck/hookdeck-cli:latest-amd64{{ end }}"
63-
build_flag_templates:
64-
- "--pull"
65-
- "--label=org.opencontainers.image.created={{.Date}}"
66-
- "--label=org.opencontainers.image.name={{.ProjectName}}"
67-
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
68-
- "--label=org.opencontainers.image.version={{.Version}}"
69-
- "--label=repository=https://github.com/hookdeck/hookdeck-cli"
70-
- "--label=homepage=https://hookdeck.com"
71-
- "--platform=linux/amd64"
72-
- goos: linux
73-
goarch: arm64
74-
ids:
7560
- hookdeck-linux-arm64
76-
image_templates:
77-
- "hookdeck/hookdeck-cli:{{ .Tag }}-arm64"
78-
- "{{ if not .Prerelease }}hookdeck/hookdeck-cli:latest-arm64{{ end }}"
79-
build_flag_templates:
80-
- "--pull"
81-
- "--label=org.opencontainers.image.created={{.Date}}"
82-
- "--label=org.opencontainers.image.name={{.ProjectName}}"
83-
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
84-
- "--label=org.opencontainers.image.version={{.Version}}"
85-
- "--label=repository=https://github.com/hookdeck/hookdeck-cli"
86-
- "--label=homepage=https://hookdeck.com"
87-
- "--platform=linux/arm64/v8"
88-
docker_manifests:
89-
- name_template: "hookdeck/hookdeck-cli:{{ .Tag }}"
90-
image_templates:
91-
- "hookdeck/hookdeck-cli:{{ .Tag }}-amd64"
92-
- "hookdeck/hookdeck-cli:{{ .Tag }}-arm64"
93-
- name_template: "hookdeck/hookdeck-cli:latest"
94-
image_templates:
95-
- "hookdeck/hookdeck-cli:latest-amd64"
96-
- "hookdeck/hookdeck-cli:latest-arm64"
97-
skip_push: auto
61+
images:
62+
- "hookdeck/hookdeck-cli"
63+
tags:
64+
- "{{ .Tag }}"
65+
- "{{ if not .Prerelease }}latest{{ end }}"
66+
platforms:
67+
- linux/amd64
68+
- linux/arm64
69+
labels:
70+
"org.opencontainers.image.created": "{{.Date}}"
71+
"org.opencontainers.image.name": "{{.ProjectName}}"
72+
"org.opencontainers.image.revision": "{{.FullCommit}}"
73+
"org.opencontainers.image.version": "{{.Version}}"
74+
"repository": "https://github.com/hookdeck/hookdeck-cli"
75+
"homepage": "https://hookdeck.com"

.plans/README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,33 @@ See [`connection-management-status.md`](./connection-management/connection-manag
2020
- Connection count command
2121
- Connection cloning
2222

23+
## Documentation and Transformation Updates ✅
24+
25+
**REFERENCE.md generation:**
26+
- `REFERENCE.md` is now generated from Cobra command metadata via `go run ./tools/generate-reference`
27+
- See `tools/generate-reference/main.go` and `REFERENCE.template.md`
28+
29+
**Transformation examples:**
30+
- All transformation code examples updated from `module.exports = async (r) => r` to the correct Hookdeck format: `addHandler("transform", (request, context) => { return request; })`
31+
- Applied in: pkg/cmd (create, run, upsert), README.md, REFERENCE.md (via regen), test/acceptance (helpers, transformation_test.go)
32+
- Transformation run API response model aligned with OpenAPI `TransformationExecutorOutput` (uses `request` field for transformed payload)
33+
- CLI adds default `content-type: application/json` when request headers are empty so the transformation engine executes successfully
34+
35+
**README rebalance:**
36+
- Added Sources and destinations subsection (within Manage connections) with examples and link to [REFERENCE.md#sources](REFERENCE.md#sources) and [REFERENCE.md#destinations](REFERENCE.md#destinations)
37+
- Added Transformations section with examples and link to [REFERENCE.md#transformations](REFERENCE.md#transformations)
38+
- Added Requests, events, and attempts section with examples and links to [REFERENCE.md#requests](REFERENCE.md#requests), [REFERENCE.md#events](REFERENCE.md#events), [REFERENCE.md#attempts](REFERENCE.md#attempts)
39+
2340
## Active Planning Documents
2441

2542
- **[`connection-management-status.md`](./connection-management/connection-management-status.md)** - Current implementation status (98% complete)
2643
- **[`resource-management-implementation.md`](./resource-management-implementation.md)** - Overall resource management plan
2744

45+
## Testing and sandbox
46+
47+
- **Always run tests** when implementing or changing code (`go test ./pkg/...`, and for CLI changes `go test ./test/acceptance/...`). Do not skip tests to avoid failures.
48+
- If tests fail due to **TLS/certificate errors**, **network**, or **sandbox** (e.g. `x509`, `operation not permitted`), **prompt the user** and **re-run with elevated permissions** (e.g. `required_permissions: ["all"]`) so tests can pass.
49+
2850
## Development Guidelines
2951

3052
All CLI development follows the patterns documented in [`AGENTS.md`](../AGENTS.md):
@@ -35,4 +57,4 @@ All CLI development follows the patterns documented in [`AGENTS.md`](../AGENTS.m
3557
- **Ordered array configurations** - For API arrays with ordering (rules, steps, middleware)
3658
- **Idempotent upsert pattern** - For declarative resource management with `--dry-run` support
3759

38-
Design specifications have been consolidated into `AGENTS.md` as general principles with connection management as concrete examples.
60+
Design specifications have been consolidated into `AGENTS.md` as general principles with connection management as concrete examples.

.plans/connection-management/connection-management-status.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Connection Management Implementation Status
22

3+
## Tests and sandbox
4+
5+
- **Always run tests** when implementing or changing code. Do not skip tests to avoid failures.
6+
- If tests fail due to **TLS/certificate errors**, **network**, or **sandbox** (e.g. `x509`, `operation not permitted`), **prompt the user** and **re-run with elevated permissions** (e.g. `required_permissions: ["all"]`) so tests can pass.
7+
38
## Executive Summary
49

510
Connection management for the Hookdeck CLI is **98% complete and production-ready**. All core CRUD operations, lifecycle management, comprehensive authentication, rule configuration, and rate limiting have been fully implemented. The remaining 2% consists of optional enhancements (bulk operations, connection count, cloning) that are low priority.

.plans/resource-management-implementation.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,23 @@
3232
- [ ] `destination update` - Critical for URL changes
3333
- [ ] `destination delete` - Clean up unused
3434

35+
### ✅ Recent (February 2026)
36+
- **Transformation examples** - All examples updated to `addHandler("transform", ...)` format (README, REFERENCE, pkg/cmd, tests)
37+
- **Transformation run** - API response model fixed to match OpenAPI; CLI displays transformed output; default content-type for empty headers
38+
3539
### 📋 Planned
36-
- **Transformation Management** (Priority 2 - Week 2)
40+
- **Transformation Management** (Priority 2 - Week 2) - CRUD already present; examples and run output now correct
3741
- **Project Management Extensions** (Priority 3 - Week 3)
3842
- **Advanced Features** (Future)
3943

4044

4145
---
4246

47+
## Testing and sandbox
48+
49+
- **Always run tests** when implementing or changing code. Do not skip tests to avoid failures.
50+
- If tests fail due to **TLS/certificate errors**, **network**, or **sandbox** (e.g. `x509`, `operation not permitted`), **prompt the user** and **re-run with elevated permissions** (e.g. `required_permissions: ["all"]`) so tests can pass.
51+
4352
## Background
4453

4554
The Hookdeck CLI currently supports limited commands in `@pkg/cmd` with basic project management. This plan outlines implementing comprehensive resource management for projects, connections, sources, destinations, and transformations using the Hookdeck API (https://api.hookdeck.com/2025-07-01/openapi).
@@ -56,6 +65,7 @@ The Hookdeck CLI currently supports limited commands in `@pkg/cmd` with basic pr
5665
- **Idempotent operations** - `upsert` commands with `--dry-run` support for declarative management
5766
- **Type-driven validation** - Progressive validation based on `--type` parameters
5867
- **JSON fallback** - Complex configurations via `--rules`, `--rules-file`, `--config`, `--config-file`
68+
- **Plural alias for resource commands** - Every resource command group uses singular as primary `Use` and **must** have the plural as an alias (e.g. `source`/`sources`, `connection`/`connections`, `project`/`projects`). See AGENTS.md § Resource command naming and plural alias.
5969

6070
All CLI commands must follow these established patterns for consistency across the codebase.
6171

@@ -66,7 +76,7 @@ All CLI commands must follow these established patterns for consistency across t
6676
3. **Add source management** - Manage webhook sources with various provider types
6777
4. **Add destination management** - Manage HTTP, CLI, and Mock API destinations
6878
5. **Add transformation management** - Manage JavaScript code transformations
69-
6. **Create reference documentation** - Comprehensive `REFERENCE.md` with examples
79+
6. ~~**Create reference documentation**~~ - REFERENCE.md generated via `go run ./tools/generate-reference` from Cobra metadata
7080
7. **Maintain consistency** - Follow existing CLI patterns and architecture
7181

7282
## Success Criteria
@@ -398,9 +408,10 @@ func validateSourceType(sourceType string, flags *sourceCreateFlags) error {
398408

399409
### Phase 4: Documentation and Examples
400410

401-
#### Task 4.1: Create Reference Documentation
402-
**Files to create:**
403-
- `REFERENCE.md` - Comprehensive CLI reference
411+
#### Task 4.1: Create Reference Documentation ✅
412+
**Files:** `REFERENCE.md` (generated), `tools/generate-reference/main.go`, `REFERENCE.template.md`
413+
414+
REFERENCE.md is generated from Cobra command metadata. Run `go run ./tools/generate-reference` after changing commands/flags. README rebalanced with Sources/destinations, Transformations, and Requests/events/attempts sections, each linking to REFERENCE.md subsections.
404415

405416
**Content Structure:**
406417
```markdown
@@ -464,6 +475,8 @@ cmd.Example = ` # List all sources
464475

465476
### Phase 5: Testing and Validation
466477

478+
**CLI conventions checklist (all phases):** When adding or reviewing a resource command group, ensure it has a **plural alias** (e.g. `source`/`sources`, `connection`/`connections`, `project`/`projects`). See AGENTS.md § Resource command naming and plural alias.
479+
467480
#### Task 5.1: Add Command Tests
468481
**Files to create:**
469482
- `pkg/cmd/*_test.go` - Unit tests for all commands

0 commit comments

Comments
 (0)