fix: do not fail builds when build-step span purge cannot find span#1241
fix: do not fail builds when build-step span purge cannot find span#1241Flamki wants to merge 3 commits into
Conversation
Wrap queue item collection in SYSTEM ACL for metrics callback so restricted anonymous contexts do not force jenkins.queue.count statuses to 0. Add a regression test for issue jenkinsci#1174 that verifies anonymous queue visibility is empty while metrics collection sees queued items.
|
Great fix @Flamki! This addresses a real pain point for users running A few observations after reviewing the changes:
All CI checks passing. This looks ready for review! |
|
Thanks for the suggestion and review. I’ve implemented it in commit I also re-ran |
|
Great update @Flamki! Adding the FINE-level log alongside the existing |
What problem does this solve?
Fixes build failures reported in #994 when OpenTelemetry cannot find a build-step span to purge (for example with promoted-builds/freestyle execution paths).
Before this change,
OtelTraceService.removeBuildStepSpan(...)threwIllegalStateExceptionunconditionally when the span action was missing. That exception propagates fromMonitoringBuildStepListener.finished(...)and can mark the build as failed.What changed?
OtelTraceService.removeBuildStepSpan(...)to:STRICT_MODEis disabled (default runtime behavior),STRICT_MODEis enabled (test/debug mode).OtelTraceServiceTestfor:How to test
./mvnw spotless:check ./mvnw -Dtest=OtelTraceServiceTest testBoth commands pass locally.
Breaking changes
None.
Notes
opentelemetry-api-pluginPR Add more attributes to the runs #45 and dependency1.49.0.99.vd48c9e6c4fa_b_, but the issue remains open administratively.