-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Remove baseapp dependency on the version package #4250
Remove baseapp dependency on the version package #4250
Conversation
The version package is meant to be a convenience utility that provides SDK consumers with a ready-to-use version command that produces app's versioning information from flags passed at compile time. It will not make sense anymore for the baseapp package to depend on the version package once gaia will have been migrated away from the SDK main repository as we neither want to make assumptions nor set expectations on downstream apps buildsystems. Thus BaseApp now provides SetAppVersion() and AppVersion() to to allow SDK consumers to set BaseApp's version information string once the struct is initialised.
Codecov Report
@@ Coverage Diff @@
## master #4250 +/- ##
==========================================
+ Coverage 58.91% 58.95% +0.04%
==========================================
Files 215 215
Lines 14482 14489 +7
==========================================
+ Hits 8532 8542 +10
+ Misses 5310 5307 -3
Partials 640 640 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good pending Name
being set for gaia
Commit = "" | ||
Version = "" | ||
// Application's name | ||
Name = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR should probably show an example for how the gaia
Name is set here (within the cmd/gaia
) - I'm assuming you just forgot this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming you just forgot this
I did not: https://github.com/cosmos/cosmos-sdk/pull/4250/files#diff-b67911656ef5d18c4ae36cb6741b7965R47
All these variables are set via build flags. I didn't provide examples as there were any before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've improved the version package docs
baseapp/baseapp.go
Outdated
func (app *BaseApp) AppVersion() string { return app.appVersion } | ||
|
||
// SetAppVersion sets the application's version string. | ||
func (app *BaseApp) SetAppVersion(v string) { app.appVersion = v } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably live in options.go
and check for sealed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TestedACK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with @alexanderbez comment that it should check if the version is sealed before setting it
baseapp/baseapp.go
Outdated
func (app *BaseApp) AppVersion() string { return app.appVersion } | ||
|
||
// SetAppVersion sets the application's version string. | ||
func (app *BaseApp) SetAppVersion(v string) { app.appVersion = v } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The version package is meant to be a convenience utility
that provides SDK consumers with a ready-to-use version
command that produces app's versioning information from
flags passed at compile time.
It will not make sense anymore for the baseapp package
to depend on the version package once gaia will have been
migrated away from the SDK main repository as we neither
want to make assumptions nor set expectations on downstream
apps buildsystems. Thus BaseApp now provides SetAppVersion()
and AppVersion() to to allow SDK consumers to set BaseApp's
version information string once the struct is initialised.
docs/
)clog add [section] [stanza] [message]
Files changed
in the github PR explorerFor Admin Use: