test: the updater digest check takes no later-SDK fallback on GitHub's runners #2543

Merged
mooki000 merged 1 commit from test/updater-net8-ci into main 2026-11-12 03:05:17 +00:00
mooki000 commented 2026-11-11 22:46:24 +00:00 (Migrated from github.com)

What this is for: on GitHub's runners the updater digest check must keep building for the builder's net8.0. Since #2294 it falls back to the SDK's own framework when the .NET 8 reference pack is missing. That is right on a PC with only a later SDK and wrong in CI, where it would hide a runner image without the pack, or an Updater.cs that no longer builds for .NET 8. This is the follow-up @Joey-Magnus suggested in his review of #2294. What is measured: on Linux with only the .NET 10 SDK (10.0.113): run as a PC the check passes through the fallback (20 cases); with GITHUB_ACTIONS=true it fails with dotnet's NU1100 output; main's file passes in that same situation. Not measured: a runner that really lacks the pack. This pull request's own jobs have .NET 8 installed, so they only show that the normal path is unchanged.

Problem

From the review of #2294: "on CI the fallback would hide exactly the regression the builder cares about. If a runner image ever drops the .NET 8 pack, or Updater.cs starts using an API newer than .NET 8, the check would quietly build for net10.0 and pass, while the real builder no longer compiles. CI only prints one line in that case."

What changed

  • tests/test_updater_asset_digest.py: when the net8.0 restore fails with NU1100 and GITHUB_ACTIONS is true, the check exits with a message and dotnet's output instead of switching the framework. GITHUB_ACTIONS == "true" is the test tests/run_all.py already uses to tell a runner from a PC. Everywhere else the fallback is unchanged.

How to try it

python -I -B tests/test_updater_asset_digest.py                       # a PC with only a later SDK: falls back, 20 passed
GITHUB_ACTIONS=true python -I -B tests/test_updater_asset_digest.py   # the same PC as a runner: fails with NU1100

How it was tested

Arch Linux, .NET SDK 10.0.113 only (no .NET 8 reference pack), head 2294f29d on main fa2b25b2.

File Environment Result
this branch GITHUB_ACTIONS unset the fallback's line, then Updater digest cases: 20 passed, 0 failed., exit 0
this branch GITHUB_ACTIONS=true on a GitHub runner the updater must build for the builder's net8.0, and its reference pack is missing: no fallback to a later framework here, then dotnet's NU1100 lines, exit 1
main's file GITHUB_ACTIONS=true falls back, 20 passed, exit 0 (what this change prevents)

Not tested

  • A real runner without .NET 8, and Windows on my side (no Windows machine).
  • --strict on a PC is unchanged: the fallback still applies there. The review named --strict as an alternative; run_all.py does not pass it on to a check, and GITHUB_ACTIONS is what it already reads.

Risks

  • A self-hosted runner (or a local runner tool) that sets GITHUB_ACTIONS=true without .NET 8 now fails this check instead of passing for a later framework. That is the intent.

Overlaps

  • #2373 touches the same file and merges cleanly with this change (git merge-tree).

Assisted-by: Claude Fable 5.2
Co-Authored-By: Claude Fable 5.2 [email protected]

**What this is for:** on GitHub's runners the updater digest check must keep building for the builder's `net8.0`. Since #2294 it falls back to the SDK's own framework when the .NET 8 reference pack is missing. That is right on a PC with only a later SDK and wrong in CI, where it would hide a runner image without the pack, or an `Updater.cs` that no longer builds for .NET 8. This is the follow-up @Joey-Magnus suggested in his review of #2294. **What is measured:** on Linux with only the .NET 10 SDK (10.0.113): run as a PC the check passes through the fallback (20 cases); with `GITHUB_ACTIONS=true` it fails with dotnet's NU1100 output; main's file passes in that same situation. **Not measured:** a runner that really lacks the pack. This pull request's own jobs have .NET 8 installed, so they only show that the normal path is unchanged. ## Problem From the review of #2294: "on CI the fallback would hide exactly the regression the builder cares about. If a runner image ever drops the .NET 8 pack, or `Updater.cs` starts using an API newer than .NET 8, the check would quietly build for net10.0 and pass, while the real builder no longer compiles. CI only prints one line in that case." ## What changed - `tests/test_updater_asset_digest.py`: when the `net8.0` restore fails with NU1100 and `GITHUB_ACTIONS` is `true`, the check exits with a message and dotnet's output instead of switching the framework. `GITHUB_ACTIONS == "true"` is the test `tests/run_all.py` already uses to tell a runner from a PC. Everywhere else the fallback is unchanged. ## How to try it ``` python -I -B tests/test_updater_asset_digest.py # a PC with only a later SDK: falls back, 20 passed GITHUB_ACTIONS=true python -I -B tests/test_updater_asset_digest.py # the same PC as a runner: fails with NU1100 ``` ## How it was tested Arch Linux, .NET SDK 10.0.113 only (no .NET 8 reference pack), head `2294f29d` on main `fa2b25b2`. | File | Environment | Result | |---|---|---| | this branch | `GITHUB_ACTIONS` unset | the fallback's line, then `Updater digest cases: 20 passed, 0 failed.`, exit 0 | | this branch | `GITHUB_ACTIONS=true` | `on a GitHub runner the updater must build for the builder's net8.0, and its reference pack is missing: no fallback to a later framework here`, then dotnet's NU1100 lines, exit 1 | | main's file | `GITHUB_ACTIONS=true` | falls back, 20 passed, exit 0 (what this change prevents) | ## Not tested - A real runner without .NET 8, and Windows on my side (no Windows machine). - `--strict` on a PC is unchanged: the fallback still applies there. The review named `--strict` as an alternative; `run_all.py` does not pass it on to a check, and `GITHUB_ACTIONS` is what it already reads. ## Risks - A self-hosted runner (or a local runner tool) that sets `GITHUB_ACTIONS=true` without .NET 8 now fails this check instead of passing for a later framework. That is the intent. ## Overlaps - #2373 touches the same file and merges cleanly with this change (`git merge-tree`). Assisted-by: Claude Fable 5.2 Co-Authored-By: Claude Fable 5.2 <[email protected]>
Commenting is not possible because the repository is archived.
No description provided.