-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat(versions): record own build info/version as properties, validate server version #508
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
needs-triage
Needs thorough attention from code reviewers
label
Oct 4, 2024
andrewazores
removed
the
needs-triage
Needs thorough attention from code reviewers
label
Oct 4, 2024
andrewazores
force-pushed
the
buildinfo
branch
2 times, most recently
from
October 4, 2024 17:53
d54e971
to
3666bb1
Compare
7 tasks
Josh-Matsuoka
approved these changes
Oct 10, 2024
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 fixme in BuildInfo is probably worthwhile, we should open an issue for core to keep track of it. Other than that LGTM
andrewazores
force-pushed
the
buildinfo
branch
from
October 15, 2024 20:12
54aef72
to
0a6a578
Compare
I'm getting an error upon agent startup after this change:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #504
Fixes #505
At build time, the following bits of information are recorded into resources files which are included in the distribution JAR:
pom.xml
version
, ie the Agent's own version stringpom.xml
cryostat.server.version.min
andcryostat.server.version.max
, the minimum (inclusive) and maximum (exclusive) Cryostat server versions that this Agent version is expected to work with. Currently set to 4.0.0 and 5.0.0 respectively, forming the range[4.0.0, 5.0.0)
, so that any Cryostat server version4.y.z
should be within range. These are set aspom.xml
properties rather than in themicroprofile-config.properties
so that they are build-time immutable.The Agent reads its own version string and logs this at startup. It loads all of these values and sets them as various system properties so that they can be retrieved generically later on. Finally, when it attempts to register itself with the Cryostat server, it performs a
GET /health
check against the server to obtain the server'scryostatVersion
string, then parses that to a semantic version, and compares that to the expected server version range. If the actual server version is outside of the expected range then the agent logs a warning.