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

Add version command #298

Open
2 tasks
dfarr opened this issue Apr 24, 2024 · 7 comments
Open
2 tasks

Add version command #298

dfarr opened this issue Apr 24, 2024 · 7 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@dfarr
Copy link
Member

dfarr commented Apr 24, 2024

It would be nice to see the version of resonate I have installed locally.

resonate --version

The version is tied to the git tag and can be set via build flags in our release pipeline, we should assert that the git tag matches the version in our release pipeline.

  • set tag in release pipeline
  • assert git tag matches resonate --version
@flossypurse
Copy link
Contributor

Version can be derived from the Git Tag, but not necessarily required for the mvp.

@rishirishhh
Copy link

kindly assign this to me

@flossypurse
Copy link
Contributor

@rishirishhh - don't hesitate to reach out for any clarification or to chat about requirements and/or design!

@flossypurse
Copy link
Contributor

@rishirishhh - are you still interested in working on this?
If so, I highly recommend joining the Discord: https://resonatehq.io/discord and jump into the resonate-engineering channel to get any help you might need.

@fuadnafiz98
Copy link

Hi,
Can I work on this PR?

I already see this opened PR: #342

Is this still going? Can I take inspiration from this code or this solution is not valid?

@dfarr
Copy link
Member Author

dfarr commented Dec 19, 2024

Just closed that PR for being stale.

I think we can take inspiration from the ldflags, but simplify things a little bit. Here's what I'm thinking.

Add the following to the root command:

var (
	cfgFile string
	version string = "unknown"
)

var rootCmd = &cobra.Command{
	Use:     "resonate",
	Short:   "Resonate: distributed async await",
	Version: version,
}

Then we can build resonate with an ldflag like this:

go build -ldflags "-X github.com/resonatehq/resonate/cmd.version=SET_VIA_LDFLAGS" -o resonate
./resonate --version

Most of the work will involve updating the build scripts to set the version accordingly. What do you think about the following strategy?

  1. Use git tag if available (eg: "v1.0.0")
  2. Otherwise use commit (eg: "cc66e5135531111757c3e28f0a6fc053bc7c8fa8")
  3. Otherwise, fall back to "unknown"

@fuadnafiz98
Copy link

Hi,
I think it makes sense.

I will look into this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

4 participants