Skip to content

fix: CLI updates use installer scripts from the selected release#1190

Merged
hatayama merged 3 commits into
v3-betafrom
feature/hatayama/use-release-installer-script
May 23, 2026
Merged

fix: CLI updates use installer scripts from the selected release#1190
hatayama merged 3 commits into
v3-betafrom
feature/hatayama/use-release-installer-script

Conversation

@hatayama

@hatayama hatayama commented May 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • CLI updates and Unity Settings installs now download installer scripts from the selected CLI release tag.
  • Release automation now verifies that the tagged installer scripts are reachable before publishing native CLI assets.

User Impact

  • Users can trust that the installer script matches the release version being installed, instead of depending on mutable main or v3-beta branch content.
  • A release now fails early if its tag does not expose the .ps1 and .sh installer scripts that updates will use.
  • Reviewers can see the sample versions in installer tests as fixtures, not as the current shipped version.

Changes

  • Build installer script URLs from the resolved CLI release tag in both Unity editor install commands and Go CLI self-updates.
  • Remove the stable/beta branch selector used only for installer script downloads.
  • Add a PowerShell release smoke helper that checks scripts/install.ps1 and scripts/install.sh under a specified release tag.
  • Run that helper in the native CLI publish workflow after the release tag exists and before asset upload.
  • Update editor and Go tests, clarify installer version fixtures, and regenerate checked-in native CLI binaries.

Verification

  • go test ./internal/update ./internal/cli
  • uloop compile
  • uloop run-tests --test-mode EditMode --filter-type regex --filter-value ".*NativeCliInstallerTests.*"
  • scripts/check-go-cli.sh
  • scripts/test-check-release-installer.ps1 on Windows PowerShell
  • scripts/test-check-release-installer.ps1 on pwsh
  • scripts/test-native-cli-publish-workflow.sh
  • scripts/check-release-installer.ps1 -Version cli-v3.0.0-beta.13
  • codex-review v3-beta with no accepted/actionable findings

Installer downloads must come from the selected CLI release so update
commands remain reproducible and do not depend on mutable branch refs.
This keeps Unity editor installs and Go CLI self-updates aligned with
the release asset version they install.
@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aa35d9ef-af3c-40d0-a149-a61e59182ebd

📥 Commits

Reviewing files that changed from the base of the PR and between b3d0768 and f8d66ef.

⛔ Files ignored due to path filters (2)
  • scripts/check-release-installer.ps1 is excluded by none and included by none
  • scripts/test-check-release-installer.ps1 is excluded by none and included by none
📒 Files selected for processing (4)
  • .github/workflows/build-and-test.yml
  • .github/workflows/native-cli-publish.yml
  • Assets/Tests/Editor/NativeCliInstallerTests.cs
  • scripts/test-native-cli-publish-workflow.sh

📝 Walkthrough

Walkthrough

Refactors CLI installer URL construction to use GitHub release tags (cli-v<version>) instead of branch references; removes branch/source-ref indirection; updates Go and C# implementations, tests, and CI to validate release-tagged installer script URLs.

Changes

CLI Installer URL Release-Tag Refactoring

Layer / File(s) Summary
Go installer implementation refactor
Packages/src/Cli~/internal/update/installer.go
Removes the SourceRefForVersion helper and branch/source-ref constants; updates ScriptURL to build download paths using ReleaseTag(version) directly.
C# installer URL construction
Packages/src/Editor/Infrastructure/CLI/NativeCliInstaller.cs
BuildInstallerScriptUrl now inserts the provided releaseTag into the RAW_CONTENT_BASE_URL path directly, removing the indirection via SelectInstallerSourceRef.
Remove unused CLI constants
Packages/src/Editor/Domain/CliConstants.cs
Deletes STABLE_INSTALLER_SOURCE_REF and BETA_INSTALLER_SOURCE_REF public constants no longer used by URL construction.
Update Go and C# tests
Packages/src/Cli~/internal/update/installer_test.go, Packages/src/Cli~/internal/cli/update_test.go, Assets/Tests/Editor/NativeCliInstallerTests.cs
Tests now expect installer script URLs under cli-v<version>/scripts/ (e.g., cli-v3.0.0-beta.3/.../install.sh, cli-v3.0.0/.../install.ps1) and centralize test release/version constants.
CI/workflow and release verification
.github/workflows/build-and-test.yml, .github/workflows/native-cli-publish.yml, scripts/test-native-cli-publish-workflow.sh
Load new PowerShell helper/test scripts in the Windows test step, add a conditional publish-time step to run scripts/check-release-installer.ps1 with RELEASE_TAG, and add shell tests that assert the workflow contains and orders this verification step.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • hatayama/unity-cli-loop#1081: Both PRs move native installer script URL resolution from branch-based (v3-beta/main) to release-tag-based (cli-v<version>) paths.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately describes the main change: CLI updates now use installer scripts from the selected release rather than mutable branch references.
Description check ✅ Passed The description thoroughly explains the changes, user impact, and verification steps, directly relating to the PR's goal of fixing CLI updates to use release-tagged installer scripts.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/hatayama/use-release-installer-script

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 and usage tips.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 9 files

Re-trigger cubic

hatayama added 2 commits May 23, 2026 23:09
Name the sample CLI versions used by NativeCliInstaller tests so the
release URL assertions read as fixtures instead of current-version
hardcoding.
Provide a release-tag smoke helper so release automation can verify
that the selected CLI tag exposes the installer scripts consumed by
Unity Settings and CLI updates. Run it after creating the release tag
and before uploading assets so missing tagged scripts fail the release
workflow immediately.
@hatayama
hatayama merged commit 761a8c6 into v3-beta May 23, 2026
8 checks passed
@hatayama
hatayama deleted the feature/hatayama/use-release-installer-script branch May 23, 2026 15:23
@github-actions github-actions Bot mentioned this pull request May 23, 2026
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