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

4.x Fix nested config prefix for observer settings #8010

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

tjquinno
Copy link
Member

@tjquinno tjquinno commented Nov 15, 2023

Description

Resolves #8009

The metrics and health CDI extension constructors passed the incorrect config key for nested (non-top-level) config settings.

The original code passed observe.providers.metrics and observe.providers.health. I suspect this was correct before the restructuring of features and observers, and their config now appears under server.features.observe.observers.metrics and ...health instead and use observers instead of providers in the prefix. I further suspect these strings just fell through the cracks during the refactoring.

This PR adds a superclass method which computes the correct prefix (so the hard-coded part of the prefix is in one place) and adjusts the constructors to invoke it.

Note that the superconstructor accepts a list of config prefixes, and the leaf constructors pass both the above correct prefixes and the old (3.x) top-level prefixes (metrics and health).

Documentation

Bug fix - no doc impact.

@tjquinno tjquinno self-assigned this Nov 15, 2023
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Nov 15, 2023
@@ -254,6 +254,16 @@ protected HttpRouting.Builder routingBuilder(ServerCdiExtension server) {
: server.serverNamedRoutingBuilder(routingName);
}

/**
* Returns the config key for settings for the specified suffix nested within the server config tree.
Copy link
Member

Choose a reason for hiding this comment

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

Minor comment: might be nice to append something like: "which is server.features.observe.observers.."

@tjquinno tjquinno merged commit ef55462 into helidon-io:main Nov 17, 2023
12 checks passed
@tjquinno tjquinno deleted the 4.x-mp-config-prefixes branch November 17, 2023 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
2 participants