Skip to content

Commit 15461ce

Browse files
committed
Remove deprecated archive/unarchive commands in favor of disable/enable
- Remove connection_archive.go and connection_unarchive.go command files - Remove ArchiveConnection() and UnarchiveConnection() API client methods - Remove related tests from connections_test.go - Update documentation in README.md and REFERENCE.md to remove archive/unarchive references - Keep disable/enable commands as the primary lifecycle management commands - All 32 acceptance tests pass successfully Aligns with 2024-03-01 API changes where archive/unarchive were renamed to disable/enable
1 parent ca0a2e5 commit 15461ce

File tree

9 files changed

+308
-350
lines changed

9 files changed

+308
-350
lines changed

README.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,6 @@ hookdeck connection enable # Enable a connection
465465
hookdeck connection disable # Disable a connection
466466
hookdeck connection pause # Pause a connection
467467
hookdeck connection unpause # Unpause a connection
468-
hookdeck connection archive # Archive a connection
469-
hookdeck connection unarchive # Unarchive a connection
470468
```
471469

472470
### Manage active project
@@ -724,9 +722,8 @@ $ hookdeck connection list --destination dest_xyz789
724722
# Filter by name pattern
725723
$ hookdeck connection list --name "production-*"
726724

727-
# Include disabled or paused connections
725+
# Include disabled connections
728726
$ hookdeck connection list --disabled
729-
$ hookdeck connection list --paused
730727

731728
# Output as JSON
732729
$ hookdeck connection list --output json
@@ -763,18 +760,11 @@ $ hookdeck connection pause conn_123abc
763760

764761
# Resume a paused connection
765762
$ hookdeck connection unpause conn_123abc
766-
767-
# Archive a connection (hide from main lists)
768-
$ hookdeck connection archive conn_123abc
769-
770-
# Restore an archived connection
771-
$ hookdeck connection unarchive conn_123abc
772763
```
773764

774765
**State differences:**
775766
- **Disabled**: Connection stops receiving events entirely
776767
- **Paused**: Connection queues events but doesn't forward them (useful during maintenance)
777-
- **Archived**: Connection is hidden from main lists but can be restored
778768

779769
#### Delete a connection
780770

REFERENCE.md

Lines changed: 29 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,16 @@ All commands support these global options:
5151
--help, -h Show help information
5252
```
5353

54-
### 🚧 Planned Global Options
54+
### 🔄 Partially Implemented Options
55+
```bash
56+
--output json Output in JSON format (available on: connection create/list/get/upsert)
57+
Default: human-readable format
58+
```
59+
60+
### � Planned Global Options
5561
```bash
5662
--project string Project ID to use (overrides profile)
57-
--format string Output format: table, json, yaml (default "table")
63+
--output string Additional output formats: table, yaml (currently only json supported)
5864
```
5965

6066
## Authentication
@@ -293,7 +299,7 @@ The Hookdeck CLI provides comprehensive connection management capabilities. The
293299
| Project Management | 🔄 **Partial** | `project list`, `project use` |
294300
| Local Development |**Current** | `listen` |
295301
| CI/CD |**Current** | `ci` |
296-
| Connection Management |**Current** | `connection create`, `connection list`, `connection get`, `connection upsert`, `connection delete`, `connection enable`, `connection disable`, `connection pause`, `connection unpause`, `connection archive`, `connection unarchive` |
302+
| Connection Management |**Current** | `connection create`, `connection list`, `connection get`, `connection upsert`, `connection delete`, `connection enable`, `connection disable`, `connection pause`, `connection unpause` |
297303
| Shell Completion |**Current** | `completion` (bash, zsh) |
298304
| Source Management | 🚧 **Planned** | *(Not implemented)* |
299305
| Destination Management | 🚧 **Planned** | *(Not implemented)* |
@@ -450,7 +456,7 @@ hookdeck project delete proj_123 --force
450456
<source-id> # Required positional argument for source ID
451457
--force # Force delete without confirmation (boolean flag)
452458

453-
# Source enable/disable/archive/unarchive command parameters
459+
# Source enable/disable command parameters
454460
<source-id> # Required positional argument for source ID
455461
```
456462

@@ -662,12 +668,6 @@ hookdeck source enable <source-id>
662668

663669
# Disable source
664670
hookdeck source disable <source-id>
665-
666-
# Archive source
667-
hookdeck source archive <source-id>
668-
669-
# Unarchive source
670-
hookdeck source unarchive <source-id>
671671
```
672672

673673
## Destinations
@@ -729,7 +729,7 @@ hookdeck source unarchive <source-id>
729729
<destination-id> # Required positional argument for destination ID
730730
--force # Force delete without confirmation (boolean flag)
731731

732-
# Destination enable/disable/archive/unarchive command parameters
732+
# Destination enable/disable command parameters
733733
<destination-id> # Required positional argument for destination ID
734734
```
735735

@@ -863,12 +863,6 @@ hookdeck destination enable <destination-id>
863863

864864
# Disable destination
865865
hookdeck destination disable <destination-id>
866-
867-
# Archive destination
868-
hookdeck destination archive <destination-id>
869-
870-
# Unarchive destination
871-
hookdeck destination unarchive <destination-id>
872866
```
873867

874868
## Connections
@@ -883,7 +877,6 @@ hookdeck destination unarchive <destination-id>
883877
- `connection delete` - Delete connections with confirmation
884878
- `connection enable/disable` - Control connection state
885879
- `connection pause/unpause` - Pause/resume event processing
886-
- `connection archive/unarchive` - Archive inactive connections
887880

888881
**Implementation Status:**
889882
- ✅ Full CRUD operations
@@ -902,36 +895,34 @@ hookdeck destination unarchive <destination-id>
902895
# List all connections
903896
hookdeck connection list
904897

905-
# Filter by source
906-
hookdeck connection list --source src_abc123
898+
# Filter by source ID
899+
hookdeck connection list --source-id src_abc123
907900

908-
# Filter by destination
909-
hookdeck connection list --destination dest_xyz789
901+
# Filter by destination ID
902+
hookdeck connection list --destination-id dest_xyz789
910903

911-
# Filter by name pattern
912-
hookdeck connection list --name "production-*"
904+
# Filter by connection name
905+
hookdeck connection list --name "production-connection"
913906

914907
# Include disabled connections
915908
hookdeck connection list --disabled
916909

917-
# Include paused connections
918-
hookdeck connection list --paused
910+
# Combine filters
911+
hookdeck connection list --source-id src_abc123 --disabled
919912

920-
# Include archived connections
921-
hookdeck connection list --archived
913+
# Limit results
914+
hookdeck connection list --limit 50
922915

923-
# Combine filters
924-
hookdeck connection list --source src_abc123 --disabled
916+
# Output as JSON
917+
hookdeck connection list --output json
925918
```
926919

927920
**Available Flags:**
928-
- `--source <id-or-name>` - Filter by source ID or name
929-
- `--destination <id-or-name>` - Filter by destination ID or name
930-
- `--name <pattern>` - Filter by connection name
931-
- `--full-name <pattern>` - Filter by full connection name (source > connection > destination)
932-
- `--disabled` - Show only disabled connections
933-
- `--paused` - Show only paused connections
934-
- `--archived` - Show only archived connections
921+
- `--name <string>` - Filter by connection name
922+
- `--source-id <string>` - Filter by source ID
923+
- `--destination-id <string>` - Filter by destination ID
924+
- `--disabled` - Include disabled connections
925+
- `--limit <int>` - Limit number of results (default: 100)
935926
- `--output json` - Output in JSON format
936927

937928
### Get Connection
@@ -1236,16 +1227,11 @@ hookdeck connection enable conn_abc123
12361227
# Pause/Unpause (queue events without forwarding)
12371228
hookdeck connection pause conn_abc123
12381229
hookdeck connection unpause conn_abc123
1239-
1240-
# Archive/Unarchive (for inactive connections)
1241-
hookdeck connection archive conn_abc123
1242-
hookdeck connection unarchive conn_abc123
12431230
```
12441231
12451232
**State Differences:**
12461233
- **Disabled**: Connection stops receiving events entirely
12471234
- **Paused**: Connection queues events but doesn't forward them
1248-
- **Archived**: Connection is hidden from main lists but can be restored
12491235

12501236
### Implementation Notes
12511237

@@ -1254,7 +1240,7 @@ hookdeck connection unarchive conn_abc123
12541240
- Inline resource creation with authentication
12551241
- All 5 rule types (retry, filter, transform, delay, deduplicate)
12561242
- Rate limiting configuration
1257-
- Lifecycle management (enable, disable, pause, unpause, archive, unarchive)
1243+
- Lifecycle management (enable, disable, pause, unpause)
12581244
- Idempotent upsert with dry-run support
12591245
- 21 acceptance tests, all passing
12601246

pkg/cmd/connection.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ https://github.com/hookdeck/hookdeck-cli/issues`,
3737
cc.cmd.AddCommand(newConnectionDisableCmd().cmd)
3838
cc.cmd.AddCommand(newConnectionPauseCmd().cmd)
3939
cc.cmd.AddCommand(newConnectionUnpauseCmd().cmd)
40-
cc.cmd.AddCommand(newConnectionArchiveCmd().cmd)
41-
cc.cmd.AddCommand(newConnectionUnarchiveCmd().cmd)
4240

4341
return cc
4442
}

pkg/cmd/connection_archive.go

Lines changed: 0 additions & 48 deletions
This file was deleted.

pkg/cmd/connection_list.go

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ type connectionListCmd struct {
2020
sourceID string
2121
destinationID string
2222
disabled bool
23-
paused bool
2423
limit int
2524
output string
2625
}
@@ -50,9 +49,6 @@ Examples:
5049
# Include disabled connections
5150
hookdeck connection list --disabled
5251
53-
# Include paused connections
54-
hookdeck connection list --paused
55-
5652
# Limit results
5753
hookdeck connection list --limit 10`,
5854
RunE: cc.runConnectionListCmd,
@@ -62,7 +58,6 @@ Examples:
6258
cc.cmd.Flags().StringVar(&cc.sourceID, "source-id", "", "Filter by source ID")
6359
cc.cmd.Flags().StringVar(&cc.destinationID, "destination-id", "", "Filter by destination ID")
6460
cc.cmd.Flags().BoolVar(&cc.disabled, "disabled", false, "Include disabled connections")
65-
cc.cmd.Flags().BoolVar(&cc.paused, "paused", false, "Include paused connections")
6661
cc.cmd.Flags().IntVar(&cc.limit, "limit", 100, "Limit number of results")
6762
cc.cmd.Flags().StringVar(&cc.output, "output", "", "Output format (json)")
6863

@@ -91,14 +86,24 @@ func (cc *connectionListCmd) runConnectionListCmd(cmd *cobra.Command, args []str
9186
params["destination_id"] = cc.destinationID
9287
}
9388

94-
if !cc.disabled {
89+
// API behavior (tested in test-scripts/test-disabled-behavior.sh):
90+
// - NO parameter: Returns ALL connections (both active and disabled)
91+
// - disabled=false: Returns ONLY active connections (excludes disabled)
92+
// - disabled=true: Returns ALL connections (both active and disabled)
93+
//
94+
// CLI behavior (from test expectations):
95+
// - --disabled flag present: Include ALL connections (both active and disabled)
96+
// - --disabled flag absent: Include only active connections
97+
//
98+
// Therefore:
99+
// - When --disabled flag is PRESENT: Send disabled=true (to get all)
100+
// - When --disabled flag is ABSENT: Send disabled=false (to exclude disabled)
101+
if cc.disabled {
102+
params["disabled"] = "true"
103+
} else {
95104
params["disabled"] = "false"
96105
}
97106

98-
if !cc.paused {
99-
params["paused"] = "false"
100-
}
101-
102107
params["limit"] = strconv.Itoa(cc.limit)
103108

104109
// List connections

pkg/cmd/connection_unarchive.go

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)