Skip to content

chore: add concurrency control to test project workflow - #2206

Open
SHUBHANSHU602 wants to merge 1 commit into
asyncapi:masterfrom
SHUBHANSHU602:workflow
Open

chore: add concurrency control to test project workflow#2206
SHUBHANSHU602 wants to merge 1 commit into
asyncapi:masterfrom
SHUBHANSHU602:workflow

Conversation

@SHUBHANSHU602

@SHUBHANSHU602 SHUBHANSHU602 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Add workflow-level concurrency control to the Test using test project workflow.

Changes

  • Add a concurrency group scoped to the pull request.
  • Enable cancel-in-progress: true to cancel outdated workflow runs.

Benefit

When multiple commits are pushed to the same PR in quick succession, outdated runs are cancelled and only the latest run continues.
This reduces unnecessary CI resource usage and provides faster feedback for the latest commit.

Resolve #2133

  • This PR was created with AI assistance — Generated-by:
  • No AI assistance was used

Summary by CodeRabbit

  • Chores
    • Improved pull request validation workflow management.
    • Automatically cancels outdated validation runs when a newer run is started for the same pull request.

@changeset-bot

changeset-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 98be10c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@asyncapi-bot

Copy link
Copy Markdown
Contributor

What reviewer looks at during PR review

The following are ideal points maintainers look for during review. Reviewing these points yourself beforehand can help streamline the review process and reduce time to merge.

  1. PR Title: Use a concise title that follows our Conventional Commits guidelines and clearly summarizes the change using imperative mood (it means spoken or written as if giving a command or instruction, like "add new helper for listing operations")

    Note - In Generator, prepend feat: or fix: in PR title only when PATCH/MINOR release must be triggered.

  2. PR Description: Clearly explain the issue being solved, summarize the changes made, and mention the related issue.

    Note - In Generator, we use Maintainers Work board to track progress. Ensure the PR Description includes Resolves #<issue-number> or Fixes #<issue-number> this will automatically close the linked issue when the PR is merged and helps automate the maintainers workflow.

  3. Documentation: Update the relevant Generator documentation to accurately reflect the changes introduced in the PR, ensuring users and contributors have up-to-date guidance.

  4. Comments and JSDoc: Write clear and consistent JSDoc comments for functions, including parameter types, return values, and error conditions, so others can easily understand and use the code.

  5. DRY Code: Ensure the code follows the Don't Repeat Yourself principle. Look out for duplicate logic that can be reused.

  6. Test Coverage: Ensure the new code is well-tested with meaningful test cases that pass consistently and cover all relevant edge cases.

  7. Commit History: Contributors should avoid force-pushing as much as possible. It makes it harder to track incremental changes and review the latest updates.

  8. Template Design Principles Alignment: While reviewing template-related changes in the packages/ directory, ensure they align with the Assumptions and Principles. If any principle feels outdated or no longer applicable, start a discussion these principles are meant to evolve with the project.

  9. Reduce Scope When Needed: If an issue or PR feels too large or complex, consider splitting it and creating follow-up issues. Smaller, focused PRs are easier to review and merge.

  10. Bot Comments: As reviewers, check that contributors have appropriately addressed comments or suggestions made by automated bots. If there are bot comments the reviewer disagrees with, react to them or mark them as resolved, so the review history remains clear and accurate.

@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a9893908-1333-4b56-aac5-1aec6f6675a7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6e6d05a4-0825-43fd-8ea0-bebfa634958a

📥 Commits

Reviewing files that changed from the base of the PR and between 3651e21 and 98be10c.

📒 Files selected for processing (1)
  • .github/workflows/pr-testing-with-test-project.yml

Included review availability: Your plan includes up to 4 reviews per rolling hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The pull request testing workflow now groups runs by pull request number and cancels earlier in-progress runs when a new run starts.

Changes

Pull request workflow optimization

Layer / File(s) Summary
Cancel outdated pull request runs
.github/workflows/pr-testing-with-test-project.yml
The workflow uses the pull request number as its concurrency group and cancels previous in-progress runs.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 98be1

This change only limits outdated pull-request workflow runs so newer commits receive CI feedback sooner; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR implements the linked issue's workflow concurrency objective; npm dependency caching is a separate optional optimization and is not required here.
Out of Scope Changes check ✅ Passed The changes are limited to adding concurrency control to the specified test project workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses Conventional Commits format, uses imperative wording, and clearly describes the workflow concurrency change.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@SHUBHANSHU602

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review my pr

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '=== PR metadata ==='
gh pr view 2206 --repo asyncapi/generator --json number,title,body,state,isDraft,baseRefName,headRefName,changedFiles,additions,deletions,commits

echo
echo '=== Changed files ==='
gh pr diff 2206 --repo asyncapi/generator --name-only

echo
echo '=== PR diff ==='
gh pr diff 2206 --repo asyncapi/generator -- .github/workflows/pr-testing-with-test-project.yml

echo
echo '=== Workflow outline ==='
ast-grep outline .github/workflows/pr-testing-with-test-project.yml --items all || true

echo
echo '=== Workflow content ==='
cat -n .github/workflows/pr-testing-with-test-project.yml

echo
echo '=== Existing concurrency declarations ==='
rg -n -C 4 '^\s*concurrency\s*:|cancel-in-progress|group\s*:' .github/workflows

Length of output: 2840


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '=== PR diff ==='
gh pr diff 2206 --repo asyncapi/generator

echo
echo '=== Workflow content on PR branch ==='
cat -n .github/workflows/pr-testing-with-test-project.yml

echo
echo '=== Concurrency declarations in workflows ==='
rg -n -C 4 '^\s*concurrency\s*:|cancel-in-progress|^\s+group\s*:' .github/workflows || true

echo
echo '=== Workflow trigger and job identifiers ==='
rg -n -C 3 '^(name|on|jobs)\s*:|^\s{2}(pull_request|push|workflow_dispatch)\s*:|^\s{2}[A-Za-z0-9_-]+\s*:' .github/workflows/pr-testing-with-test-project.yml

Length of output: 10496


@SHUBHANSHU602 I reviewed PR #2206.

No issues found.

The concurrency group is scoped to the pull request number. It cancels only outdated runs of this workflow for the same pull request. The configuration matches the existing pattern in .github/workflows/manual-netlify-preview.yml. The change is focused and meets the objective of #2133.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@SHUBHANSHU602

Copy link
Copy Markdown
Contributor Author

@Adi-204 ready for review

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.

ci(workflow): workflow execution optimizations

2 participants