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: set version during build process for op-node,batcher,proposer #10087

Merged
merged 3 commits into from
Apr 9, 2024

Conversation

bitwiseguy
Copy link
Contributor

@bitwiseguy bitwiseguy commented Apr 9, 2024

Description

Dynamically set the VERSION within the Makefile by looking up the latest git tag that points-at the commit hash on the current branch. If no tags are found, the VERSION string will be set to untagged. If multiple tags are found, prioritize the release tag, if one exists, otherwise use the latest tag suffixed with -rc.X.

Previously the VERSION was hardcoded to "v0.0.0".

Tests

No tests are currently part of this PR. I manually tested the Makefiles. Please let me know if there is a standard way to test Makefile commands.

Manual test procedure:

cd op-node
make op-node
./bin/op-node --version

Metadata

Summary by CodeRabbit

Summary by CodeRabbit

  • Chores
    • Improved version determination in Makefiles to dynamically fetch the latest GitHub tag or default to "untagged."

@bitwiseguy bitwiseguy requested a review from a team as a code owner April 9, 2024 20:26
@bitwiseguy bitwiseguy requested a review from axelKingsley April 9, 2024 20:26
Copy link
Contributor

coderabbitai bot commented Apr 9, 2024

Walkthrough

The recent update simplifies version determination across op-batcher, op-node, and op-proposer Makefiles. The version is now dynamically fetched from the latest GitHub tag associated with the commit, falling back to "untagged" if no tag is available. This enhancement ensures accurate versioning and eases maintenance tasks.

Changes

Files Change Summary
op-batcher/Makefile
op-node/Makefile
op-proposer/Makefile
Dynamic version determination based on the latest GitHub tag, with "untagged" as the default if no tag is present.

Recent Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between eddc451 and 42523d3.
Files selected for processing (3)
  • op-batcher/Makefile (1 hunks)
  • op-node/Makefile (1 hunks)
  • op-proposer/Makefile (1 hunks)
Files skipped from review as they are similar to previous changes (3)
  • op-batcher/Makefile
  • op-node/Makefile
  • op-proposer/Makefile

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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

@trianglesphere
Copy link
Contributor

I don't think that we want to look back for the tag as anything during the build would have the tag. Ideally it'd see if the current commit is the tag & if so, would use that.

When we build docker images for our release process, we used to override the version to the commit at the build step (i.e. before make got invoked). This is nice though because it means that local builds on the release commit will get tagged correctly

op-batcher/Makefile Outdated Show resolved Hide resolved
@trianglesphere
Copy link
Contributor

trianglesphere commented Apr 9, 2024

Testing this on git tag --points-at c87a469d7d679e8a4efbace56c3646b925bcc009 | grep '^op-node/' | sort -V | tail -n 1 | sed 's/op-node\///' returns v1.7.1-rc.1 when we should return v1.7.1 - basically we usually re-tag the final RC as the release

Update: It seems that OSX's version of sort -V isn't handling RC's well.

Copy link
Contributor

@trianglesphere trianglesphere left a comment

Choose a reason for hiding this comment

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

I think this looks good. TY for fixing it

@trianglesphere trianglesphere enabled auto-merge April 9, 2024 21:19
@trianglesphere trianglesphere added this pull request to the merge queue Apr 9, 2024
Merged via the queue into develop with commit c2135f1 Apr 9, 2024
69 checks passed
@trianglesphere trianglesphere deleted the bitwise/build-versions branch April 9, 2024 21:50
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