-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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 build qualifier from server's Version #35172
Remove build qualifier from server's Version #35172
Conversation
Pinging @elastic/es-core-infra |
3b7cd6a
to
8bda2da
Compare
dbd1bcf
to
d0c3224
Compare
844de2f
to
fa5d007
Compare
Allow for qualifier
Now that the version no longer carries information about the qualifier, we still need a way to show the "display version" that does have both qualifier and snapshot. With this change we read it from the jar. A subsequent change will switch to useing it instead of `Version.displayVersion`
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.
OK! I left a few small things. I like Build.getVersion()
- though maybe not the name? Maybe Build.getQualifiedVersion
or something. And it should have javadoc. Because we already have Version
and it isn't the same thing.
buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginPropertiesTask.groovy
Outdated
Show resolved
Hide resolved
buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy
Outdated
Show resolved
Hide resolved
client/rest-high-level/src/test/java/org/elasticsearch/client/PingAndInfoIT.java
Outdated
Show resolved
Hide resolved
Thanks for your review @nik9000 . I made changes as suggested. |
@@ -24,6 +24,7 @@ which should give you a response something like this: | |||
"build_hash" : "f27399d", | |||
"build_date" : "2016-03-30T09:51:41.449Z", | |||
"build_snapshot" : false, | |||
"build_version" : "{qualified_version}", |
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.
Should the key here be qualified
?
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 not sure. I don't think build_version
is right though.
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.
@nik9000
I'm not entirely sure qualified
will make things easier to understand either.
Maybe just have this returned as number
? Users will run production releases most of the time, and they'll just see the same information twice if we have a new field.
I will deal with this in a new PR.
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 left a few super minor things but this LGTM. Good luck on the backport!
Build.CURRENT.isSnapshot() ? "-SNAPSHOT" : ""); | ||
Locale.ROOT, | ||
"%s/employees/1", | ||
System.getProperty("tests.jboss.home") |
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 think "home" means something else in this context. Maybe test.wildfly.root
?
} | ||
} | ||
|
||
public String getQualifiedVersion() { |
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.
Could you add javadoc to this?
@@ -235,9 +264,13 @@ public boolean isSnapshot() { | |||
return isSnapshot; | |||
} | |||
|
|||
public boolean isProductionRelease() { |
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 too?
@@ -102,7 +101,7 @@ protected void execute(Terminal terminal, OptionSet options, Environment env) th | |||
final String versionOutput = String.format( | |||
Locale.ROOT, | |||
"Version: %s, Build: %s/%s/%s/%s, JVM: %s", | |||
Version.displayVersion(Version.CURRENT, Build.CURRENT.isSnapshot()), | |||
Build.CURRENT.getQualifiedVersion(), |
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 think the indentation on this one is off.
static void warnIfPreRelease(final Version version, final boolean isSnapshot, final Logger logger) { | ||
if (!version.isRelease() || isSnapshot) { | ||
static void warnIfPreRelease(final Build build,final Logger logger) { | ||
if (build.isProductionRelease() == false) { |
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 think maybe this isn't worth being its own method any more. Now that we're testing isProductionRelease
instead.
@nik9000 this is not planned to be back-ported. I have done so with the work leading up here, but don't plan to do it with this one. Do you think we should ? |
After looking more into it, it seems that it was a deliberate decision not to have |
With this change, `Version` no longer carries information about the qualifier, we still need a way to show the "display version" that does have both qualifier and snapshot. This is now stored by the build and red from `META-INF`.
I noticed that when you run |
@javanna that was done on purpose. Qualified builds will be tagged as such as needed. |
Build on #35155 ( and contains commits from )
String
version field toBuild
to hold the complete version string passed on from the build.Version.getDisplayVersion
withBuild.CURRENT.getVersion()
introduced abovebuild_version
parameter toversion
. Was not sure this is the way to go, feedback is welcome. The alternative is to haveversion.number
show the build qualifier as well without adding a newbuild_version
. It did use to have-SNAPSHOT
in there, but it's not technically a "number". Not that the content ofversion.number
will change in regardless.With this change elasticsearch greets as:
And in the logs we have: