Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

cmd: add version command #51

Merged
merged 1 commit into from
Jan 11, 2024
Merged

cmd: add version command #51

merged 1 commit into from
Jan 11, 2024

Conversation

tuxcanfly
Copy link
Collaborator

@tuxcanfly tuxcanfly commented Jan 11, 2024

Overview

This PR adds a version command Fixes #48

Checklist

  • New and updated code has appropriate documentation
  • New and updated code has new and/or updated testing
  • Required CI checks are passing
  • Visual proof for any user facing features like CLI or documentation updates
  • Linked issues closed with keywords

Summary by CodeRabbit

  • New Features

    • Introduced version information command to display build details for celestia-da.
  • Enhancements

    • Updated build process with a more descriptive message.

Copy link

coderabbitai bot commented Jan 11, 2024

Walkthrough

The project has evolved to manage its versioning independently from celestia-node, reflecting its growth and the emergence of distinct release cycles. A new command has been added to display the version of celestia-da alongside the version of celestia-node, ensuring clarity and transparency for users regarding the build they are operating.

Changes

File Change Summary
Makefile Modified echo message in build target and added -ldflags option to include nodeVersion using go list command.
cmd/celestia-da/main.go Added versionCmd to rootCmd
cmd/celestia-da/version.go Introduced version display functionality to extract build information from ldflags and display details about the current binary build.

Assessment against linked issues

Objective Addressed Explanation
Independent versioning for celestia-da starting from v0.13.x (#48)
Addition of a version command to output celestia-da and celestia-node versions (#48)

Poem

In the realm of code, where binaries abide,
A rabbit hopped forth, with versioning pride.
"Celestia-da!" it cheered, no longer in node's shade,
Independent in version, a new era it made. 🌟🐇

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

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

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 0d72059 and 02318b1.
Files selected for processing (3)
  • Makefile (1 hunks)
  • cmd/celestia-da/main.go (1 hunks)
  • cmd/celestia-da/version.go (1 hunks)
Additional comments: 5
cmd/celestia-da/main.go (1)
  • 34-34: The addition of versionCmd to rootCmd is correctly implemented and follows the established pattern for adding new commands.
Makefile (1)
  • 13-13: The update to the build message in the Makefile is correct and reflects the new build process for celestia-da.
cmd/celestia-da/version.go (3)
  • 46-51: The buildInfo struct is well-defined and matches the expected fields populated by the Makefile's ldflags.

  • 53-92: The extractBuildInfo function parses the ldflags string correctly. However, the keys used in the switch statement (e.g., .buildTime) should match the actual keys set in the Makefile's ldflags. Verify that the keys are consistent.

  • 95-117: The versionCmd command and printBuildInfo function are correctly implemented. Ensure that the output format of the version information is consistent with the project's standards.

cmd/celestia-da/version.go Outdated Show resolved Hide resolved
cmd/celestia-da/version.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jan 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a824137) 73.02% compared to head (59fc6c7) 73.02%.

❗ Current head 59fc6c7 differs from pull request most recent head 789f83c. Consider uploading reports for the commit 789f83c to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #51   +/-   ##
=======================================
  Coverage   73.02%   73.02%           
=======================================
  Files           2        2           
  Lines         152      152           
=======================================
  Hits          111      111           
  Misses         28       28           
  Partials       13       13           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 02318b1 and 2c7b128.
Files ignored due to filter (1)
  • go.mod
Files selected for processing (1)
  • cmd/celestia-da/version.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • cmd/celestia-da/version.go

Copy link

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 0d72059 and aea3dd8.
Files ignored due to filter (1)
  • go.mod
Files selected for processing (3)
  • Makefile (2 hunks)
  • cmd/celestia-da/main.go (1 hunks)
  • cmd/celestia-da/version.go (1 hunks)
Files skipped from review as they are similar to previous changes (3)
  • Makefile
  • cmd/celestia-da/main.go
  • cmd/celestia-da/version.go

go mod tidy

cmd: version command cleanup
Copy link

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a824137 and 789f83c.
Files selected for processing (3)
  • Makefile (2 hunks)
  • cmd/celestia-da/main.go (1 hunks)
  • cmd/celestia-da/version.go (1 hunks)
Files skipped from review as they are similar to previous changes (3)
  • Makefile
  • cmd/celestia-da/main.go
  • cmd/celestia-da/version.go

@tuxcanfly tuxcanfly merged commit 8e29d28 into main Jan 11, 2024
14 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feature Request]: new release cycle and versioning
3 participants