From ca9f61ee55fe97055f91647b6af8c76ed00ecedc Mon Sep 17 00:00:00 2001 From: Sam Eagen Date: Fri, 27 Mar 2026 11:38:21 -0400 Subject: [PATCH] Ensure that PCT is installed and licenesed before checking if a pool is open. --- .github/workflows/build_and_test_full.yml | 2 +- .../+matlab/+buildtool/+plugins/OpenTelemetryPlugin.m | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_and_test_full.yml b/.github/workflows/build_and_test_full.yml index 5dda750..9e83030 100644 --- a/.github/workflows/build_and_test_full.yml +++ b/.github/workflows/build_and_test_full.yml @@ -5,7 +5,7 @@ on: push: branches: - main - - mbt-plugin + - pct-unavailable-fix env: MLM_LICENSE_TOKEN: ${{ secrets.MLM_LICENSE_TOKEN }} jobs: diff --git a/instrumentation/buildtool/+matlab/+buildtool/+plugins/OpenTelemetryPlugin.m b/instrumentation/buildtool/+matlab/+buildtool/+plugins/OpenTelemetryPlugin.m index 30730b8..c233b71 100644 --- a/instrumentation/buildtool/+matlab/+buildtool/+plugins/OpenTelemetryPlugin.m +++ b/instrumentation/buildtool/+matlab/+buildtool/+plugins/OpenTelemetryPlugin.m @@ -9,10 +9,12 @@ function runBuild(plugin, pluginData) % % Imperfect detection of parallel builds but % the impact of a false positive is very low - p = gcp("nocreate"); - if ~isempty(p) - warning("opentelemetry:buildtool:OpenTelemetryPlugin:NoParallelEmit", ... - "Tasks executed on parallel workers do not emit telemetry data."); + if matlab.internal.parallel.isPCTInstalled && matlab.internal.parallel.isPCTLicensed + p = gcp("nocreate"); + if ~isempty(p) + warning("opentelemetry:buildtool:OpenTelemetryPlugin:NoParallelEmit", ... + "Tasks executed on parallel workers do not emit telemetry data."); + end end % Configure by attaching to span if passed in via environment