Skip to content
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

fixing #issue872 #1625

Merged
merged 6 commits into from May 27, 2019
Merged

fixing #issue872 #1625

merged 6 commits into from May 27, 2019

Conversation

theexplorist
Copy link
Contributor

@theexplorist theexplorist commented Apr 22, 2019

fixes #872

@codecov
Copy link

codecov bot commented Apr 22, 2019

Codecov Report

Merging #1625 into master will increase coverage by 0.44%.
The diff coverage is 36.36%.

@@             Coverage Diff              @@
##             master    #1625      +/-   ##
============================================
+ Coverage      34.8%   35.24%   +0.44%     
- Complexity     1121     1123       +2     
============================================
  Files           186      186              
  Lines         10314    10188     -126     
  Branches       1680     1656      -24     
============================================
+ Hits           3590     3591       +1     
+ Misses         6302     6174     -128     
- Partials        422      423       +1

Copy link
Contributor

@devang-gaur devang-gaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog entry missing as well.

try {
if (getContext().getProjectClassLoaders().isClassInCompileClasspath(true)) {
Properties properties = SpringBootUtil.getSpringBootApplicationProperties(getContext().getProjectClassLoaders().getCompileClassLoader());
return properties.getProperty("spring.application.name");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ro14nd @lordofthejars @rohanKanojia can you provide other property names that we should consider for the name ?

  • spring.app.name
  • app.name
  • spring.service.name ?

WDYT ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should stick to standard spring properties, which is spring.application.name in this case. If there are other ways there, then we can add them here as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that's what I meant..

I think spring.app.name should be considered as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theexplorist can you add a getProperty("spring.app.name") as well? Even in #872 its mentioned spring.app.name .

@devang-gaur devang-gaur added the pr/changelog-entry-please Please add a changelog entry for this PR label Apr 22, 2019
Copy link
Member

@rohanKanojia rohanKanojia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rohanKanojia
Copy link
Member

@dev-gaur : Can you please take a look if there is anything pending from your side? Otherwise, can we proceed to merge this PR?

@theexplorist
Copy link
Contributor Author

@dev-gaur : Can you please take a look if there is anything pending from your side? Otherwise, can we proceed to merge this PR?

I will update the PR with requested changes by today so it can be good to merge.

updated changes
@rohanKanojia rohanKanojia removed the pr/changelog-entry-please Please add a changelog entry for this PR label May 8, 2019
Copy link
Contributor

@devang-gaur devang-gaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you verify the change working @theexplorist ?

try {
if (getContext().getProjectClassLoaders().isClassInCompileClasspath(true)) {
Properties properties = SpringBootUtil.getSpringBootApplicationProperties(getContext().getProjectClassLoaders().getCompileClassLoader());
return properties.getProperty("spring.application.name");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theexplorist can you add a getProperty("spring.app.name") as well? Even in #872 its mentioned spring.app.name .

}

private String getServiceName() {
if (getAppName() != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you skip calling getAppName twice? Do something like:

String appName = getAppName();
if (appName!=null) {
return appName;
} else {
....
}

After that, I think we are ready to merge.

@lordofthejars lordofthejars merged commit bd9ab7e into fabric8io:master May 27, 2019
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 this pull request may close these issues.

Using spring.app.name as servicename
4 participants