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

Update the configuration docs in the extension guide #736

Merged
merged 1 commit into from
Feb 6, 2019
Merged

Update the configuration docs in the extension guide #736

merged 1 commit into from
Feb 6, 2019

Conversation

dmlloyd
Copy link
Member

@dmlloyd dmlloyd commented Feb 2, 2019

No description provided.

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

Added some comments inline.

Not sure if it's the right place to discuss the config changes though.

@@ -159,95 +159,140 @@ file will be indexed.

== Configuration

Simple configuration is done via the https://github.com/eclipse/microprofile-config[MicroProfile Config] `@org.eclipse.microprofile.config.inject.ConfigProperty` annotations.
Configuration in Shamrock is based on the SmallRye Config, an implementation of the MicroProfile Config specification.
Copy link
Member

Choose a reason for hiding this comment

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

Either on SmallRye Config or on the SmallRye Config project/component/library/whatever.

}
----
<1> The FileConfig object is annotated with @ConfigGroup to indcate that this is an aggregate
<1> The `FileConfig` object is annotated with `@ConfigGroup` to indicate that this is an aggregate
Copy link
Member

Choose a reason for hiding this comment

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

You changed the name of FileConfig to File in the snippet above.

configuration object containing a collection of configurable properties.
<2> Here the LoggingProcessor injects a FileConfig instance using the MicroProfile Config annotation with the property name "shamrock.log.file".
<2> The `@ConfigRoot` annotation indicates that this object is a configuration root group, whose property names will have a parent only of `shamrock.`.
<3> Here the `LoggingProcessor` injects a `FileConfig` instance automatically by detecting the `@ConfigRoot` annotation.
Copy link
Member

Choose a reason for hiding this comment

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

Same about FileConfig being File.

/**
* Logging configuration.
*/
@ConfigRoot(phase = ConfigPhase.STATIC_INIT) <2>
Copy link
Member

Choose a reason for hiding this comment

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

I don't see any explanation about the phases?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I thought I'd leave this off for now until we fix the way roots are resolved (see email). It needs a little more discussion.

@ConfigProperty(name = "shamrock.log.file")
FileConfig file;
<3>
Log log;
Copy link
Member

Choose a reason for hiding this comment

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

You don't even have to mark it with an @Inject annotation or something? I think I would have preferred having an injection marker. At least, you know that it's being injected.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's always injected because you can't have any non-injected fields on a configuration group class. Since you'd always need it, it would probably be a bit annoying to always specify @Inject.

configuration object containing a collection of configurable properties.
<2> Here the LoggingProcessor injects a FileConfig instance using the MicroProfile Config annotation with the property name "shamrock.log.file".
<2> The `@ConfigRoot` annotation indicates that this object is a configuration root group, whose property names will have a parent only of `shamrock.`.
<3> Here the `LoggingProcessor` injects a `FileConfig` instance automatically by detecting the `@ConfigRoot` annotation.
Copy link
Member

Choose a reason for hiding this comment

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

This sentence is a bit confusing because at this point, you inject a Log not a File. And the @ConfigRoot annotation is not there but on the config object.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep I forgot to update this after I went back and made some revisions. Will fix tomorrow.

@ConfigGroup <1>
public class FileConfig {
public class File {
Copy link
Member

Choose a reason for hiding this comment

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

I know why you did it but tbh, I find this change pretty confusing and it was really clearer to have the object called SomethingConfig.

Take for example Hibernate Validator: I will have a HibernateValidator config object if I want hibernate-validator in my config path which looks pretty confusing.

It seems that there's no way to override the name in the @ConfigGroup annotation? Same for @ConfigRoot. Is it on purpose?

Copy link
Member

Choose a reason for hiding this comment

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

Wondering if maybe you could just remove the Config suffix automatically (if the class is not called Config) when generating the property name?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah definitely: see #705 (comment)

@dmlloyd
Copy link
Member Author

dmlloyd commented Feb 6, 2019

Updated; please re-review.

Copy link
Member

@cescoffier cescoffier left a comment

Choose a reason for hiding this comment

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

Looks good!

@cescoffier cescoffier merged commit 74b644b into quarkusio:master Feb 6, 2019
@dmlloyd dmlloyd deleted the config-docs branch February 6, 2019 15:54
@cescoffier cescoffier added this to the 0.8.0 milestone Feb 6, 2019
maxandersen pushed a commit to maxandersen/quarkus that referenced this pull request Nov 5, 2022
This would happen when there was nothing to be done but we still
returned with the exit code instructing the startup script to
execute jbang's output.
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.

3 participants