-
Notifications
You must be signed in to change notification settings - Fork 61
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 number to CLI output #339
Conversation
@Test | ||
fun astWithMetas() { | ||
ReplTester().assertReplPrompt(""" | ||
#Welcome to the PartiQL REPL! | ||
#PartiQL> 1 + 1 | ||
# | !? |
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 test was removed due to removal of printing ASTs without metas in #272.
#( | ||
# plus | ||
# ( | ||
# lit | ||
# 1 | ||
# ) | ||
# ( | ||
# lit | ||
# 1 | ||
# ) | ||
#) | ||
#--- | ||
#OK! | ||
#PartiQL> | ||
""".trimMargin("#")) | ||
} | ||
|
||
@Test | ||
fun astWithMetas() { | ||
ReplTester().assertReplPrompt(""" | ||
#Welcome to the PartiQL REPL! | ||
#PartiQL> 1 + 1 | ||
# | !? | ||
#===' | ||
# | ||
#( | ||
# meta | ||
# query |
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.
Fix to the existing test's AST.
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.
Overall LGTM, however is it useful/possible/feasible to include the short git hash in the version string? i.e.
Welcome to the PartiQL REPL!
Using version: 0.2.5-SNAPSHOT-c6a3b073
PartiQL>
I think providing the commit hash would be pretty useful. New revision adds the short commit hash to the REPL output following this approach to get the hash and storing it as another property. New REPL output looks like:
|
Codecov Report
@@ Coverage Diff @@
## master #339 +/- ##
============================================
- Coverage 82.35% 82.30% -0.06%
Complexity 1233 1233
============================================
Files 157 157
Lines 9365 9371 +6
Branches 1526 1526
============================================
Hits 7713 7713
- Misses 1192 1198 +6
Partials 460 460
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Adds current PartiQL version number (from gradle) and the most recent commit hash to the CLI output.
Example output shown below:
This approach follows from this similar stackoverflow answer. Essentially, the root
build.gradle
file will output theversion
to a file in the Gradle build, which can be accessed as a resource by the CLI/REPL.Retrieving the most recent commit hash follows this stackoverflow answer. We similarly store the commit hash to a Gradle build file.
Also, some existing REPL tests (previously ignored by #266) were updated to incorporate this change.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.