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

Config with injection #7080

Merged
merged 5 commits into from Jun 29, 2023
Merged

Conversation

tomas-langer
Copy link
Member

@tomas-langer tomas-langer commented Jun 23, 2023

Resolves #7079

Config documentation notes

Helidon config API (helidon-common-config)

There is a new class:
io.helidon.common.config.GlobalConfig

This class can be used to set global configuration to be used by Helidon components. The configuration must be set as the first thing, before Helidon components
are invoked, or Helidon main class is called.
If no configuration is set, the usual Config.create() is used to obtain configuration either from default sources, or using meta configuration.

Helidon config
ConfigSource interface is now marked as a @Contract for Helidon Injection
ConfigProducer is a new @Singleton service that combines the discovered ConfigSource from Helidon Injection, with the discovered configuration (from GlobalConfig) and creates a new config (unless an explicit config instance is set using GlobalConfig - in such a case it is used AS IS).
This means that when io.helidon.common.Config is injected into any service using Helidon Injection, this combined config instance will be provided.

PR notes

helidon-config dependency had to be removed from all pico modules, so we can generate service code in config module. The tests were moved to appropriate location in pico/tests, currently using the same packages, to allow calling package local methods.

Wow this caused quite a mayhem in our dependency management for jakarta.inject-api. Investigating

Follow up issue: #7081

@tomas-langer tomas-langer added config 4.x Version 4.x pico Helidon Injection labels Jun 23, 2023
@tomas-langer tomas-langer self-assigned this Jun 23, 2023
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jun 23, 2023
@tomas-langer tomas-langer marked this pull request as draft June 25, 2023 20:46
Copy link
Contributor

@ljamen ljamen left a comment

Choose a reason for hiding this comment

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

Reviewed java files. No docs currently associated with this draft PR. Documentation will be captured in a separate PR.

@tomas-langer tomas-langer marked this pull request as ready for review June 26, 2023 16:41
@tomas-langer
Copy link
Member Author

Reviewed java files. No docs currently associated with this draft PR. Documentation will be captured in a separate PR.

I have added you because of the comments in the PR description - those are relevant for Config documentation once we merge this.
Thanks

@tomas-langer
Copy link
Member Author

Rebased on main and fixed APT dependencies.

@tomas-langer tomas-langer merged commit f57b450 into helidon-io:main Jun 29, 2023
12 checks passed
@tomas-langer tomas-langer deleted the config-with-injection branch June 29, 2023 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x config OCA Verified All contributors have signed the Oracle Contributor Agreement. pico Helidon Injection
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants