fix(actions): nil pointer dereference in concurrency during PR creation #137
Reference in New Issue
Block a user
Delete Branch "fix/136-actions-concurrency-nil-panic"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
EvaluateRunConcurrencyFillModelwhenInsertRunpassesnilfor theattemptparameter (concurrency.go:39)run.ConcurrencyGroupwas never populated for DB persistence because the function only wrote to the nil attemptTestEvaluateRunConcurrency_RunIDFallbackwhich had wrong argument count (5 vs 6) and didn't test the attempt pathCloses #136
Root cause
InsertRun(run.go:91) calledEvaluateRunConcurrencyFillModel(ctx, run, nil, ...), but the function wrote toattempt.ConcurrencyGroupat concurrency.go:39 without checking for nil. This crashed the server during the post-creation notification phase when creating PRs via the API on repos with workflow-level concurrency configured.Changes
services/actions/concurrency.gorunandattempt(with nil guard)services/actions/run.goActionRunAttemptstruct before calling evaluate, reuse forPrepareToStartRunWithConcurrencyservices/actions/context_test.goTest plan
TestEvaluateRunConcurrency_RunIDFallbackpassesTestPrepareRunAndInsert_ExpressionsSeeRunIDpasses?? Generated with Claude Code