Skip to content

Consider a different version output if no properties are set #363

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

Closed
ullenboom opened this issue Feb 4, 2022 · 1 comment · Fixed by #368
Closed

Consider a different version output if no properties are set #363

ullenboom opened this issue Feb 4, 2022 · 1 comment · Fixed by #368
Milestone

Comments

@ullenboom
Copy link

ullenboom commented Feb 4, 2022

By default, the version command is active. However, without any properties set, the output might
surprise:

version
2022-02-04 19:48:59.496 ERROR 179596 --- [           main] .TemplateExecutor$LoggingSTErrorListener : runTimeError [context [anonymous] 1:4 attribute buildVersion isn't defined]
2022-02-04 19:48:59.497 ERROR 179596 --- [           main] .TemplateExecutor$LoggingSTErrorListener : runTimeError [context [anonymous] 4:4 attribute buildGroup isn't defined]
2022-02-04 19:48:59.497 ERROR 179596 --- [           main] .TemplateExecutor$LoggingSTErrorListener : runTimeError [context [anonymous] 7:4 attribute buildArtifact isn't defined]
2022-02-04 19:48:59.497 ERROR 179596 --- [           main] .TemplateExecutor$LoggingSTErrorListener : runTimeError [context [anonymous] 10:4 attribute buildName isn't defined]
2022-02-04 19:48:59.497 ERROR 179596 --- [           main] .TemplateExecutor$LoggingSTErrorListener : runTimeError [context [anonymous] 13:4 attribute buildTime isn't defined]
2022-02-04 19:48:59.497 ERROR 179596 --- [           main] .TemplateExecutor$LoggingSTErrorListener : runTimeError [context [anonymous] 16:4 attribute gitShortCommitId isn't defined]
2022-02-04 19:48:59.497 ERROR 179596 --- [           main] .TemplateExecutor$LoggingSTErrorListener : runTimeError [context [anonymous] 19:4 attribute gitCommitId isn't defined]
2022-02-04 19:48:59.497 ERROR 179596 --- [           main] .TemplateExecutor$LoggingSTErrorListener : runTimeError [context [anonymous] 22:4 attribute gitBranch isn't defined]
2022-02-04 19:48:59.497 ERROR 179596 --- [           main] .TemplateExecutor$LoggingSTErrorListener : runTimeError [context [anonymous] 25:4 attribute gitCommitTime isn't 

I am not sure if ERROR is the appropriate log level. Maybe change to WARNING or find a more compact way to express that no data exists for a version string. Or maybe don't activate the version command if the properties are not set.

@jvalkeal jvalkeal added this to the 2.1.0-M3 milestone Feb 6, 2022
@jvalkeal
Copy link
Contributor

jvalkeal commented Feb 6, 2022

You're right that it's not an error as we know stringtemplate from antlr will report those as errors. We added that listener as otherwise antlr printed those into stderr. We could set attributes to nulls and also tweak logging levels.

jvalkeal added a commit to jvalkeal/spring-shell that referenced this issue Feb 11, 2022
- Now passing version command attributes
  even if those are nulls(not set) as ST
  logs those in a listener as errors while
  it doesn't cause any failures.
- Change all LoggingSTErrorListener methods
  into debug level to limit more noise.
- Fixes spring-projects#363
jvalkeal added a commit that referenced this issue Feb 11, 2022
- Now passing version command attributes
  even if those are nulls(not set) as ST
  logs those in a listener as errors while
  it doesn't cause any failures.
- Change all LoggingSTErrorListener methods
  into debug level to limit more noise.
- Fixes #363
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 a pull request may close this issue.

2 participants