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

Rename InitalizationTaskCompletedBuildItem to InitTaskCompletedBuildItem #32115

Merged
merged 1 commit into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import io.quarkus.builder.item.MultiBuildItem;

/**
* Represents an initalization task for the application.
* Represents an initialization task for the application.
* Often extension perform some sort of initialization as part of the application startup.
* There are cases where we we want to externalize the initialization (e.g. in a pipeline).
* There are cases where we want to externalize the initialization (e.g. in a pipeline).
*
* Often the task is run using the same artifact as the application but using a different command or
* arguments. In the later case it might be deseriable to pass additional environment variable to both the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
* Similar to {@link ServiceStartBuildItem} but focused on initialization tasks (e.g. db migrations etc) that are run during
* runtime just before the application startups.
* <p>
* The build item is used, so that we can track when all intialization tasks have been completed.
* The build item is used, so that we can track when all initialization tasks have been completed.
*/
public final class InitalizationTaskCompletedBuildItem extends MultiBuildItem {
public final class InitTaskCompletedBuildItem extends MultiBuildItem {
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if we should deprecate this for a version before deleting it.

@ppalaga are you using that in Camel Quarkus by any chance?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm also not sure if this build item is used outside of the core repository.

Given that it was introduced around November 2022, I'd say that it's not very likely. Sourcegraph search also seems to agree (though I am not sure if it can be trusted).

Copy link
Contributor Author

@gastaldi gastaldi Mar 27, 2023

Choose a reason for hiding this comment

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

@iocanel the class is present since 3.0.0.Alpha3 and it was introduced in Jan 16th in this commit: c4d34d1

So I'd say it's perfectly fine to rename it before it lands into a stable release.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the heads up, I see 0 occurrences in Camel Quarkus and QCXF


private final String name;

public InitalizationTaskCompletedBuildItem(String name) {
public InitTaskCompletedBuildItem(String name) {
this.name = name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
import io.quarkus.deployment.annotations.Consume;
import io.quarkus.deployment.annotations.ExecutionTime;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.InitalizationTaskCompletedBuildItem;
import io.quarkus.deployment.builditem.InitTaskCompletedBuildItem;
import io.quarkus.runtime.init.InitializationTaskRecorder;

/**
* A processor that is used to track all {@link InitalizationTaskCompletedBuildItem} in order to exit once they are completed if
* A processor that is used to track all {@link io.quarkus.deployment.builditem.InitTaskCompletedBuildItem} in order to exit
* once they are completed if
* needed.
*/
public class InitializtionTaskProcessor {
Expand All @@ -20,7 +21,7 @@ public class InitializtionTaskProcessor {
@Consume(SyntheticBeansRuntimeInitBuildItem.class)
@Record(ExecutionTime.RUNTIME_INIT)
void startApplicationInitializer(InitializationTaskRecorder recorder,
List<InitalizationTaskCompletedBuildItem> initalizationCompletedBuildItems) {
List<InitTaskCompletedBuildItem> initTaskCompletedBuildItems) {
recorder.exitIfNeeded();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
import io.quarkus.deployment.builditem.HotDeploymentWatchedFileBuildItem;
import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
import io.quarkus.deployment.builditem.InitTaskBuildItem;
import io.quarkus.deployment.builditem.InitalizationTaskCompletedBuildItem;
import io.quarkus.deployment.builditem.InitTaskCompletedBuildItem;
import io.quarkus.deployment.builditem.ServiceStartBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
Expand Down Expand Up @@ -208,15 +208,15 @@ void createBeans(FlywayRecorder recorder,
public ServiceStartBuildItem startActions(FlywayRecorder recorder,
FlywayRuntimeConfig config,
BuildProducer<JdbcDataSourceSchemaReadyBuildItem> schemaReadyBuildItem,
BuildProducer<InitalizationTaskCompletedBuildItem> initializationCompleteBuildItem,
BuildProducer<InitTaskCompletedBuildItem> initializationCompleteBuildItem,
MigrationStateBuildItem migrationsBuildItem) {

recorder.doStartActions();

// once we are done running the migrations, we produce a build item indicating that the
// schema is "ready"
schemaReadyBuildItem.produce(new JdbcDataSourceSchemaReadyBuildItem(migrationsBuildItem.hasMigrations));
initializationCompleteBuildItem.produce(new InitalizationTaskCompletedBuildItem("flyway"));
initializationCompleteBuildItem.produce(new InitTaskCompletedBuildItem("flyway"));
return new ServiceStartBuildItem("flyway");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.InitTaskBuildItem;
import io.quarkus.deployment.builditem.InitalizationTaskCompletedBuildItem;
import io.quarkus.deployment.builditem.InitTaskCompletedBuildItem;
import io.quarkus.deployment.builditem.ServiceStartBuildItem;
import io.quarkus.deployment.builditem.SystemPropertyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
Expand Down Expand Up @@ -246,10 +246,10 @@ void createBeans(LiquibaseMongodbRecorder recorder,
@Record(ExecutionTime.RUNTIME_INIT)
@Consume(SyntheticBeansRuntimeInitBuildItem.class)
ServiceStartBuildItem startLiquibase(LiquibaseMongodbRecorder recorder,
BuildProducer<InitalizationTaskCompletedBuildItem> initializationCompleteBuildItem) {
BuildProducer<InitTaskCompletedBuildItem> initializationCompleteBuildItem) {
// will actually run the actions at runtime
recorder.doStartActions();
initializationCompleteBuildItem.produce(new InitalizationTaskCompletedBuildItem("liquibase-mongodb"));
initializationCompleteBuildItem.produce(new InitTaskCompletedBuildItem("liquibase-mongodb"));
return new ServiceStartBuildItem("liquibase-mongodb");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
import io.quarkus.deployment.builditem.InitTaskBuildItem;
import io.quarkus.deployment.builditem.InitalizationTaskCompletedBuildItem;
import io.quarkus.deployment.builditem.InitTaskCompletedBuildItem;
import io.quarkus.deployment.builditem.ServiceStartBuildItem;
import io.quarkus.deployment.builditem.SystemPropertyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
Expand Down Expand Up @@ -301,14 +301,14 @@ void createBeans(LiquibaseRecorder recorder,
@Consume(SyntheticBeansRuntimeInitBuildItem.class)
ServiceStartBuildItem startLiquibase(LiquibaseRecorder recorder,
List<JdbcDataSourceBuildItem> jdbcDataSourceBuildItems,
BuildProducer<InitalizationTaskCompletedBuildItem> initializationCompleteBuildItem,
BuildProducer<InitTaskCompletedBuildItem> initializationCompleteBuildItem,
BuildProducer<JdbcDataSourceSchemaReadyBuildItem> schemaReadyBuildItem) {

recorder.doStartActions();
// once we are done running the migrations, we produce a build item indicating that the
// schema is "ready"
schemaReadyBuildItem.produce(new JdbcDataSourceSchemaReadyBuildItem(getDataSourceNames(jdbcDataSourceBuildItems)));
initializationCompleteBuildItem.produce(new InitalizationTaskCompletedBuildItem("liquibase"));
initializationCompleteBuildItem.produce(new InitTaskCompletedBuildItem("liquibase"));

return new ServiceStartBuildItem("liquibase");
}
Expand Down