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

Reimplement the extension annotation processor #42141

Merged
merged 43 commits into from
Aug 8, 2024
Merged

Commits on Aug 7, 2024

  1. Reimplement the extension annotation processor

    The idea is the following:
    - we collect the config properties and dump them into a file that is
      local to the module - this will help with Develocity caching and a
      lot of other issues.
    - ideally the descriptor will be also consumable by IDEs
    - when generating the documentation, we will gather all the descriptors
      in the tree and transform them to Asciidoc files.
    
    For now, we keep the old way of doing things around for compatibility.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    96b0d3d View commit details
    Browse the repository at this point in the history
  2. Simplify OptionalInt/... types

    This is a small change of behavior compared to current, per discussion
    with Yoann.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    1998f19 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2f0b8d4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    124a3ea View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    98245a8 View commit details
    Browse the repository at this point in the history
  6. Only run the annotation processor for the default execution

    We don't need the annotation processor when compiling the tests.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    50b35a1 View commit details
    Browse the repository at this point in the history
  7. Fix pom legacy config

    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    e54a4ea View commit details
    Browse the repository at this point in the history
  8. Make config annotations kept at runtime

    This should allow us to resolve fully the doc model even if we depend on
    classes or config groups that are outside of the scope of the module.
    The cost should be negligible and it should simplify things a lot.
    
    All the @ConfigMapping-related annotations in SmallRye Config already
    have a runtime retention so it makes sense to be consitent.
    
    Note that we will still need to centralize the Javadoc as obviously the
    Javadoc is source only.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    543fb56 View commit details
    Browse the repository at this point in the history
  9. Work around Quarkus Core and Quarkus Messaging mixing two approaches

    Both use traditional config roots AND config mappings at the same time,
    which won't be supported in the future.
    For now, we try to be lenient as it's going to be a long and bumpy road
    to fix it.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    b015c1d View commit details
    Browse the repository at this point in the history
  10. Drop the notion of resolution

    Now that we keep all the config annotations at runtime, we can fully
    resolve the model from the classpath.
    What's missing is the Javadoc but we will collect it in a separate file
    and when generating documentation, we will get the associated Javadoc
    from that file.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    5c1f94d View commit details
    Browse the repository at this point in the history
  11. Write javadoc elements as JSON in a new file

    We need more structure than a simple properties.
    We keep the .properties for now for compatibility but hopefully we will
    be able to drop it in the future.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    5fe5b1c View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    3d68d93 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    6d240d3 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    96ae31e View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    24076fa View commit details
    Browse the repository at this point in the history
  16. Fix default for mapKey

    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    1592efd View commit details
    Browse the repository at this point in the history
  17. Improve named maps config doc for various modules

    Noticed thanks to the bug I just fixed.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    e9adc0b View commit details
    Browse the repository at this point in the history
  18. Do not ignore fields that are not annotated with @configitem

    Personnaly, I would rather ignore them but that's not the current
    behavior. See OpenShiftConfig for a good example of it.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    b5b998f View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    e029b23 View commit details
    Browse the repository at this point in the history
  20. Strip additional suffixes for extension name

    -common and -internal will be in the way so let's strip them too.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    2532594 View commit details
    Browse the repository at this point in the history
  21. Only check the presence of Javadoc when collecting it

    Also be a little less strict: in the case of config
    groups, we only require a Javadoc if it is not a
    section.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    94fc9e6 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    8dd0497 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    6f729ea View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    c7d0579 View commit details
    Browse the repository at this point in the history
  25. Also scan @ConfigMapping without @configroot

    This is used in Observability Dev Services to share a super interface
    between several modules.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    95241fa View commit details
    Browse the repository at this point in the history
  26. Allow generating specific config sections

    We use to generate a gazillion of config groups files and most were
    unused.
    In the new annotation, we only generate specific files if a section
    is marked with @ConfigSection(generated = true).
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    2ab5bff View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    e4410fb View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    9104607 View commit details
    Browse the repository at this point in the history
  29. Improve how ConfigSections/ConfigRoots are merged

    ConfigSections have to be merged inside a given ConfigRoot. Typically,
    HibernateORMConfig has sections that are both in a simple element and in
    an unnamed map thus leading to the same section path.
    
    As for ConfigRoots, let's not merge them at all at resolution stage,
    given we already do some merging in the Maven plugin,
    let's do the merging at the end.
    
    Also drops some code related to having ConfigGroups in the model as we
    don't need them.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    b154fdf View commit details
    Browse the repository at this point in the history
  30. Also generate section files for Maps

    This is useful in the case of gRPC XDS client config.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    f15a1bd View commit details
    Browse the repository at this point in the history
  31. Allow saving a ConfigRoot in a specific file

    This was introduced for Quarkus CXF but it's now also useful for the
    very weird core config ConfigRoot.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    b5b8cc9 View commit details
    Browse the repository at this point in the history
  32. Also resolve the name from the extension metadata

    And make sure we keep the best name when merging the config roots.
    This will be useful for the file centralizing all the config doc.
    
    Finally, make sure we have a consistent ordering.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    9008ab7 View commit details
    Browse the repository at this point in the history
  33. Disable annotation processors in docs module

    We have one in the classpath and we really don't want it to be executed
    so let's disable them.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    bcc437d View commit details
    Browse the repository at this point in the history
  34. Reimplement all config generation

    Using the new model, it's a lot easier to implement.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    bdccab1 View commit details
    Browse the repository at this point in the history
  35. Adjust how the Maven plugin is executed and add a skip parameter

    While we will use <extensions>true</extensions> in the external projects
    to simplify the setup, using it in a reactor where the plugin is built
    generates a warning.
    While it works file, it's less than ideal to have a warning so we
    register the plugin manually.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    41267b0 View commit details
    Browse the repository at this point in the history
  36. Split Maven plugin generation from extension processor

    We should have never used the extension processor infra to generate the
    Maven plugin reference doc.
    This commit makes sure we don't use anything from the annotation
    processor.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    5c76ea9 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    6461342 View commit details
    Browse the repository at this point in the history
  38. Get rid of all the old annotation processor code

    Also port some of the tests to the new infrastructure.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    11c3181 View commit details
    Browse the repository at this point in the history
  39. Simplify generated doc directory structure

    This should be a lot easier to maintain in the future.
    
    Also adapt sync-web-site.sh to the new structure.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    348ff55 View commit details
    Browse the repository at this point in the history
  40. Allow not detecting the extension

    We actually have some level of support for building an extension with
    Gradle so we need to make it work.
    However, at the moment, it's close to impossible to determine the
    extension we are in in a Gradle extension.
    So we allow not detecting the extension and disable the config doc
    generation in this case.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    9ee3782 View commit details
    Browse the repository at this point in the history
  41. Fix new extension annotation processor compatibility with Windows

    The annotation processor Filer API doesn't support Windows separators so
    let's use a plain string.
    gsmet committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    ec9ade1 View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2024

  1. Don't make sections searchable

    I think we need to but it wasn't done before and the website is
    apparently not ready for it.
    See how https://quarkus.io/version/main/guides/dev-services misbehaves
    when all the sections are make searchable.
    gsmet committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    1a41c40 View commit details
    Browse the repository at this point in the history
  2. Clarify a bit the property path and the mapped path

    We need to make sure people will not confuse them in the future.
    gsmet committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    083795b View commit details
    Browse the repository at this point in the history