From d071571450e24e040528470fcac34ca2dce81183 Mon Sep 17 00:00:00 2001 From: RicherTunes Date: Mon, 1 Jun 2026 09:10:09 -0400 Subject: [PATCH 1/2] fix(ci): build hostless in Governance Quarantine Visibility job The "Restore and build" step built the full plugin WITHOUT -p:SkipHostBridge, yet the job prepares only STUB host assemblies. Stub mode excludes LidarrNative/** while TidalModule still references it -> CS0234, which has failed the Governance run (Quarantined Test Visibility) since at least 2026-05-25. The job only runs State=Quarantined unit tests (no host-bridge needed), so build hostless to match the test-project step (-p:SkipHostBridge=true -p:ExcludeHostBridge=true). Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/governance.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/governance.yml b/.github/workflows/governance.yml index c9e2fe54..43bb8e3b 100644 --- a/.github/workflows/governance.yml +++ b/.github/workflows/governance.yml @@ -145,8 +145,13 @@ jobs: shell: bash run: | dotnet restore src/Tidalarr/Tidalarr.csproj + # Build hostless to match this job's intent (it only runs State=Quarantined + # *unit* tests, which don't need the host-bridge). Without SkipHostBridge the + # full plugin build excludes LidarrNative/** under stub host assemblies yet + # TidalModule still references it -> CS0234. Mirror the test-project step below. dotnet build src/Tidalarr/Tidalarr.csproj --configuration Release --no-restore \ - -p:RunAnalyzersDuringBuild=false -p:EnableNETAnalyzers=false + -p:RunAnalyzersDuringBuild=false -p:EnableNETAnalyzers=false \ + -p:SkipHostBridge=true -p:ExcludeHostBridge=true - name: Build test project (exclude HostBridge) shell: bash From 5ef94368d380182029165e4a3bafa2ca5e3dfcf8 Mon Sep 17 00:00:00 2001 From: RicherTunes Date: Mon, 1 Jun 2026 09:50:09 -0400 Subject: [PATCH 2/2] fix(ci): build Governance QTV job against real Lidarr host assemblies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "Quarantined Test Visibility" job prepared STUB host assemblies, which trip Directory.Build.props auto-detect into SkipHostBridge mode (no Lidarr.dll present) and exclude LidarrNative/**. TidalModule.cs imports the Tidalarr.Integration.LidarrNative namespace unconditionally, so stub mode fails with CS0234 — the plugin cannot build hostless. My prior attempt added -p:SkipHostBridge=true -p:ExcludeHostBridge=true, which excludes the folder while the dangling reference remained: still CS0234. Mirror the established real-host-assembly approach used by ci.yml, test-and-coverage.yml, and nightly.yml (and the fix/nightly-real-host-assemblies fix): replace the stub-prep step with the Docker-extract of ghcr.io/hotio/lidarr:pr-plugins-3.1.2.4913 into ext/Lidarr/_output/net8.0, then build the FULL plugin and test project (incl. the LidarrNative host-bridge) with no SkipHostBridge/ExcludeHostBridge. Drop -p:SkipHostBridge from the test-run step so build and run stay internally consistent (run is --no-build). Validated locally: full plugin + test project build with 0 errors against the extracted assemblies; `dotnet test --no-build --filter State=Quarantined` discovers cleanly (0 matches, exit 0). Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/governance.yml | 44 ++++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/governance.yml b/.github/workflows/governance.yml index 43bb8e3b..cb4e6e73 100644 --- a/.github/workflows/governance.yml +++ b/.github/workflows/governance.yml @@ -128,38 +128,39 @@ jobs: restore-keys: | ${{ runner.os }}-nuget- - - name: Prepare host stub assemblies - shell: pwsh + - name: Setup Lidarr host assemblies (Docker, plugins branch) + shell: bash run: | - $commonScripts = Join-Path $PWD 'ext/Lidarr.Plugin.Common/scripts' - $hostOutput = Join-Path $PWD 'ext/Lidarr/_output/net8.0' - if (Test-Path $commonScripts) { - $prepareStub = Join-Path $commonScripts 'prepare-host-stub.ps1' - if (Test-Path $prepareStub) { - Write-Host "Generating host stub assemblies..." - & $prepareStub -OutputPath $hostOutput - } - } + set -e + mkdir -p ext/Lidarr/_output/net8.0 + if ! docker --version >/dev/null 2>&1; then echo "::error::Docker required to fetch Lidarr host assemblies"; exit 1; fi + IMAGE="ghcr.io/hotio/lidarr:pr-plugins-3.1.2.4913" + n=0; until docker pull "$IMAGE"; do n=$((n+1)); if [ "$n" -ge 3 ]; then echo "::error::docker pull failed after $n attempts ($IMAGE)"; exit 1; fi; echo "pull failed ($n), retry in 10s"; sleep 10; done + cid=$(docker create "$IMAGE") + docker cp "$cid:/app" ext/Lidarr/_extracted || docker cp "$cid:/opt/lidarr" ext/Lidarr/_extracted + docker rm "$cid" >/dev/null + find ext/Lidarr/_extracted -type f -name "*.dll" -exec cp {} ext/Lidarr/_output/net8.0 \; + test -f ext/Lidarr/_output/net8.0/Lidarr.dll || { echo "::error::Lidarr.dll missing after extraction"; exit 1; } + echo "Extracted $(ls ext/Lidarr/_output/net8.0/*.dll | wc -l) host assemblies" - name: Restore and build shell: bash run: | dotnet restore src/Tidalarr/Tidalarr.csproj - # Build hostless to match this job's intent (it only runs State=Quarantined - # *unit* tests, which don't need the host-bridge). Without SkipHostBridge the - # full plugin build excludes LidarrNative/** under stub host assemblies yet - # TidalModule still references it -> CS0234. Mirror the test-project step below. + # Build the FULL plugin (incl. LidarrNative host-bridge) against the real + # Lidarr host assemblies extracted above. TidalModule.cs references the + # LidarrNative namespace unconditionally, so the host-bridge cannot be + # excluded — SkipHostBridge stub mode would drop LidarrNative/** and break + # with CS0234. Mirrors ci.yml / test-and-coverage.yml / nightly.yml. dotnet build src/Tidalarr/Tidalarr.csproj --configuration Release --no-restore \ - -p:RunAnalyzersDuringBuild=false -p:EnableNETAnalyzers=false \ - -p:SkipHostBridge=true -p:ExcludeHostBridge=true + -p:RunAnalyzersDuringBuild=false -p:EnableNETAnalyzers=false - - name: Build test project (exclude HostBridge) + - name: Build test project shell: bash run: | dotnet build tests/Tidalarr.Tests/Tidalarr.Tests.csproj \ --configuration Release -v minimal \ - -p:RunAnalyzersDuringBuild=false -p:EnableNETAnalyzers=false \ - -p:SkipHostBridge=true -p:ExcludeHostBridge=true + -p:RunAnalyzersDuringBuild=false -p:EnableNETAnalyzers=false - name: Run quarantined tests (visibility) continue-on-error: true @@ -172,8 +173,7 @@ jobs: --blame-hang-timeout 60s \ --logger "trx;LogFileName=quarantined.trx" \ --results-directory ./TestResults \ - -p:PluginPackagingDisable=true \ - -p:SkipHostBridge=true + -p:PluginPackagingDisable=true - name: Report quarantine count if: always()