ci: test multi pr over the same base#49
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdded a manual Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GitHub as GitHub Actions
participant Runner as Job Runner
User->>GitHub: Trigger (pull_request) or click "Run workflow"\n(inputs.job = <job|all>)
GitHub->>GitHub: Evaluate concurrency and job-level `if`\n(using event.pull_request.number || github.ref)
Note right of GitHub: condition = event == pull_request OR inputs.job == jobName OR inputs.job == "all"
GitHub->>Runner: Start matching jobs (build-macos, build-ubuntu,\n docker-build-rockylinux, docker-build-debian11)
Runner-->>GitHub: Job results
GitHub-->>User: Notify run status
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/pr-build.yml">
<violation number="1" location=".github/workflows/pr-build.yml:13">
P2: The `ref` input is declared but never passed to any `actions/checkout` step. When a user triggers this workflow manually and provides a branch or commit SHA, it is silently ignored. Pass it to the checkout action's `ref` parameter, e.g.:
```yaml
- uses: actions/checkout@v5
with:
ref: ${{ inputs.ref || github.ref }}
```</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
.github/workflows/pr-build.yml
Outdated
| description: 'Job to run: all / macos / ubuntu / rockylinux / debian11' | ||
| required: false | ||
| default: 'all' | ||
| ref: |
There was a problem hiding this comment.
P2: The ref input is declared but never passed to any actions/checkout step. When a user triggers this workflow manually and provides a branch or commit SHA, it is silently ignored. Pass it to the checkout action's ref parameter, e.g.:
- uses: actions/checkout@v5
with:
ref: ${{ inputs.ref || github.ref }}Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/pr-build.yml, line 13:
<comment>The `ref` input is declared but never passed to any `actions/checkout` step. When a user triggers this workflow manually and provides a branch or commit SHA, it is silently ignored. Pass it to the checkout action's `ref` parameter, e.g.:
```yaml
- uses: actions/checkout@v5
with:
ref: ${{ inputs.ref || github.ref }}
```</comment>
<file context>
@@ -4,6 +4,16 @@ on:
+ description: 'Job to run: all / macos / ubuntu / rockylinux / debian11'
+ required: false
+ default: 'all'
+ ref:
+ description: 'Branch or commit SHA to run against'
+ required: false
</file context>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/pr-build.yml:
- Around line 13-16: The workflow declares workflow_dispatch.inputs.ref but
never passes it to any checkout actions; update each actions/checkout@... step
(the four checkout occurrences) to include a with: ref: that uses the
workflow_dispatch input (fallback to github.ref) so manual runs respect the
provided ref value; modify the checkout steps named/actions/checkout@v3 to read
the input ref and fall back to the default branch/ref.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: dc6d86e2-3d4c-4678-9590-f91108c9d895
📒 Files selected for processing (1)
.github/workflows/pr-build.yml
.github/workflows/pr-build.yml
Outdated
| ref: | ||
| description: 'Branch or commit SHA to run against' | ||
| required: false | ||
| default: '' |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify that workflow_dispatch `ref` is declared and whether it is used by checkout steps.
rg -n "workflow_dispatch|inputs:|job:|ref:" .github/workflows/pr-build.yml
echo "----- checkout blocks -----"
rg -n "actions/checkout@v5|with:|ref:" .github/workflows/pr-build.ymlRepository: 317787106/java-tron
Length of output: 422
🏁 Script executed:
cat -n .github/workflows/pr-build.yml | head -80Repository: 317787106/java-tron
Length of output: 2776
🏁 Script executed:
cat -n .github/workflows/pr-build.yml | sed -n '100,130p'Repository: 317787106/java-tron
Length of output: 1178
🏁 Script executed:
cat -n .github/workflows/pr-build.yml | sed -n '150,180p'Repository: 317787106/java-tron
Length of output: 971
🏁 Script executed:
rg -n "github.event.inputs.ref|inputs.ref" .github/workflows/pr-build.ymlRepository: 317787106/java-tron
Length of output: 45
Add ref parameter to all checkout steps to make the workflow_dispatch input functional.
The ref input is declared in workflow_dispatch.inputs (lines 13-16) but none of the four checkout actions consume it. Users cannot override the branch or commit SHA when triggering manual runs.
💡 Proposed fix
Add the with: block to all four checkout steps:
- uses: actions/checkout@v5
+ with:
+ ref: ${{ github.event.inputs.ref || github.ref }}Apply to the checkouts at lines 41, 68, 107, and 152.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/pr-build.yml around lines 13 - 16, The workflow declares
workflow_dispatch.inputs.ref but never passes it to any checkout actions; update
each actions/checkout@... step (the four checkout occurrences) to include a
with: ref: that uses the workflow_dispatch input (fallback to github.ref) so
manual runs respect the provided ref value; modify the checkout steps
named/actions/checkout@v3 to read the input ref and fall back to the default
branch/ref.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/pr-build.yml:
- Line 15: Replace the concurrency group key that currently uses github.head_ref
(the branch name) with a PR-unique identifier by using
github.event.pull_request.number when present, and fall back to github.ref for
non-PR triggers; update the group expression in the workflow (the line building
group: ${{ github.workflow }}-${{ ... }}) to reference
github.event.pull_request.number || github.ref so separate PRs no longer share
the same concurrency group.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4b325eb8-9278-4d01-af91-a2b2b3b1346c
📒 Files selected for processing (1)
.github/workflows/pr-build.yml
What does this PR do?
Why are these changes required?
This PR has been tested by:
Follow up
Extra details
Summary by cubic
Fixes CI cancellations for concurrent PRs by scoping concurrency to the PR number. Adds manual
workflow_dispatchwith ajobselector (all,macos,ubuntu,rockylinux,debian11) and targeted job conditions; removes the unusedrefinput.Written for commit cd212d6. Summary will update on new commits.
Summary by CodeRabbit