Skip to content

fix: unify licensing precedence across platforms, warn on ambiguity - #256

Merged
frostebite merged 1 commit into
mainfrom
fix/unify-licensing-precedence
Sep 9, 2026
Merged

fix: unify licensing precedence across platforms, warn on ambiguity#256
frostebite merged 1 commit into
mainfrom
fix/unify-licensing-precedence

Conversation

@frostebite

Copy link
Copy Markdown
Member

Summary

Two related changes to how UNITY_LICENSING_METHOD auto-resolution works, both aimed at the same root problem: two real regressions (#254, #255) took multiple rounds to fully diagnose because nothing said out loud which of several plausible activation strategies actually got used, and the four platform scripts didn't even agree with each other about which one that should be.

1. Unify precedence across all four platform scripts

ubuntu, mac and windows/steps already agreed: file -> serial -> floating -> personal. The windows container script set diverged in two ways that predated this session entirely:

  • it checked floating before serial
  • its catch-all attempted a doomed serial activation with whatever credentials happened to be set (including none at all) instead of the same clear "could not be determined" guidance the other three already gave

Aligned the minority to the majority rather than the reverse, so this only changes behaviour for the narrow edge cases where the old windows-container-only order actually mattered:

  • a build that set both a complete serial triple and a licensing server (took floating, now takes serial, matching every other platform)
  • a build with no usable credentials at all (previously ran Unity with empty -serial/-username/-password and failed with Unity's generic error, now gets the same guidance message every other platform already gives)

2. Warn out loud on ambiguous auto-resolution

Whenever a credential naming a specific strategy (a .ulf, a real serial, a licensing server) is silently overridden by a different auto-resolved strategy, this now says so. Purely additive - it changes no resolution outcome on any platform, just makes an already-surprising outcome visible in the log instead of only discoverable by reading source. An explicit --unityLicensingMethod is never second-guessed and never triggers it.

Test plan

  • scripts/test-licensing-steps.ps1 is a new sibling of the existing bash suite, covering both Windows script sets end-to-end - no PowerShell test harness existed for them before this, and a syntax check alone would not have caught a mistake in the precedence change. Wired into tests.yml; pwsh is preinstalled on ubuntu-latest, so no Windows runner is needed.
  • bash scripts/test-licensing-steps.sh - 37/37 pass (32 existing + 5 new ambiguity-warning cases)
  • pwsh scripts/test-licensing-steps.ps1 - 30/30 pass (precedence, return-strategy, and ambiguity-warning cases, run against both windows script sets)
  • bash scripts/validate-platform-scripts.sh - clean
  • bun test ./src/logic/unity/license/licensing-method.test.ts - 15/15 pass
  • bun test ./src - same 2 pre-existing, unrelated failures as clean main (confirmed via stash-and-compare), no regressions
  • node scripts/generate-embedded-assets.mjs --check - clean after regenerating for the dist/ changes

🤖 Generated with Claude Code

Two related changes to how UNITY_LICENSING_METHOD auto-resolution
works, both aimed at the same root problem: two real regressions
(#254, #255) took multiple rounds to fully diagnose because nothing
said out loud which of several plausible activation strategies
actually got used, and the four platform scripts didn't even agree
with each other about which one that should be.

1. Unify precedence across all four platform scripts. ubuntu, mac and
   windows/steps already agreed: file -> serial -> floating -> personal.
   The windows *container* script set diverged in two ways that
   predated this session entirely: it checked floating before serial,
   and its catch-all attempted a doomed serial activation with
   whatever credentials happened to be set (including none at all)
   instead of the same clear "could not be determined" guidance the
   other three already gave. Aligned the minority to the majority
   rather than the reverse, so this only changes behaviour for the
   narrow edge cases where the old windows-container-only order
   actually mattered: a build that set both a complete serial triple
   and a licensing server (took floating, now takes serial, matching
   every other platform), or one with no usable credentials at all
   (previously ran Unity with empty -serial/-username/-password and
   failed with Unity's generic error, now gets the same guidance
   message every other platform already gives).

2. Warn out loud whenever a credential naming a *specific* strategy
   (a .ulf, a real serial, a licensing server) is silently overridden
   by a different auto-resolved strategy. This is purely additive -
   it changes no resolution outcome on any platform, just makes an
   already-surprising outcome visible in the log instead of only
   discoverable by reading source. An explicit --unityLicensingMethod
   is never second-guessed and never triggers it.

New test coverage: scripts/test-licensing-steps.ps1 is a new sibling
of the existing bash suite, covering both Windows script sets
end-to-end (no PowerShell test harness existed for them before this -
a syntax check alone would not have caught a mistake in the precedence
change). Wired into tests.yml; pwsh is preinstalled on ubuntu-latest,
so no Windows runner is needed. 5 new bash cases and 30 new PowerShell
cases cover the warning and the unified precedence directly.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 33 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: f0d2b45c-a9ee-4ee3-8708-7908451148a2

📥 Commits

Reviewing files that changed from the base of the PR and between 533fdd0 and d5442c4.

⛔ Files ignored due to path filters (5)
  • dist/platforms/mac/steps/licensing_method.sh is excluded by !**/dist/**
  • dist/platforms/ubuntu/steps/licensing_method.sh is excluded by !**/dist/**
  • dist/platforms/windows/licensing_method.ps1 is excluded by !**/dist/**
  • dist/platforms/windows/steps/licensing_method.ps1 is excluded by !**/dist/**
  • src/generated/embedded-assets.ts is excluded by !**/generated/**
📒 Files selected for processing (5)
  • .github/workflows/tests.yml
  • scripts/test-licensing-steps.ps1
  • scripts/test-licensing-steps.sh
  • src/logic/unity/license/licensing-method.test.ts
  • src/logic/unity/license/licensing-method.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@frostebite
frostebite merged commit a6d5c12 into main Sep 9, 2026
17 checks passed
@frostebite
frostebite deleted the fix/unify-licensing-precedence branch September 9, 2026 16:38
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.

1 participant