Skip to content
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

fix: Cut release only when all tests passed #721

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

goruha
Copy link
Member

@goruha goruha commented Oct 14, 2024

what

  • Run release job only if all tests passed

why

  • Do not release failed binaries

references

Summary by CodeRabbit

  • New Features

    • Reintroduced an automated release job that enhances the deployment process, triggered on push events.
  • Bug Fixes

    • Corrected indentation and structure in the Docker job for improved workflow execution.

@goruha goruha requested review from a team as code owners October 14, 2024 17:52
Copy link
Contributor

coderabbitai bot commented Oct 14, 2024

📝 Walkthrough

Walkthrough

The changes introduce a new release job to the GitHub Actions workflow in .github/workflows/test.yml. This job depends on several other jobs and is triggered by push events. It utilizes a shared workflow for automated releases and includes specific parameters for publishing and formatting. The overall structure of the workflow remains intact, with the release job positioned to execute after the completion of the specified dependencies.

Changes

File Path Change Summary
.github/workflows/test.yml Added release job with dependencies on test, lint, mock, k3s, localstack, and docker.

Poem

In the workflow's dance, a new job takes flight,
With tests and releases, all shining so bright.
The docker's now tidy, aligned just right,
A rabbit's delight in the code's joyful sight! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between f7e5242 and 0993219.

📒 Files selected for processing (1)
  • .github/workflows/test.yml (1 hunks)
🧰 Additional context used
🪛 yamllint
.github/workflows/test.yml

[error] 332-332: too many blank lines

(1 > 0) (empty-lines)

🔇 Additional comments (2)
.github/workflows/test.yml (2)

324-331: LGTM! The release job configuration aligns with the PR objective.

The job configuration effectively ensures that releases only happen after all tests pass by:

  1. Depending on all test jobs (test, lint, mock, k3s, localstack, docker)
  2. Running only on push events
  3. Using the shared release workflow with appropriate settings

332-332: ⚠️ Potential issue

Remove extra blank lines at the end of the file.

To maintain clean YAML formatting, remove the extra blank lines at the end of the file, leaving only one blank line.

Apply this diff:

  release:
    needs: [test, lint, mock, k3s, localstack, docker]
    if: github.event_name == 'push'
    uses: cloudposse/.github/.github/workflows/shared-go-auto-release.yml@main
    with:
      publish: false
      format: binary
    secrets: inherit
-

Likely invalid or redundant comment.

🧰 Tools
🪛 yamllint

[error] 332-332: too many blank lines

(1 > 0) (empty-lines)


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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 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

@kevcube kevcube left a comment

Choose a reason for hiding this comment

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

seems like a good idea

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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between 94e0226 and f7e5242.

📒 Files selected for processing (1)
  • .github/workflows/test.yml (1 hunks)
🧰 Additional context used
🪛 yamllint
.github/workflows/test.yml

[error] 332-332: too many blank lines

(1 > 0) (empty-lines)

🔇 Additional comments (1)
.github/workflows/test.yml (1)

324-332: Summary: The PR successfully implements the release job with minor suggestions for improvement.

The addition of the release job successfully addresses the PR objective of cutting a release only when all tests have passed. The job is well-structured and integrated with the existing workflow. A few minor suggestions have been made to improve clarity and adhere to best practices:

  1. Verify the publish: false setting.
  2. Add a comment explaining the purpose of the release job.
  3. Remove extra blank lines at the end of the file.

These suggestions are minor and do not prevent the PR from being merged. Overall, the implementation looks good and achieves the desired outcome.

🧰 Tools
🪛 yamllint

[error] 332-332: too many blank lines

(1 > 0) (empty-lines)

.github/workflows/test.yml Show resolved Hide resolved
.github/workflows/test.yml Show resolved Hide resolved
@kevcube
Copy link
Contributor

kevcube commented Oct 16, 2024

I also feel that there isn't a huge need to require tests to pass before releases happen - instead, tests should be required for any PR merge. If tests are deterministic, which I expect them to be, then all code in main should pass tests if every PR must pass tests, and then releases can happen more promptly post-merge. But that's outside of scope for what this PR needs to fix, just voicing my opinion on it.

@aknysh aknysh added minor New features that do not break anything no-release Do not create a new release (wait for additional code changes) and removed minor New features that do not break anything labels Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-release Do not create a new release (wait for additional code changes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants