Skip to content

ci: test multi pr over the same base#49

Merged
317787106 merged 9 commits into317787106:developfrom
0xbigapple:hotfix/ci_1
Mar 20, 2026
Merged

ci: test multi pr over the same base#49
317787106 merged 9 commits into317787106:developfrom
0xbigapple:hotfix/ci_1

Conversation

@317787106
Copy link
Copy Markdown
Owner

@317787106 317787106 commented Mar 19, 2026

What does this PR do?

Why are these changes required?

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details


Summary by cubic

Fixes CI cancellations for concurrent PRs by scoping concurrency to the PR number. Adds manual workflow_dispatch with a job selector (all, macos, ubuntu, rockylinux, debian11) and targeted job conditions; removes the unused ref input.

Written for commit cd212d6. Summary will update on new commits.

Summary by CodeRabbit

  • Chores
    • Build workflow now supports manual triggering with selectable build targets, letting maintainers run specific platform builds or all builds on demand.
    • Improved concurrency handling to reduce duplicate runs and ensure builds are grouped per PR or branch.
    • Individual platform build jobs now run conditionally so manual selections or PR events only run the intended jobs.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 20, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 83d9a803-e332-42a1-aaa1-112e16e77a36

📥 Commits

Reviewing files that changed from the base of the PR and between 5ced286 and cd212d6.

📒 Files selected for processing (1)
  • .github/workflows/pr-build.yml

📝 Walkthrough

Walkthrough

Added a manual workflow_dispatch trigger with a job input (default all), changed the concurrency.group expression to use github.event.pull_request.number || github.ref, and enabled job-level if conditions so four build jobs run on pull_request or when inputs.job matches (or is all).

Changes

Cohort / File(s) Summary
GitHub workflow
.github/workflows/pr-build.yml
Added workflow_dispatch with job input (default all); updated concurrency.group to use `${{ github.event.pull_request.number

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • 317787106/java-tron#48: Modifies the same .github/workflows/pr-build.yml, touching job-level conditional execution and workflow dispatch behavior.

Poem

🐰 I hopped into YAML, nudged a single key,
Now you can run jobs by name or let PRs be,
Concurrency tamed, conditions set free,
I munch CI carrots beneath an oak tree! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and does not clearly convey the main purpose of the changes, which is to add workflow_dispatch functionality and job-level conditions. Consider using a more descriptive title such as 'ci: add workflow_dispatch with job selector to pr-build workflow' to better reflect the implementation details and intent.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

description: 'Job to run: all / macos / ubuntu / rockylinux / debian11'
required: false
default: 'all'
ref:
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Fix with Cubic

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3a075b9 and b0e72b9.

📒 Files selected for processing (1)
  • .github/workflows/pr-build.yml

Comment on lines +13 to +16
ref:
description: 'Branch or commit SHA to run against'
required: false
default: ''
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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.yml

Repository: 317787106/java-tron

Length of output: 422


🏁 Script executed:

cat -n .github/workflows/pr-build.yml | head -80

Repository: 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.yml

Repository: 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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between b0e72b9 and 5ced286.

📒 Files selected for processing (1)
  • .github/workflows/pr-build.yml

@317787106 317787106 merged commit d3e1beb into 317787106:develop Mar 20, 2026
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant