fix(actions): nil pointer dereference in concurrency during PR creation #137

Merged
jmiller merged 1 commits from fix/136-actions-concurrency-nil-panic into main 2026-05-24 03:26:43 +00:00

1 Commits

Author SHA1 Message Date
Jonathan Miller a804ebcf09 fix(actions): nil pointer dereference in concurrency during PR creation
Branch Policy Check / Verify merge target (pull_request) Failing after 1s
InsertRun passed nil for the attempt parameter to
EvaluateRunConcurrencyFillModel, which then dereferenced the nil
pointer at concurrency.go:39 when writing ConcurrencyGroup and
ConcurrencyCancel fields. This caused a server panic whenever a PR was
created via the API on a repo with workflow-level concurrency
configured.

The fix:
- Creates an ActionRunAttempt struct in InsertRun before calling
  EvaluateRunConcurrencyFillModel, and reuses it for
  PrepareToStartRunWithConcurrency
- Updates EvaluateRunConcurrencyFillModel to write concurrency fields
  to both the run (for DB persistence) and the attempt (for in-memory
  concurrency checks), with a nil guard on the attempt
- Fixes TestEvaluateRunConcurrency_RunIDFallback which had the wrong
  argument count and was not testing the attempt path

Closes #136

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-23 18:18:06 -05:00