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

read module version info from golang runtime #856

Merged
merged 2 commits into from
Oct 2, 2022

Conversation

pgier
Copy link
Contributor

@pgier pgier commented Sep 30, 2022

Motivation

Instead of maintaining a hard coded version string in the sources, we can get the version of the pulsar-client-go module used to build the client application.

Modifications

Removed the hard coded version string and replaced it with code that runs at initialization to look up the version of the client golang module dependency that was used to build the app.

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

@pgier pgier force-pushed the embed-module-version branch 4 times, most recently from 074a85d to e4259ed Compare September 30, 2022 21:49
Copy link
Contributor

@merlimat merlimat left a comment

Choose a reason for hiding this comment

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

👍 Probably we should assert in the tests that the version in not unknown

Instead of maintaining a hard coded version string in the sources, we can get the
version of the pulsar-client-go module used to build the client application.

Signed-off-by: Paul Gier <paul.gier@datastax.com>
Signed-off-by: Paul Gier <paul.gier@datastax.com>
@pgier
Copy link
Contributor Author

pgier commented Oct 1, 2022

@merlimat I agree it would be good to have a test like that, but it's a little difficult to set up because in order to have a module version, we would need to import this module from another module, but then we can't access the Version variable, because it's in the internal package.

@merlimat merlimat merged commit dedbdc4 into apache:master Oct 2, 2022
@RobertIndie RobertIndie added this to the v0.10.0 milestone Mar 27, 2023
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.

4 participants