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

feat: build on network tags and manual dispatch #3905

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

smuu
Copy link
Member

@smuu smuu commented Sep 25, 2024

This PR add two features:

  1. Allow docker to trigger on network specific tags.
  2. This PR shows how to use the new input for the docker ci workflow added in feat: add checkout ref to support building from a specific ref manually .github#112
    This would allow triggering the docker workflow on a tag that (such as the new arabica and mocha tags) that didn't trigger the workflow originally.

Ref:

@smuu smuu requested a review from a team as a code owner September 25, 2024 08:03
@smuu smuu requested review from rootulp and rach-id and removed request for a team September 25, 2024 08:03
Copy link
Contributor

coderabbitai bot commented Sep 25, 2024

📝 Walkthrough

Walkthrough

The pull request introduces updates to the GitHub Actions workflow file .github/workflows/docker-build-publish.yml. It adds new tag patterns for versioning, specifically for -arabica and -mocha versions. The workflow now supports a workflow_dispatch event with a required input parameter named ref, which allows specifying the checkout reference. Additionally, the version of the reusable Dockerfile pipeline has been incremented from v0.4.3 to v0.4.4.

Changes

File Change Summary
.github/workflows/docker-build-publish.yml - Added input parameter ref (string, required) in workflow_dispatch section.
- Added tag patterns: v[0-9]+.[0-9]+.[0-9]+-arabica and v[0-9]+.[0-9]+.[0-9]+-mocha in on.push.tags.
- Updated version from v0.4.3 to v0.4.4 for the reusable Dockerfile pipeline in two job definitions.

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:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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.

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.

@celestia-bot celestia-bot requested a review from a team September 25, 2024 08:03
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 and nitpick comments (2)
.github/workflows/docker-build-publish.yml (2)

16-17: LGTM! Consider adding comments for clarity.

The addition of -arabica and -mocha tag patterns aligns well with the PR objectives, allowing for network-specific triggering of the Docker CI workflow. This change provides more granular control over the workflow execution.

Consider adding a comment above these new patterns to explain their purpose, e.g.:

      # Network-specific version tags
      - "v[0-9]+.[0-9]+.[0-9]+-arabica"
      - "v[0-9]+.[0-9]+.[0-9]+-mocha"

This would improve readability and maintainability of the workflow file.


19-24: LGTM! Consider adding input validation.

The addition of the workflow_dispatch event with the ref input aligns perfectly with the PR objectives, allowing for manual triggering of the workflow with a specific reference. This enhances the workflow's flexibility and user control.

Consider adding input validation for the ref parameter to ensure it matches expected patterns. You can use the pattern property in the input definition. For example:

    inputs:
      ref:
        description: "The checkout reference (ie tag, branch, sha)"
        required: true
        type: string
        pattern: '^(v\d+\.\d+\.\d+(-\w+)?|[0-9a-f]{40}|[a-zA-Z0-9_.-]+)$'

This pattern allows for version tags, full SHA hashes, and branch names, providing an additional layer of input validation.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between af38e41 and 2ae48a9.

📒 Files selected for processing (1)
  • .github/workflows/docker-build-publish.yml (2 hunks)
🔇 Additional comments not posted (1)
.github/workflows/docker-build-publish.yml (1)

31-31: LGTM! Verify compatibility with the new version.

Updating the reusable Dockerfile pipeline version from v0.4.3 to v0.4.4 is a good practice to ensure the latest features and bug fixes are utilized. The update is consistently applied to both job definitions.

Please ensure that v0.4.4 of the reusable workflow is compatible with the current workflow and doesn't introduce any breaking changes. You can verify this by checking the changelog or release notes of the celestiaorg/.github repository.

To assist with this verification, you can run the following script:

Please review the output to ensure there are no breaking changes that could affect this workflow.

Also applies to: 40-40

✅ Verification successful

Verified: The update to v0.4.4 for the reusable Dockerfile pipeline is compatible and introduces no breaking changes.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Fetch the changelog or release notes for the reusable workflow

# Fetch the latest release information
gh release view v0.4.4 -R celestiaorg/.github

# If the above doesn't provide enough information, you can also check the commit history
echo "Commit history between v0.4.3 and v0.4.4:"
gh release view v0.4.4 -R celestiaorg/.github --json body | jq -r '.body'

Length of output: 1161

Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

thanks!

@rootulp rootulp merged commit 00805f0 into celestiaorg:main Sep 25, 2024
33 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants