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: instruct GoReleaser to use current tag #4044

Merged
merged 3 commits into from
Nov 22, 2024

Conversation

@rootulp rootulp self-assigned this Nov 21, 2024
@rootulp
Copy link
Collaborator Author

rootulp commented Nov 22, 2024

On my fork:

Update: if we publish multiple releases near the same time, the GoReleaser action doesn't have time to run on each release prior to all tags being published so v31.0-arabica and v3.1.0-mocha prebuilt binaries weren't attached b/c the latest tag those actions saw was v3.1.0.

Will retry testing but wait until the previous release has prebuilt binaries before creating the next release.

Needed to retry testing on a fresh commit with no release tags
@rootulp rootulp marked this pull request as ready for review November 22, 2024 17:24
@rootulp rootulp requested a review from a team as a code owner November 22, 2024 17:25
@rootulp rootulp added the backport:v3.x PR will be backported automatically to the v3.x branch upon merging label Nov 22, 2024
Copy link
Contributor

coderabbitai bot commented Nov 22, 2024

📝 Walkthrough

Walkthrough

The pull request introduces modifications to the Makefile, focusing on environment variable handling and command organization. Key updates include changing the goreleaser-check and prebuilt-binary targets to use --env for setting the CGO_ENABLED variable and incorporating the GORELEASER_CURRENT_TAG variable, which is assigned the value of GIT_TAG. Additionally, whitespace changes enhance the file's readability without altering existing functionality.

Changes

File Change Summary
Makefile Updated goreleaser-check and prebuilt-binary targets to use --env for CGO_ENABLED. Added GORELEASER_CURRENT_TAG variable. Removed trailing spaces and improved formatting.

Assessment against linked issues

Objective Addressed Explanation
Fix the underlying issue so that subsequent releases have prebuilt binaries auto attached (4033) The changes do not address the underlying issue of missing prebuilt binaries.

Possibly related PRs

Suggested labels

external, backport:v2.x

Suggested reviewers

  • staheri14
  • evan-forbes
  • cmwaters
  • ninabarbakadze

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 66699e7 and f0d0226.

📒 Files selected for processing (1)
  • Makefile (3 hunks)
🔇 Additional comments (3)
Makefile (3)

225-226: LGTM! Environment variable configuration looks correct.

The addition of GORELEASER_CURRENT_TAG=${GIT_TAG} ensures GoReleaser uses the correct tag when checking the configuration. This aligns with the PR objective of fixing missing prebuilt binaries in releases.


243-244: LGTM! Consistent environment variable handling.

The changes maintain consistency with the goreleaser-check target and ensure proper tag handling during binary creation.


Line range hint 1-24: Verify the GIT_TAG priority order matches release requirements.

The current GIT_TAG priority order is:

  1. v[0-9]+.[0-9]+.[0-9]+ (e.g., v2.2.0)
  2. v[0-9]+.[0-9]+.[0-9]+-mocha
  3. v[0-9]+.[0-9]+.[0-9]+-arabica
  4. v[0-9]+.[0-9]+.[0-9]+-rc[0-9]*
  5. v[0-9]+.[0-9]+.[0-9]+-beta
  6. v[0-9]+.[0-9]+.[0-9]+-alpha

Please verify this order aligns with your release strategy, particularly for handling -arabica and -mocha releases.

Run this script to verify tag handling:

✅ Verification successful

Let me gather more information about the release strategy by checking the repository documentation.


Let me check the actual tags in the repository to understand the versioning history and verify the priority order.


Let me check the release documentation to understand the versioning strategy.


Based on the release notes and documentation, I can now provide a final response about the tag priority order.

The GIT_TAG priority order is correct and aligns with release strategy

The current priority order in the Makefile:

  1. v[0-9]+.[0-9]+.[0-9]+ (e.g., v2.2.0)
  2. v[0-9]+.[0-9]+.[0-9]+-mocha
  3. v[0-9]+.[0-9]+.[0-9]+-arabica
  4. v[0-9]+.[0-9]+.[0-9]+-rc[0-9]*
  5. v[0-9]+.[0-9]+.[0-9]+-beta
  6. v[0-9]+.[0-9]+.[0-9]+-alpha

This order correctly reflects Celestia's versioning strategy where:

  • Clean semver tags (e.g., v2.0.0) have highest priority as they represent stable releases
  • Network-specific tags (mocha, arabica) have next priority for testnet releases
  • Pre-release tags (rc, beta, alpha) have lowest priority, following standard semver precedence
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify tag detection and priority order
# Test multiple tags pointing to the same commit

# Create a list of test tags in different orders
test_tags=(
    "v3.3.0"
    "v3.3.0-mocha"
    "v3.3.0-arabica"
    "v3.3.0-rc0"
)

# Show all tags that point to HEAD
echo "Current tags on HEAD:"
git tag --points-at HEAD

# Test tag priority logic
echo -e "\nTesting tag priority with pattern matching:"
for pattern in \
    '^v[0-9]+\.[0-9]+\.[0-9]+$' \
    '^v[0-9]+\.[0-9]+\.[0-9]+-mocha$' \
    '^v[0-9]+\.[0-9]+\.[0-9]+-arabica$' \
    '^v[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]*$'; do
    echo "Pattern: $pattern"
    git tag --points-at HEAD --sort=-v:refname | grep -E "$pattern" || echo "No matching tag"
done

Length of output: 1739


Script:

#!/bin/bash
# Check documentation for release strategy
echo "=== Checking README.md for release info ==="
fd -t f "README.md" -X cat

echo -e "\n=== Checking docs directory for release info ==="
fd -t f -e md "release" docs/ -X cat || true

echo -e "\n=== Checking for CHANGELOG.md ==="
fd -t f "CHANGELOG.md" -X cat || true

echo -e "\n=== List all tags to understand versioning history ==="
git tag -l | sort -V | tail -n 10

Length of output: 102531


Script:

#!/bin/bash
# List all tags sorted by version and filter for different types
echo "=== All tags sorted by version ==="
git tag -l | sort -V

echo -e "\n=== Mocha tags ==="
git tag -l | grep -E "v[0-9]+\.[0-9]+\.[0-9]+-mocha"

echo -e "\n=== Arabica tags ==="
git tag -l | grep -E "v[0-9]+\.[0-9]+\.[0-9]+-arabica"

echo -e "\n=== RC tags ==="
git tag -l | grep -E "v[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+"

echo -e "\n=== Beta tags ==="
git tag -l | grep -E "v[0-9]+\.[0-9]+\.[0-9]+-beta"

echo -e "\n=== Alpha tags ==="
git tag -l | grep -E "v[0-9]+\.[0-9]+\.[0-9]+-alpha"

Length of output: 641


Script:

#!/bin/bash
# Check release guide for versioning strategy
echo "=== Checking release guide ==="
cat docs/release-guide.md

echo -e "\n=== Checking release notes ==="
cat docs/release-notes/release-notes.md

# Try a different approach to list tags
echo -e "\n=== List tags with git for-each-ref ==="
git for-each-ref --sort=creatordate --format '%(refname:short)' refs/tags/

Length of output: 4780


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.

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 for fixing!

I'm good with testing this in prod too

@rootulp rootulp merged commit 63c1e07 into celestiaorg:main Nov 22, 2024
33 of 34 checks passed
@rootulp rootulp deleted the rp/goreleaser-current-tag branch November 22, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:v3.x PR will be backported automatically to the v3.x branch upon merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prebuilt binaries are missing from -arabica and -mocha releases
3 participants