fix: prevent duplicate benchmark PRs on stable releases#304
Conversation
The Benchmark workflow triggers on any Publish workflow completion. During a stable release, both a dev-push Publish (from merging PRs) and the release-event Publish complete successfully, each spawning a Benchmark run that resolves to the same stable version via git tag lookup — creating duplicate PRs. Two fixes: 1. Filter workflow_run triggers to exclude push-initiated Publish completions (dev builds should not benchmark the latest stable tag) 2. Check for existing open PRs before creating new ones as a safety net
|
Claude finished @carlos-alm's task —— View job PR Review: Fix Duplicate Benchmark PRsTodo List:
Phase 1: Root Cause AnalysisProblem Being Solved: During the v3.0.0 release, two separate Publish workflow runs completed successfully within 2 minutes (push event at 10:05, release event at 10:07). Both triggered the Benchmark workflow, which resolved to the same version Root Cause Identified: The workflow_run trigger was too broad - it triggered on ALL Publish workflow completions regardless of the triggering event type. This meant both development pushes to main AND actual releases would trigger benchmarks. Why This Approach: The PR adds two defensive measures:
This is a proper root cause fix, not symptom hiding. The logic is sound: only releases should trigger benchmarks, not development pushes. Phase 2: Configuration Change DetectionNo High-Risk Changes Detected:
The changes are additive safety measures, not rule relaxation. Phase 3: Test Integrity AssessmentNo Test Integrity Issues:
This is a pure workflow change with no impact on test integrity. Phase 4: Code Quality ReviewStrengths:
Technical Analysis:
Minor Observation:
Security: No security concerns - no new credentials, proper use of existing Final Assessment |
Greptile SummaryThis PR prevents duplicate benchmark PRs by implementing a two-layer defense: filtering out push-initiated Publish workflow runs and adding duplicate PR checks before PR creation. Changes:
Root cause addressed: The primary fix (event filtering) prevents push-initiated dev builds from triggering benchmarks since they should only benchmark released versions. The secondary fix (duplicate PR check) serves as a safety net for any edge cases. Confidence Score: 5/5
Important Files Changed
Last reviewed commit: b6f55fa |
Summary
workflow_runtriggers to exclude push-initiated Publish completions — dev builds should not benchmark the latest stable taggh pr createin all 4 benchmark jobs as a safety netRoot cause
During the 3.0.0 release, two Publish workflow runs completed successfully within minutes of each other:
Both triggered separate Benchmark workflow runs. Each resolved to version
3.0.0viagit tag --sort=-version:refname, creating duplicate PRs (#298-#300 and #301-#303).Test plan
workflow_dispatchbenchmarks still work as expectedCloses duplicate PRs: #301, #302, #303 (already closed)