Problem
source delete, destination delete, connection delete, transformation delete and issue dismiss confirm with fmt.Scanln and discard its error:
pkg/cmd/connection_delete.go:69-78 (the other four are identical in shape):
if !cc.force {
fmt.Printf("\nAre you sure you want to delete connection '%s' (%s)? [y/N]: ", connectionName, connectionID)
var response string
fmt.Scanln(&response) // error discarded
if response != "y" && response != "Y" {
fmt.Println("Deletion cancelled.")
return nil // exit 0
}
}
Without a terminal, Scanln fails immediately, response stays "", and the command prints Deletion cancelled. and returns nil. A CI job that deletes nothing therefore exits 0 and looks like a success.
This is worse than crashing: the pipeline is green, and the resource is still there.
Reproduction
$ hookdeck gateway source delete src_abc123 < /dev/null
Are you sure you want to delete source 'x' (src_abc123)? [y/N]:
Deletion cancelled.
$ echo $?
0
Fix
A shared confirm helper: if stdin is not a terminal and --force was not passed, fail with a non-zero exit naming --force. All five commands already have --force, so the non-interactive path exists — it just was not required. Interactive behaviour is unchanged.
Fixed in the v2.5.0 branch alongside #333/#334/#337.
Problem
source delete,destination delete,connection delete,transformation deleteandissue dismissconfirm withfmt.Scanlnand discard its error:pkg/cmd/connection_delete.go:69-78(the other four are identical in shape):Without a terminal,
Scanlnfails immediately,responsestays"", and the command printsDeletion cancelled.and returns nil. A CI job that deletes nothing therefore exits 0 and looks like a success.This is worse than crashing: the pipeline is green, and the resource is still there.
Reproduction
Fix
A shared confirm helper: if stdin is not a terminal and
--forcewas not passed, fail with a non-zero exit naming--force. All five commands already have--force, so the non-interactive path exists — it just was not required. Interactive behaviour is unchanged.Fixed in the v2.5.0 branch alongside #333/#334/#337.