Skip to content

Conversation

@jgreffe
Copy link
Owner

@jgreffe jgreffe commented Aug 5, 2025

Update plugin due to upstream jenkinsci/workflow-api-plugin#417 changes.

  • update OtelLogStorageFactory to use the Describable/Descriptor pattern, some cleanup of useless code
  • update pom.xml to get proper jenkins baseline and resolve the upper-bounds conflicts

Comment on lines -528 to -531
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</exclusion>
Copy link
Owner Author

@jgreffe jgreffe Aug 5, 2025

Choose a reason for hiding this comment

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

Need to remove this exclusion due to https://issues.jenkins.io/browse/JENKINS-73355.
This dependency is mandatory for testcontainers.

* <p>
* See <a href="https://github.com/jenkinsci/pipeline-cloudwatch-logs-plugin/blob/pipeline-cloudwatch-logs-0.2/src/main/java/io/jenkins/plugins/pipeline_cloudwatch_logs/PipelineBridge.java">Pipeline Cloudwatch Logs - PipelineBridge</a>
*/
@Extension
Copy link
Owner Author

Choose a reason for hiding this comment

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

With the Describable/Descriptor pattern, the @Extension is not needed anymore on the factory.

Comment on lines +51 to +53
jenkinsControllerOpenTelemetry = JenkinsControllerOpenTelemetry.get();
otelTraceService = OtelTraceService.get();
tracer = jenkinsControllerOpenTelemetry.getDefaultTracer();
Copy link
Owner Author

@jgreffe jgreffe Aug 5, 2025

Choose a reason for hiding this comment

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

Let's instantiate everything once in the constructor without @Inject.
No NPE issue as everything comes from @Extension singleton instances.

Comment on lines -94 to -103
/**
* Workaround dependency injection problem. @Inject doesn't work here
*/
@NonNull
private JenkinsControllerOpenTelemetry getJenkinsControllerOpenTelemetry() {
if (jenkinsControllerOpenTelemetry == null) {
jenkinsControllerOpenTelemetry = JenkinsControllerOpenTelemetry.get();
@Extension()
@Symbol("opentelemetry")
public static final class DescriptorImpl extends LogStorageFactoryDescriptor<OtelLogStorageFactory> {
@NonNull
@Override
public String getDisplayName() {
return "Open Telemetry";
}
return jenkinsControllerOpenTelemetry;
}
Copy link
Owner Author

@jgreffe jgreffe Aug 5, 2025

Choose a reason for hiding this comment

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

Useless internal private method

@PostConstruct
public void postConstruct() {
this.tracer = jenkinsControllerOpenTelemetry.getDefaultTracer();
}
Copy link
Owner Author

Choose a reason for hiding this comment

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

Useless internal private methods.

Comment on lines +94 to +96
@Extension()
@Symbol("opentelemetry")
public static final class DescriptorImpl extends LogStorageFactoryDescriptor<OtelLogStorageFactory> {
Copy link
Owner Author

@jgreffe jgreffe Aug 5, 2025

Choose a reason for hiding this comment

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

Describable/Descriptor pattern, the symbol "opentelemetry" is used for CasC configuration.

@NonNull
@Override
public String getDisplayName() {
return "Open Telemetry";
Copy link
Owner Author

@jgreffe jgreffe Aug 5, 2025

Choose a reason for hiding this comment

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

Displayed in the new "Pipeline logging" global UI configuration, see jenkinsci/workflow-api-plugin#417

Comment on lines +195 to +204
<exclusion>
<!-- provided by org.jenkins-ci.plugins:jackson2-api -->
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</exclusion>
<exclusion>
<!-- provided by org.jenkins-ci.plugins:jackson2-api -->
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
Copy link
Owner Author

@jgreffe jgreffe Aug 5, 2025

Choose a reason for hiding this comment

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

Fix some "require upper bounds" maven issues.

@jgreffe jgreffe closed this Aug 5, 2025
@jgreffe jgreffe deleted the adapt_wortkflow-api_chamges branch August 5, 2025 16:09
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.

2 participants