Skip to content

Commit 68fac8d

Browse files
Merge pull request #3094 from buildkite/remove-signal-reason-unable-to-verify-signature
Remove signal reason unable_to_verify_signature and replace with signature_rejected
2 parents 896685c + f470fb5 commit 68fac8d

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

agent/integration/job_verification_integration_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ func TestJobVerification(t *testing.T) {
445445
verificationJWKS: nil,
446446
mockBootstrapExpectation: func(bt *bintest.Mock) { bt.Expect().NotCalled() },
447447
expectedExitStatus: "-1",
448-
expectedSignalReason: agent.SignalReasonUnableToVerifySignature,
448+
expectedSignalReason: agent.SignalReasonSignatureRejected,
449449
expectLogsContain: []string{
450450
"+++ ⛔",
451451
"cannot verify signature. JWK for pipeline verification is not configured",

agent/run_job.go

+18-7
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,23 @@ import (
2424
)
2525

2626
const (
27-
SignalReasonAgentRefused = "agent_refused"
28-
SignalReasonAgentStop = "agent_stop"
29-
SignalReasonCancel = "cancel"
30-
SignalReasonSignatureRejected = "signature_rejected"
31-
SignalReasonUnableToVerifySignature = "unable_to_verify_signature"
32-
SignalReasonProcessRunError = "process_run_error"
27+
// Signal reasons
28+
SignalReasonAgentRefused = "agent_refused"
29+
SignalReasonAgentStop = "agent_stop"
30+
SignalReasonCancel = "cancel"
31+
SignalReasonSignatureRejected = "signature_rejected"
32+
SignalReasonProcessRunError = "process_run_error"
33+
// Don't add more signal reasons. If you must add a new signal reason, it must also be added to
34+
// the Job::Event::SignalReason enum in the rails app.
35+
//
36+
// They are meant to represent the reason a job was stopped, but they've also been used to
37+
// represent the reason a job wasn't started at all. This is fine but we don't want to pile more
38+
// on as customers catch these signal reasons when configuring retry attempts. When we add more
39+
// signal reasons we force customers to update their retry configurations to catch the new signal
40+
// reasons.
41+
//
42+
// We should consider adding new fields 'not_run_reason' and 'not_run_details' instead of adding
43+
// more signal reasons.
3344
)
3445

3546
type missingKeyError struct {
@@ -98,7 +109,7 @@ func (r *JobRunner) Run(ctx context.Context) error {
98109

99110
if r.VerificationFailureBehavior == VerificationBehaviourBlock {
100111
exit.Status = -1
101-
exit.SignalReason = SignalReasonUnableToVerifySignature
112+
exit.SignalReason = SignalReasonSignatureRejected
102113
return nil
103114
}
104115
}

0 commit comments

Comments
 (0)