Skip to content

fix: skipped stable tag for pre-relrease#5570

Merged
sriramveeraghanta merged 1 commit intopreviewfrom
fix/branch-build-action
Sep 10, 2024
Merged

fix: skipped stable tag for pre-relrease#5570
sriramveeraghanta merged 1 commit intopreviewfrom
fix/branch-build-action

Conversation

@mguptahub
Copy link
Collaborator

@mguptahub mguptahub commented Sep 10, 2024

  • Skip creating stable tag for pre-releases
  • updated the docker image tags for internal branches. e.g for a branch name as fix/branch-build-action will create a docker tag as fix-branch-build-action

Summary by CodeRabbit

  • New Features

    • Introduced an optional input for ARM64 architecture builds in the workflow, enhancing build flexibility.
    • Added logic to manage Docker image tagging based on branch names and release status, improving tagging consistency.
  • Improvements

    • Enhanced the build process for better handling of ARM64 architecture and refined Docker tagging logic for stable releases.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 10, 2024

Walkthrough

The pull request introduces enhancements to the GitHub Actions workflow in build-branch.yml. It adds an optional input parameter for ARM64 architecture builds, modifies environment variable settings based on this input, and sanitizes branch names for Docker tagging. Additionally, it refines the logic for Docker tags in release events by including a check for the IS_PRERELEASE variable. These changes improve the build process's flexibility and consistency, particularly for ARM64 builds and Docker image tagging.

Changes

Files Change Summary
.github/workflows/build-branch.yml Added inputs.arm64, ARM64_BUILD, and IS_PRERELEASE; renamed gh_branch_name to flat_branch_name.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GitHub Actions
    participant Docker Registry

    User->>GitHub Actions: Trigger build with arm64 input
    GitHub Actions->>GitHub Actions: Set ARM64_BUILD based on input
    GitHub Actions->>GitHub Actions: Sanitize TARGET_BRANCH to flat_branch_name
    GitHub Actions->>Docker Registry: Build and tag Docker image with flat_branch_name
    GitHub Actions->>Docker Registry: Push Docker image
Loading

🐰 "In the meadow, changes bloom,
ARM64 builds dispel the gloom.
Tags are tidy, names are neat,
A workflow that can't be beat!
With each hop, we celebrate,
A brighter build, oh, how great!" 🌼

Tip

Review status comment

The review status is no longer posted as a separate comment when there are no actionable or nitpick comments. In such cases, the review status is included in the walkthrough comment.


New review model

We have updated our review workflow to use the Anthropic's Claude family of models. Please share any feedback in the discussion post on our Discord.


New features

Walkthrough comment now includes:

  • Possibly related PRs: A list of potentially related PRs to help you recall past context.
  • Suggested labels: CodeRabbit can now suggest labels by learning from your past PRs. You can also provide custom labeling instructions in the UI or configuration file.

Notes:

  • Please share any feedback in the discussion post on our Discord.
  • Possibly related PRs, automatic label suggestions based on past PRs, learnings, and possibly related issues require data opt-in (enabled by default).

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7c77fc1 and 94933ed.

Files selected for processing (1)
  • .github/workflows/build-branch.yml (16 hunks)
Additional context used
actionlint
.github/workflows/build-branch.yml

44-44: shellcheck reported issue in this script: SC2235:style:1:92: Use { ..; } instead of (..) to avoid subshell overhead

(shellcheck)


44-44: shellcheck reported issue in this script: SC2129:style:2:3: Consider using { cmd1; cmd2; } >> file instead of individual redirects

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:2:33: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:3:39: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:4:54: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:5:49: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2129:style:7:3: Consider using { cmd1; cmd2; } >> file instead of individual redirects

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:7:44: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:8:35: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:9:42: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:10:30: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:12:50: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:14:48: Double quote to prevent globbing and word splitting

(shellcheck)

Additional comments not posted (5)
.github/workflows/build-branch.yml (5)

5-10: LGTM!

The addition of the arm64 input parameter to the workflow_dispatch event enhances the flexibility of the workflow by allowing users to specify whether to build for the ARM64 architecture when manually triggering the workflow.


20-21: LGTM!

The addition of the ARM64_BUILD and IS_PRERELEASE environment variables enhances the workflow's adaptability and control over the build process.

  • Setting the ARM64_BUILD environment variable based on the arm64 input allows the workflow to adapt based on whether the ARM64 build is requested.
  • Setting the IS_PRERELEASE environment variable based on the prerelease property of the release event allows the workflow to determine if the release is a pre-release.

39-39: LGTM!

The introduction of the flat_branch_name output variable in the branch_build_setup job ensures that the Docker image tags are consistent and correctly formatted by sanitizing the branch name. This change enhances the clarity and reliability of the tags.

Also applies to: 57-58


108-108: LGTM!

The changes in the Docker tag setting steps for each job enhance the clarity, reliability, and control over versioning and tagging of Docker images.

  • Using flat_branch_name instead of gh_branch_name for Docker image tagging enhances the clarity and reliability of the tags.
  • Refining the logic for setting Docker tags in the release event to include a check for the IS_PRERELEASE variable ensures that stable tags are only added when appropriate. This change enhances the control over versioning and tagging of Docker images based on the release status.

Also applies to: 118-121, 164-164, 174-177, 220-220, 230-233, 276-276, 286-289, 332-332, 342-345, 388-388, 398-401


Line range hint 1-438: Overall, the changes look good to me!

The changes proposed in this pull request focus on improving the tagging strategy for both releases and Docker images within the project. The modifications enhance the flexibility, robustness, clarity, and control over the build process and versioning of Docker images.

Great job on the improvements! Let me know if you have any further questions or concerns.

Tools
actionlint

44-44: shellcheck reported issue in this script: SC2235:style:1:92: Use { ..; } instead of (..) to avoid subshell overhead

(shellcheck)


44-44: shellcheck reported issue in this script: SC2129:style:2:3: Consider using { cmd1; cmd2; } >> file instead of individual redirects

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:2:33: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:3:39: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:4:54: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:5:49: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2129:style:7:3: Consider using { cmd1; cmd2; } >> file instead of individual redirects

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:7:44: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:8:35: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:9:42: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:10:30: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:12:50: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:14:48: Double quote to prevent globbing and word splitting

(shellcheck)


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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

@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: 0

Outside diff range, codebase verification and nitpick comments (1)
.github/workflows/build-branch.yml (1)

Line range hint 45-56: LGTM, but address the shellcheck hints.

The modifications to the control flow in the set_env_variables step allow the workflow to adapt based on whether the ARM64 build is requested and the release status. This change enhances the flexibility and robustness of the build process.

To address the shellcheck hints and improve the script's quality, apply the following changes:

- if [ "${{ env.TARGET_BRANCH }}" == "master" ] || [ "${{ env.ARM64_BUILD }}" == "true" ] || ([ "${{ github.event_name }}" == "release" ] && [ "${{ env.IS_PRERELEASE }}" != "true" ]); then
+ if [ "${{ env.TARGET_BRANCH }}" == "master" ] || [ "${{ env.ARM64_BUILD }}" == "true" ] || { [ "${{ github.event_name }}" == "release" ] && [ "${{ env.IS_PRERELEASE }}" != "true" ]; }; then
-   echo "BUILDX_DRIVER=cloud" >> $GITHUB_OUTPUT
-   echo "BUILDX_VERSION=lab:latest" >> $GITHUB_OUTPUT
-   echo "BUILDX_PLATFORMS=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
-   echo "BUILDX_ENDPOINT=makeplane/plane-dev" >> $GITHUB_OUTPUT
+   {
+     echo "BUILDX_DRIVER=cloud"
+     echo "BUILDX_VERSION=lab:latest"
+     echo "BUILDX_PLATFORMS=linux/amd64,linux/arm64"
+     echo "BUILDX_ENDPOINT=makeplane/plane-dev"
+   } >> $GITHUB_OUTPUT
  else
-   echo "BUILDX_DRIVER=docker-container" >> $GITHUB_OUTPUT
-   echo "BUILDX_VERSION=latest" >> $GITHUB_OUTPUT
-   echo "BUILDX_PLATFORMS=linux/amd64" >> $GITHUB_OUTPUT
-   echo "BUILDX_ENDPOINT=" >> $GITHUB_OUTPUT
+   {
+     echo "BUILDX_DRIVER=docker-container"
+     echo "BUILDX_VERSION=latest"
+     echo "BUILDX_PLATFORMS=linux/amd64"
+     echo "BUILDX_ENDPOINT="
+   } >> $GITHUB_OUTPUT
  fi
Tools
actionlint

44-44: shellcheck reported issue in this script: SC2235:style:1:92: Use { ..; } instead of (..) to avoid subshell overhead

(shellcheck)


44-44: shellcheck reported issue in this script: SC2129:style:2:3: Consider using { cmd1; cmd2; } >> file instead of individual redirects

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:2:33: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:3:39: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:4:54: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:5:49: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2129:style:7:3: Consider using { cmd1; cmd2; } >> file instead of individual redirects

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:7:44: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:8:35: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:9:42: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:10:30: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:12:50: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:14:48: Double quote to prevent globbing and word splitting

(shellcheck)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7c77fc1 and 94933ed.

Files selected for processing (1)
  • .github/workflows/build-branch.yml (16 hunks)
Additional context used
actionlint
.github/workflows/build-branch.yml

44-44: shellcheck reported issue in this script: SC2235:style:1:92: Use { ..; } instead of (..) to avoid subshell overhead

(shellcheck)


44-44: shellcheck reported issue in this script: SC2129:style:2:3: Consider using { cmd1; cmd2; } >> file instead of individual redirects

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:2:33: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:3:39: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:4:54: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:5:49: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2129:style:7:3: Consider using { cmd1; cmd2; } >> file instead of individual redirects

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:7:44: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:8:35: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:9:42: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:10:30: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:12:50: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:14:48: Double quote to prevent globbing and word splitting

(shellcheck)

Additional comments not posted (5)
.github/workflows/build-branch.yml (5)

5-10: LGTM!

The addition of the arm64 input parameter to the workflow_dispatch event enhances the flexibility of the workflow by allowing users to specify whether to build for the ARM64 architecture when manually triggering the workflow.


20-21: LGTM!

The addition of the ARM64_BUILD and IS_PRERELEASE environment variables enhances the workflow's adaptability and control over the build process.

  • Setting the ARM64_BUILD environment variable based on the arm64 input allows the workflow to adapt based on whether the ARM64 build is requested.
  • Setting the IS_PRERELEASE environment variable based on the prerelease property of the release event allows the workflow to determine if the release is a pre-release.

39-39: LGTM!

The introduction of the flat_branch_name output variable in the branch_build_setup job ensures that the Docker image tags are consistent and correctly formatted by sanitizing the branch name. This change enhances the clarity and reliability of the tags.

Also applies to: 57-58


108-108: LGTM!

The changes in the Docker tag setting steps for each job enhance the clarity, reliability, and control over versioning and tagging of Docker images.

  • Using flat_branch_name instead of gh_branch_name for Docker image tagging enhances the clarity and reliability of the tags.
  • Refining the logic for setting Docker tags in the release event to include a check for the IS_PRERELEASE variable ensures that stable tags are only added when appropriate. This change enhances the control over versioning and tagging of Docker images based on the release status.

Also applies to: 118-121, 164-164, 174-177, 220-220, 230-233, 276-276, 286-289, 332-332, 342-345, 388-388, 398-401


Line range hint 1-438: Overall, the changes look good to me!

The changes proposed in this pull request focus on improving the tagging strategy for both releases and Docker images within the project. The modifications enhance the flexibility, robustness, clarity, and control over the build process and versioning of Docker images.

Great job on the improvements! Let me know if you have any further questions or concerns.

Tools
actionlint

44-44: shellcheck reported issue in this script: SC2235:style:1:92: Use { ..; } instead of (..) to avoid subshell overhead

(shellcheck)


44-44: shellcheck reported issue in this script: SC2129:style:2:3: Consider using { cmd1; cmd2; } >> file instead of individual redirects

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:2:33: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:3:39: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:4:54: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:5:49: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2129:style:7:3: Consider using { cmd1; cmd2; } >> file instead of individual redirects

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:7:44: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:8:35: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:9:42: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:10:30: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:12:50: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:14:48: Double quote to prevent globbing and word splitting

(shellcheck)

@sriramveeraghanta sriramveeraghanta merged commit 1da97d5 into preview Sep 10, 2024
@mguptahub mguptahub deleted the fix/branch-build-action branch April 30, 2025 06:56
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.

2 participants