Repository navigation
[repository-quality] Repository Quality Improvement Report - Concurrency safety and race-detector coverage #79523
Closed
Replies: 1 comment
|
This discussion was automatically closed because it expired on 2026-11-21T13:14:09.778Z.
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
🎯 Repository Quality Improvement Report - Concurrency safety and race-detector coverage
Analysis Date: 2026-11-20
Focus Area: Concurrency safety and race-detector coverage
Strategy Type: Custom
Custom Area: Yes. Recent runs covered panics, test isolation, logging, lint, subprocess cancellation, and resource cleanup. Concurrency correctness had not been audited.
Executive Summary
The repository has 139 non-test goroutine launch sites and 77 mutex-guarded structs. The Makefile race target
test-racecovers onlyagentdrain,cli,console,parser, andworkflow. Six other concurrency-bearing packages are not race-tested:workqueue,syncutil,logger,actionpins,workflow/taint, andworkflow/actionslanguageservice. I ran the race detector on those six packages. All passed, andpkg/workqueuetook about 10 minutes.I also found one confirmed bug. In
runShellcheckWorkers(pkg/cli/shellcheck.go), a worker that loses the semaphore wait to context cancellation returns without writing its result slot. The zero-value result then reads as a clean pass. A temporary probe test confirmed that a cancelled step reportserr=<nil>with no output.Full Analysis Report
Current State Assessment
Metrics Collected:
gostatements (pkg, cmd)Findings
Strengths
pkg/cli/docker_images.go: inflight download bookkeeping usesdeferin the correct order, and panics are recovered.pkg/cli/org_rollout.go: the scheduler isolates per-repo work in separate processes, documented against process-globalos.Chdirstate.pkg/syncutil/onceloader.go: all state access is undermu.Areas for Improvement
pkg/cli/shellcheck.gorunShellcheckWorkersreturns onctx.Done()without settingresults[idx]. Cancelled steps are silently reported as passing.Makefiletest-raceomitspkg/workqueue,pkg/syncutil,pkg/logger,pkg/actionpins,pkg/workflow/taint, andpkg/workflow/actionslanguageservice.runShellcheckWorkersor cancellation.Detailed Analysis
Probe: a context cancelled before
runShellcheckWorkersproducedresult[1] err=<nil> output=0 bytes. Withstrict=true, the final error reflected only step 0. The probe file was removed afterwards. The race run passed for all six uncovered packages. Only the pre-existing.github/skills/reporting/SKILL.mdmodification is present in the worktree.🤖 Tasks for Copilot Agent
NOTE TO PLANNER AGENT: Split the following tasks into individual work items.
Improvement Tasks
Task 1: Report cancelled shellcheck steps as failures
Priority: High
Estimated Effort: Small
Focus Area: Concurrency safety
Description: In
runShellcheckWorkers, whenctx.Done()fires while waiting for the semaphore, setresults[idx]to a cancellation error instead of returning silently.Acceptance Criteria:
errin its result slotmake test-unitpasses forpkg/cliCode Region:
pkg/cli/shellcheck.go(runShellcheckWorkers)Task 2: Add uncovered concurrency packages to the race target
Priority: Medium
Estimated Effort: Small
Focus Area: CI/CD
Description: Add
./pkg/workqueue ./pkg/syncutil ./pkg/logger ./pkg/actionpins ./pkg/workflow/taint ./pkg/workflow/actionslanguageservicetotest-race. Check the runtime first, sincepkg/workqueuetakes about 10 minutes under-race, against the 30m timeout.Acceptance Criteria:
make test-raceincludes the six packagesCode Region:
Makefile(test-racetarget)Task 3: Add a race-tested regression for the OnceLoader contract
Priority: Low
Estimated Effort: Small
Focus Area: Testing
Description:
pkg/syncutil/onceloader.godocuments concurrent safety forGet,Override, andReset, but its tests do not run concurrent callers under-race. Add a test that runsGetfrom many goroutines, with interleavedReset, and asserts the loader runs at most once per reset epoch.Acceptance Criteria:
Getcallersgo test -race ./pkg/syncutilCode Region:
pkg/syncutil/onceloader_test.go📊 Historical Context
Previous Focus Areas
🎯 Recommendations
Immediate Actions (This Week)
Short-term Actions (This Month)
test-race. Priority: MediumLong-term Actions (This Quarter)
📈 Success Metrics
Generated by Repository Quality Improvement Agent
Next analysis: 2026-11-21, focus area selected by diversity algorithm
All reactions