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

Add filtering capabilities for build server data. #428

Merged
merged 1 commit into from Aug 10, 2019
Merged

Add filtering capabilities for build server data. #428

merged 1 commit into from Aug 10, 2019

Conversation

ryantse
Copy link
Contributor

@ryantse ryantse commented Aug 10, 2019

Context

The changes introduced in #185 do not cover the issue reported in #354 where a call to getHostName() may take a long time when getting the property git.build.host. Likewise, in certain (rare) cases, TimeZone.getTimeZone() may also have an impact upon performance when retrieving git.build.time.

Depending on the number of projects, this may have a large effect on compile times as there may be numerous calls to the affected functions. A user should be able to filter these properties from being fetched so that build times can improve if this becomes an issue. This also further aligns with the changes in #185 to be more consistent with not fetching unused properties.

Contributor Checklist

  • Added relevant integration or unit tests to verify the changes
  • Update the Readme or any other documentation (including relevant Javadoc)
  • Ensured that tests pass locally: mvn clean package
  • Ensured that the code meets the current checkstyle coding style definition: mvn clean verify -Pcheckstyle -Dmaven.test.skip=true -B

@@ -152,7 +169,7 @@ protected void maybePut(@Nonnull Properties properties, @Nonnull String key, Sup
if (properties.contains(keyWithPrefix)) {
String propertyValue = properties.getProperty(keyWithPrefix);
log.info("Using cached {} with value {}", keyWithPrefix, propertyValue);
} else {
} else if (PropertiesFilterer.isIncluded(keyWithPrefix, includeOnlyProperties, excludeProperties)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good catch!

@TheSnoozer
Copy link
Collaborator

Thank you for your contribution!

Indeed this seems and sounds reasonable. I personally honestly don't know in which weird cases TimeZone.getTimeZone() may also have an impact upon performance. I guess this is not part of the question/problem and out of scope for this MR.

Changes look good for me. I'm going ahead and merge.
Thank you again for your contribution!

@TheSnoozer TheSnoozer merged commit 66f0198 into git-commit-id:master Aug 10, 2019
@TheSnoozer TheSnoozer added this to the 3.0.1 milestone Aug 10, 2019
@ryantse ryantse deleted the filter-build-server-data branch August 12, 2019 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants