Skip to content

Commit

Permalink
Merge branch 'main' into datasource-devservices-showLogs-squashed
Browse files Browse the repository at this point in the history
  • Loading branch information
DeMol-EE authored Nov 12, 2024
2 parents 0348db6 + 81679eb commit 52ebb92
Show file tree
Hide file tree
Showing 135 changed files with 2,820 additions and 363 deletions.
81 changes: 81 additions & 0 deletions adr/0007-quarkus-workshop-structure.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
= Structure for Quarkus Workshops

* Status: _Accepted_
* Date: 2024-11-06
* Authors: @cescoffier
== Context and Problem Statement

Since the public release of Quarkus, we launched a hands-on workshop to help developers get started with it.
Known as the "Quarkus Superheroes" workshop, this workshop allowed developers to learn Quarkus by actively writing and running code in a structured environment, often at conferences or in classroom settings.

The "Quarkus Superheroes" workshop has been highly successful, delivered at various conferences and widely used by developers for self-study.
At the time, we anticipated additional workshops, leading us to establish a dedicated structure within a single repository: Quarkus Workshops (https://github.com/quarkusio/quarkus-workshops).

The initial (and still existing) structure was straightforward:

[source]
----
.
├── README.md
└── quarkus-workshop-super-heroes/
├── dist
├── docs
├── super-heroes
├── README.adoc
└── pom.xml
----

Although this structure was meant to support multiple workshops, only the "Quarkus Superheroes" workshop was added.
Instead of separate workshops, we expanded this initial workshop with additional steps and features.

As we now develop new workshops on various topics, we face limitations with the single repository structure.
For example, the Quarkus LangChain4J workshop was created separately to demonstrate Quarkus LangChain4J usage, yet it isn’t integrated into the main workshop repository.
Additionally, having a single repository complicates using GitHub Pages for documentation.

Given the current and future workshops, it’s essential to reconsider the structure to allow easier management and discoverability of each workshop.

== Proposed New Structure

Our experience shows that hosting all workshops in one repository isn’t optimal. We propose a new structure as follows:

1. Each workshop will be hosted in its own repository.
This simplifies management, avoids conflicts in `README` and documentation setup, and improves workshop discoverability.
2. Naming convention: Each workshop repository should follow the format `quarkus-workshop-<topic>`, where `<topic>` represents the workshop subject (e.g., `quarkus-workshop-superheroes`, `quarkus-workshop-langchain4j`).
3. Documentation should be hosted with GitHub Pages in each repository, making each workshop more accessible.
4. Each workshop repository should have the `workshop` topic to facilitate discoverability.
5. We will keep https://quarkus.io/quarkus-workshops/ as a landing page, which people can use to find workshops.
In order to preserve the GitHub history, the quarkus-workshops repository should be renamed to https://quarkus.io/quarkus-workshop-superheroes, and then a new repository should be created, using the old name, `quarkus-workshops`.
6. This _landing_ repository can also be used to host redirects. For example, the existing URL https://quarkus.io/quarkus-workshops/super-heroes/ should be kept valid by using a redirect.

== Considered Options

=== Option 1: Continue with the current single-repository approach

This would mean keeping all workshops under the existing repository.
However, as observed, this approach has not met expectations and makes workshop management more challenging.

=== Option 2: Create a separate organization for workshops

A dedicated organization could host all workshops, offering a single access point.
However, this approach could reduce discoverability, but would not use the Quarkus organization’s CI resources.
CI resource usage is minor, as workshops are not frequently updated.

== Consequences

=== Positive

* Simplified workshop management.
* Greater autonomy for workshop maintainers.
* Consolidation of workshops previously hosted in separate repositories.

=== Negative

* Lack of a central place to list all workshops. This could be mitigated by creating a dedicated page on the Quarkus website.
* Potential CI resource shortage as each workshop repository uses _quarkusio_ organization CI resources.
However, this is unlikely to be a significant issue, as, generally, workshops don't use much CI resources.
That being said, it would require monitoring to ensure it doesn't become a problem.

=== Neutral

* Existing workshops would need restructuring to align with the new approach, especially the Quarkus Superheroes workshop.
4 changes: 2 additions & 2 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
<maven-invoker.version>3.2.0</maven-invoker.version>
<awaitility.version>4.2.2</awaitility.version>
<jboss-logmanager.version>3.0.6.Final</jboss-logmanager.version>
<flyway.version>10.20.1</flyway.version>
<flyway.version>10.21.0</flyway.version>
<yasson.version>3.0.4</yasson.version>
<!-- liquibase-mongodb is not released everytime with liquibase anymore, but the two versions need to be compatible -->
<liquibase.version>4.29.1</liquibase.version>
Expand Down Expand Up @@ -206,7 +206,7 @@
<jgit.version>7.0.0.202409031743-r</jgit.version>
<!-- these two artifacts needs to be compatible together -->
<strimzi-oauth.version>0.15.0</strimzi-oauth.version>
<strimzi-oauth.nimbus.version>9.45</strimzi-oauth.nimbus.version>
<strimzi-oauth.nimbus.version>9.46</strimzi-oauth.nimbus.version>
<jose4j.version>0.9.6</jose4j.version>
<java-buildpack-client.version>0.0.12</java-buildpack-client.version>
<org-crac.version>0.1.3</org-crac.version>
Expand Down
2 changes: 1 addition & 1 deletion build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
<version>4.0.23</version>
<version>4.0.24</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package io.quarkus.deployment.builditem;

import java.util.Optional;
import java.util.logging.Formatter;

import org.wildfly.common.Assert;

import io.quarkus.builder.item.MultiBuildItem;
import io.quarkus.runtime.RuntimeValue;

/**
* The socket format build item. Producing this item will cause the logging subsystem to disregard its
* socket logging formatting configuration and use the formatter provided instead. If multiple formatters
* are enabled at runtime, a warning message is printed and only one is used.
*/
public final class LogSocketFormatBuildItem extends MultiBuildItem {
private final RuntimeValue<Optional<Formatter>> formatterValue;

/**
* Construct a new instance.
*
* @param formatterValue the optional formatter runtime value to use (must not be {@code null})
*/
public LogSocketFormatBuildItem(final RuntimeValue<Optional<Formatter>> formatterValue) {
this.formatterValue = Assert.checkNotNullParam("formatterValue", formatterValue);
}

/**
* Get the formatter value.
*
* @return the formatter value
*/
public RuntimeValue<Optional<Formatter>> getFormatterValue() {
return formatterValue;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
import io.quarkus.deployment.builditem.LogConsoleFormatBuildItem;
import io.quarkus.deployment.builditem.LogFileFormatBuildItem;
import io.quarkus.deployment.builditem.LogHandlerBuildItem;
import io.quarkus.deployment.builditem.LogSocketFormatBuildItem;
import io.quarkus.deployment.builditem.LogSyslogFormatBuildItem;
import io.quarkus.deployment.builditem.NamedLogHandlersBuildItem;
import io.quarkus.deployment.builditem.RunTimeConfigurationDefaultBuildItem;
Expand Down Expand Up @@ -249,6 +250,7 @@ LoggingSetupBuildItem setupLoggingRuntimeInit(
final List<LogConsoleFormatBuildItem> consoleFormatItems,
final List<LogFileFormatBuildItem> fileFormatItems,
final List<LogSyslogFormatBuildItem> syslogFormatItems,
final List<LogSocketFormatBuildItem> socketFormatItems,
final Optional<ConsoleFormatterBannerBuildItem> possibleBannerBuildItem,
final List<LogStreamBuildItem> logStreamBuildItems,
final BuildProducer<ShutdownListenerBuildItem> shutdownListenerBuildItemBuildProducer,
Expand Down Expand Up @@ -290,6 +292,8 @@ LoggingSetupBuildItem setupLoggingRuntimeInit(
.map(LogFileFormatBuildItem::getFormatterValue).collect(Collectors.toList());
List<RuntimeValue<Optional<Formatter>>> possibleSyslogFormatters = syslogFormatItems.stream()
.map(LogSyslogFormatBuildItem::getFormatterValue).collect(Collectors.toList());
List<RuntimeValue<Optional<Formatter>>> possibleSocketFormatters = socketFormatItems.stream()
.map(LogSocketFormatBuildItem::getFormatterValue).collect(Collectors.toList());

context.registerSubstitution(InheritableLevel.ActualLevel.class, String.class, InheritableLevel.Substitution.class);
context.registerSubstitution(InheritableLevel.Inherited.class, String.class, InheritableLevel.Substitution.class);
Expand All @@ -308,6 +312,7 @@ LoggingSetupBuildItem setupLoggingRuntimeInit(
categoryMinLevelDefaults.content, alwaysEnableLogStream,
streamingDevUiLogHandler, handlers, namedHandlers,
possibleConsoleFormatters, possibleFileFormatters, possibleSyslogFormatters,
possibleSocketFormatters,
possibleSupplier, launchModeBuildItem.getLaunchMode(), true)));

List<LogCleanupFilterElement> additionalLogCleanupFilters = new ArrayList<>(logCleanupFilters.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ private BuildResult runAugment(boolean firstRun, Set<String> changedResources,
.setTargetDir(quarkusBootstrap.getTargetDirectory())
.setDeploymentClassLoader(deploymentClassLoader)
.setBuildSystemProperties(quarkusBootstrap.getBuildSystemProperties())
.setRuntimeProperties(quarkusBootstrap.getRuntimeProperties())
.setEffectiveModel(curatedApplication.getApplicationModel())
.setDependencyInfoProvider(quarkusBootstrap.getDependencyInfoProvider());
if (quarkusBootstrap.getBaseName() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.jboss.jdeparser.JDeparser;

import io.quarkus.annotation.processor.documentation.config.ConfigDocExtensionProcessor;
import io.quarkus.annotation.processor.documentation.config.model.Extension;
import io.quarkus.annotation.processor.documentation.config.model.ExtensionModule;
import io.quarkus.annotation.processor.documentation.config.util.Types;
import io.quarkus.annotation.processor.extension.ExtensionBuildProcessor;
import io.quarkus.annotation.processor.util.Config;
Expand All @@ -45,11 +45,12 @@ public synchronized void init(ProcessingEnvironment processingEnv) {
.parseBoolean(utils.processingEnv().getOptions().getOrDefault(Options.LEGACY_CONFIG_ROOT, "false"));
boolean debug = Boolean.getBoolean(DEBUG);

Extension extension = utils.extension().getExtension();
Config config = new Config(extension, useConfigMapping, debug);
ExtensionModule extensionModule = utils.extension().getExtensionModule();

Config config = new Config(extensionModule, useConfigMapping, debug);

if (!useConfigMapping) {
processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING, "Extension " + extension.artifactId()
processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING, "Extension module " + extensionModule.artifactId()
+ " config implementation is deprecated. Please migrate to use @ConfigMapping: https://quarkus.io/guides/writing-extensions#configuration");
}

Expand All @@ -61,7 +62,7 @@ public synchronized void init(ProcessingEnvironment processingEnv) {

// for now, we generate the old config doc by default but we will change this behavior soon
if (generateDoc) {
if (extension.detected()) {
if (extensionModule.detected()) {
extensionProcessors.add(new ConfigDocExtensionProcessor());
} else {
processingEnv.getMessager().printMessage(Kind.WARNING,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package io.quarkus.annotation.processor.documentation.config.model;

public record ExtensionModule(String groupId, String artifactId, ExtensionModuleType type, Extension extension,
boolean detected) {

public static ExtensionModule createNotDetected() {
return new ExtensionModule("not.detected", "not.detected", ExtensionModuleType.UNKNOWN, Extension.createNotDetected(),
false);
}

public static ExtensionModule of(String groupId, String artifactId, ExtensionModuleType type, Extension extension) {
return new ExtensionModule(groupId, artifactId, type, extension, true);
}

public enum ExtensionModuleType {
RUNTIME,
DEPLOYMENT,
UNKNOWN;
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
package io.quarkus.annotation.processor.util;

import io.quarkus.annotation.processor.documentation.config.model.Extension;
import io.quarkus.annotation.processor.documentation.config.model.ExtensionModule;

public class Config {

private final Extension extension;
private final ExtensionModule extensionModule;
private final boolean useConfigMapping;
private final boolean debug;

public Config(Extension extension, boolean useConfigMapping, boolean debug) {
this.extension = extension;
public Config(ExtensionModule extensionModule, boolean useConfigMapping, boolean debug) {
this.extensionModule = extensionModule;
this.useConfigMapping = useConfigMapping;
this.debug = debug;
}

public ExtensionModule getExtensionModule() {
return extensionModule;
}

public Extension getExtension() {
return extension;
return extensionModule.extension();
}

public boolean useConfigMapping() {
Expand Down
Loading

0 comments on commit 52ebb92

Please sign in to comment.