@@ -24,12 +24,23 @@ import (
24
24
)
25
25
26
26
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.
33
44
)
34
45
35
46
type missingKeyError struct {
@@ -98,7 +109,7 @@ func (r *JobRunner) Run(ctx context.Context) error {
98
109
99
110
if r .VerificationFailureBehavior == VerificationBehaviourBlock {
100
111
exit .Status = - 1
101
- exit .SignalReason = SignalReasonUnableToVerifySignature
112
+ exit .SignalReason = SignalReasonSignatureRejected
102
113
return nil
103
114
}
104
115
}
0 commit comments