Skip to content

Conversation

@agturley
Copy link
Contributor

@agturley agturley commented Dec 17, 2025

Summary

NIFI-15351

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

@dan-s1
Copy link
Contributor

dan-s1 commented Dec 17, 2025

@agturley Thanks for the contribution. In the scan build there is the following error

Warning:  PMD Failure: org.apache.nifi.prometheusutil.VersionInfoRegistry:75 Rule:EmptyCatchBlock Priority:3 Avoid empty catch blocks.
Error:  Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:3.28.0:check (default-cli) on project nifi-web-api: PMD 7.19.0 has found 1 violation.

and in the Validate build there is the following errors
Error: Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.6.0:check (check-style) on project nifi-web-api: You have 15 Checkstyle violations.

These errors must be fixed before this PR can be accepted.

@agturley
Copy link
Contributor Author

Hopefully I addressed the build errors. Thanks!

Comment on lines 79 to 80
LOGGER.debug("Could not retrieve NiFi bundle details for version info metric: {}", e.getMessage());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Stack trace may be helpful

Suggested change
LOGGER.debug("Could not retrieve NiFi bundle details for version info metric: {}", e.getMessage());
}
LOGGER.debug("Could not retrieve NiFi bundle details for version info metric", e);
}

@agturley
Copy link
Contributor Author

added license block and added stack trace to debug message

Copy link
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

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

Thanks for this addition @agturley. The basic approach looks good, I recommended a few adjustments.

Comment on lines 45 to 55
public static class VersionDetails {

public final String nifiVersion;
public final String revision;
public final String tag;
public final String buildBranch;
public final String javaVersion;
public final String javaVendor;
public final String osVersion;
public final String osName;
public final String osArchitecture;
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of a class with public variables, this should be a record.

Comment on lines 482 to 499
// 1. Retrieve the calculated version details
final VersionInfoRegistry.VersionDetails details = versionInfoRegistry.getVersionDetails();
versionInfoRegistry.setDataPoint(1, "NIFI_VERSION_INFO", instanceId,
details.nifiVersion, details.javaVersion, details.revision, details.tag,
details.buildBranch, details.osName, details.osVersion, details.osArchitecture, details.javaVendor);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this block needs to be indented.

@agturley
Copy link
Contributor Author

made the requested changes. I also changed the the actual output from "nifi_version" to "framework_version". Should I change this back or leave it as-is.

Copy link
Contributor

@pvillard31 pvillard31 left a comment

Choose a reason for hiding this comment

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

Please make sure to fix the checkstyle issues:

Warning:  src/main/java/org/apache/nifi/prometheusutil/VersionInfoRegistry.java:[26,8] (imports) UnusedImports: Unused import - java.util.Objects.
Warning:  src/main/java/org/apache/nifi/prometheusutil/VersionInfoRegistry.java:[33,47] (whitespace) WhitespaceAfter: ',' is not followed by whitespace.
Warning:  src/main/java/org/apache/nifi/prometheusutil/VersionInfoRegistry.java:[56] (regexp) RegexpSinglelineJava: Line has trailing whitespace.
Warning:  src/main/java/org/apache/nifi/prometheusutil/VersionInfoRegistry.java:[67,7] (whitespace) WhitespaceAround: '{' is not followed by whitespace.
Warning:  src/main/java/org/apache/nifi/prometheusutil/VersionInfoRegistry.java:[67,8] (whitespace) WhitespaceAround: '}' is not preceded with whitespace.

You can confirm everything is ok by building locally the nifi-web-api module using mvn clean install -Pcontrib-check

@exceptionfactory
Copy link
Contributor

made the requested changes. I also changed the the actual output from "nifi_version" to "framework_version". Should I change this back or leave it as-is.

Thanks, that renaming looks good.

This looks closer to completion, but needs to resolve the Checkstyle warnings.

@agturley agturley requested a review from pvillard31 December 27, 2025 00:01
@agturley
Copy link
Contributor Author

compliance tests are passing now. let me know if there is anything else missed. Thanks!

Copy link
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

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

Thanks for the updates @agturley.

Recent changes to the repository configuration require commits to be signed. The Contributor Guide now includes a section on enabling commit signing with links to configuring Git and registering your key in GitHub.

If you can follow those steps, you can squash the commits in this branch, then force-push an update with the signed commits to prepare this for final review.

@agturley agturley force-pushed the NIFI-15351 branch 2 times, most recently from ac046f7 to 70fe04c Compare December 30, 2025 14:44
@agturley
Copy link
Contributor Author

Pushed the requested changes. Please let me know if there is anything else.

Copy link
Contributor

@pvillard31 pvillard31 left a comment

Choose a reason for hiding this comment

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

+1, merging, taking care of the checkstyle/PMD issue as part of the merge

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.

4 participants