8000 [ci] automatically trigger tests in releasing PR by kvaps · Pull Request #894 · cozystack/cozystack · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[ci] automatically trigger tests in releasing PR #894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2025
Merged

Conversation

kvaps
Copy link
Member
@kvaps kvaps commented Apr 25, 2025

Signed-off-by: Andrei Kvapil kvapss@gmail.com

Summary by CodeRabbit

  • New Features
    • Added the ability to manually trigger the release verification workflow with a specific commit SHA.
    • The release verification workflow now supports both pull request events and manual triggers.
  • Chores
    • Automated triggering of release verification tests from the tags workflow when a new release is detected.

@kvaps kvaps requested review from lllamnyp and klinch0 as code owners April 25, 2025 10:52
Copy link
Contributor
coderabbitai bot commented Apr 25, 2025

Warning

Rate limit exceeded

@kvaps has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 32 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 90af26f and a29040f.

📒 Files selected for processing (2)
  • .github/workflows/pull-requests-release.yaml (2 hunks)
  • .github/workflows/tags.yaml (1 hunks)

Walkthrough

This update introduces the ability to manually trigger the pull-requests-release.yaml workflow via the workflow_dispatch event, requiring a commit SHA as input. The workflow's conditional logic is updated to support both manual and automatic triggering. Additionally, the tags.yaml workflow is enhanced to programmatically trigger the pull-requests-release.yaml workflow after a tag is processed, passing the relevant SHA. No other workflow steps or error handling mechanisms are changed.

Changes

File(s) Change Summary
.github/workflows/pull-requests-release.yaml Added manual workflow_dispatch trigger with required sha input; updated job conditions and checkout logic.
.github/workflows/tags.yaml Added step to trigger pull-requests-release.yaml via workflow dispatch, passing the current commit SHA.

Sequence Diagram(s)

sequenceDiagram
    participant TagWorkflow as tags.yaml
    participant GHAPI as GitHub Actions API
    participant PRReleaseWorkflow as pull-requests-release.yaml

    TagWorkflow->>GHAPI: Trigger workflow_dispatch (with sha input)
    GHAPI->>PRReleaseWorkflow: Start workflow (using provided sha)
    PRReleaseWorkflow->>PRReleaseWorkflow: Run verify job on specified commit
Loading

Possibly related PRs

  • [ci] get rid of ok-to-test label #875: Both PRs modify the conditional logic controlling when the "verify" job runs in the .github/workflows/pull-requests-release.yaml workflow, with the main PR adding manual trigger support and the retrieved PR removing the "ok-to-test" label requirement.

Suggested labels

backport

Suggested reviewers

  • lllamnyp
  • klinch0

Poem

The workflows now can dance and play,
Triggered by hand or tags today!
With SHAs in tow, they leap and run,
Verifying code until it's done.
A rabbit cheers, with hops so spry—
"Automation magic, oh my oh my!"
🐇✨


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor
@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

🧹 Nitpick comments (1)
.github/workflows/tags.yaml (1)

231-233: Refine YAML key spacing.

YAMLlint reports “too many spaces after colon” on these mappings. Normalize to a single space after each colon to satisfy lint rules:

-  GH_TOKEN:       ${{ secrets.GITHUB_TOKEN }}
-  DISPATCH_REF:   ${{ steps.get_base.outputs.branch }}
-  DISPATCH_SHA:   ${{ github.sha }}
+  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+  DISPATCH_REF: ${{ steps.get_base.outputs.branch }}
+  DISPATCH_SHA: ${{ github.sha }}
🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 231-231: too many spaces after colon

(colons)


[warning] 232-232: too many spaces after colon

(colons)


[warning] 233-233: too many spaces after colon

(colons)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fcc7056 and 90af26f.

📒 Files selected for processing (2)
  • .github/workflows/pull-requests-release.yaml (2 hunks)
  • .github/workflows/tags.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/tags.yaml

[warning] 231-231: too many spaces after colon

(colons)


[warning] 232-232: too many spaces after colon

(colons)


[warning] 233-233: too many spaces after colon

(colons)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build and Test
🔇 Additional comments (4)
.github/workflows/tags.yaml (1)

226-247: Automate dispatch of verify tests on new release tags.

This step correctly invokes the pull-requests-release.yaml workflow via a dispatch event on the target branch (DISPATCH_REF), passing the commit SHA (DISPATCH_SHA) to run the verification tests on the release commit. It integrates neatly with the existing tagging flow to ensure tests are run after a tag is published.

🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 231-231: too many spaces after colon

(colons)


[warning] 232-232: too many spaces after colon

(colons)


[warning] 233-233: too many spaces after colon

(colons)

.github/workflows/pull-requests-release.yaml (3)

6-11: Enable manual triggering with workflow_dispatch.

Adding workflow_dispatch with a required sha input allows ad-hoc invocation of the release tests on any commit SHA. This complements the PR-label trigger and gives maintainers the flexibility to re-run or debug tests outside of PR events.


24-30: Combine PR label and manual dispatch conditions.

The updated if expression correctly gates the verify job to run when the PR is labeled release (and not closed) or when invoked via workflow_dispatch. This ensures coverage in both scenarios.


35-37: Checkout specific SHA based on trigger.

The boolean expression selects pull_request.head.sha for labeled PRs or falls back to inputs.sha for manual dispatch, ensuring the correct commit is checked out in both workflows.

Comment on lines +6 to 11
workflow_dispatch:
inputs:
sha:
description: "Commit SHA to test"
required: true

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Concurrency group may break for manual triggers.

The existing concurrency group uses github.event.pull_request.number, which is undefined for workflow_dispatch events and could lead to errors or unintended queuing.

Consider a fallback for dispatch triggers, for example:

-concurrency:
-  group: pull-requests-release-${{ github.workflow }}-${{ github.event.pull_request.number }}
+concurrency:
+  group: pull-requests-release-${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
  cancel-in-progress: true

Committable suggestion skipped: line range outside the PR's diff.

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@kvaps kvaps merged commit fa341de into main Apr 25, 2025
6 checks passed
@kvaps kvaps deleted the ci-auto-tests branch April 25, 2025 12:00
kvaps added a commit that referenced this pull request Apr 25, 2025
Revert #894 due to fact this
logic does not trigger checks in pull requests

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Removed support for manually triggering the pull request release
workflow.
- Simplified release workflow to run automatically only on labeled pull
requests.
- Eliminated the step in the tags workflow that triggered release
verification via manual dispatch.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
lllamnyp pushed a commit that referenced this pull request May 20, 2025
Revert #894 due to fact this
logic does not trigger checks in pull requests

<!-- This is
7D2A
 an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Removed support for manually triggering the pull request release
workflow.
- Simplified release workflow to run automatically only on labeled pull
requests.
- Eliminated the step in the tags workflow that triggered release
verification via manual dispatch.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

(cherry picked from commit e1c1461)
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
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
0