Skip to content

Comments

fix: make release sync_beta deterministic and bump beta post-release#713

Merged
dsarno merged 3 commits intoCoplayDev:betafrom
dsarno:fix/release-sync-beta-postrelease-v3
Feb 10, 2026
Merged

fix: make release sync_beta deterministic and bump beta post-release#713
dsarno merged 3 commits intoCoplayDev:betafrom
dsarno:fix/release-sync-beta-postrelease-v3

Conversation

@dsarno
Copy link
Collaborator

@dsarno dsarno commented Feb 10, 2026

What this PR does

1) release.yml sync back to beta is deterministic

  • sync_beta now creates a dedicated sync branch from beta, then merges main into it in CI.
  • Expected version-file conflicts are resolved deterministically by keeping beta values for:
    • MCPForUnity/package.json
    • Server/pyproject.toml
  • Sync merge no longer depends on repository auto-merge being enabled; it retries direct merge while checks settle.

2) Post-release beta version is explicitly bumped

  • After releasing X.Y.Z on main, sync sets beta to X.Y.(Z+1)-beta.1.
  • Example:
    • before release: beta = 9.4.1-beta.6
    • release on main: 9.4.1
    • after sync: beta = 9.4.2-beta.1

3) Client dropdown persistence is fixed

  • Selection persistence now resolves using the dropdown newValue (instead of relying on a potentially stale index during callbacks).
  • Restoring selection supports stable Id matching and normalized fallback matching for compatibility.
  • LastSelectedClientId is now visible in the EditorPrefs inspector window for debugging.

4) Update notification feature is wired back up and branch-aware

  • The update banner in MCPForUnityEditorWindow is now actively driven by PackageUpdateService.
  • Checks are queued/debounced on window init/refresh.
  • Git package update source is branch-aware:
    • package installed from #main checks GitHub main
    • package installed from #beta (or prerelease fallback) checks GitHub beta
  • Version comparison now handles prerelease SemVer forms (-beta.N, -alpha.N, -rc.N, etc.).

Why

  • main -> beta PRs were frequently unmergeable due to intentional version divergence.
  • Auto-merge repository settings may be disabled, which caused sync jobs to stall/fail.
  • Client selection persistence and update notifications had regressions in the editor UX.

Validation notes

  • Changes were verified by code-path inspection and branch/PR flow checks.
  • Unity runtime/editor test execution was not run in this environment.

Summary by CodeRabbit

  • New Features

    • Added automatic update checks for beta channel releases with improved version detection.
  • Bug Fixes

    • Improved client configuration persistence and selection handling.
  • Chores

    • Enhanced release workflow reliability for beta branch synchronization.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 10, 2026

Reviewer's Guide

Updates the release sync_beta job to merge main into a temporary branch off beta with deterministic conflict handling for version files, bump beta’s MCPForUnity/package.json to the next patch prerelease after a release, and make the sync PR creation/merge more robust and auto-merge friendly.

Sequence diagram for updated sync_beta workflow interactions

sequenceDiagram
  participant Workflow as sync_beta_job
  participant Git as Git_CLI
  participant GH as GitHub_CLI
  participant Repo as GitHub_Repo
  participant PR as Sync_PR

  Workflow->>Git: checkout beta (actions/checkout)
  Workflow->>Git: fetch origin main beta
  Git-->>Workflow: branches main, beta

  Workflow->>Git: merge-base --is-ancestor origin/main origin/beta
  alt beta up to date
    Git-->>Workflow: true
    Workflow->>Workflow: mark skipped=true
  else beta behind main
    Git-->>Workflow: false
    Workflow->>Git: create branch sync/main-vNEW_VERSION-into-beta-RUN_ID from origin/beta
    Workflow->>Git: merge origin/main --no-ff --no-commit
    alt merge clean
      Git-->>Workflow: success
    else merge conflicts
      Git-->>Workflow: conflicts
      Workflow->>Git: list conflicted files
      Workflow->>Git: for each version file
      Workflow->>Git: git checkout --ours MCPForUnity/package.json
      Workflow->>Git: git checkout --ours Server/pyproject.toml
      Workflow->>Git: git add version files
      Workflow->>Git: ensure no remaining conflicts
    end
    Workflow->>Git: git commit chore: sync main (vNEW_VERSION) into beta

    Workflow->>Workflow: compute NEXT_BETA_VERSION = X.Y.(Z+1)-beta.1
    Workflow->>Repo: read MCPForUnity/package.json version
    alt version != NEXT_BETA_VERSION
      Repo-->>Workflow: current beta version
      Workflow->>Repo: update package.json version to NEXT_BETA_VERSION
      Workflow->>Git: git add MCPForUnity/package.json
      Workflow->>Git: git commit chore: set beta version to NEXT_BETA_VERSION
    else version already correct
      Repo-->>Workflow: NEXT_BETA_VERSION
      Workflow->>Workflow: skip extra commit
    end

    Workflow->>Git: git push origin SYNC_BRANCH
    Git-->>Repo: push sync branch

    Workflow->>GH: gh pr create base=beta head=SYNC_BRANCH
    GH-->>PR: create PR with title and body
    PR-->>Workflow: pr_url, pr_number

    Workflow->>GH: gh pr merge PR_NUMBER --merge --auto --delete-branch
    alt auto merge succeeds
      GH-->>Workflow: PR merged
    else auto merge fails or pending checks
      loop up to 24 attempts
        Workflow->>GH: gh pr view PR_NUMBER --json state
        GH-->>Workflow: state (e.g. OPEN)
        alt state == MERGED
          Workflow->>Workflow: exit success
        else not merged yet
          Workflow->>GH: gh pr merge PR_NUMBER --merge --delete-branch
          alt direct merge succeeds
            GH-->>Workflow: PR merged
            Workflow->>Workflow: exit success
          else still not mergeable
            Workflow->>Workflow: sleep 5 seconds
          end
        end
      end
      Workflow->>GH: final view of PR state
      Workflow->>Workflow: fail job if PR not merged
    end
  end
Loading

File-Level Changes

Change Details Files
Sync beta via a temporary branch created from beta that merges main with deterministic conflict resolution for version files.
  • Change checkout step to use beta as the base branch for the sync job instead of main.
  • Fetch both main and beta and short‑circuit if beta already contains main.
  • Create a uniquely named sync branch from origin/beta and record its name and skipped status as step outputs.
  • Attempt a non‑fast‑forward, no‑commit merge of origin/main into the sync branch, resolving expected conflicts by always keeping the beta side for MCPForUnity/package.json and Server/pyproject.toml, and failing if any other conflicts remain.
  • Commit the merge result with a standardized sync commit message and push the sync branch to origin.
.github/workflows/release.yml
Automatically bump beta’s MCPForUnity/package.json version to the next patch beta after a main release as part of the sync branch preparation.
  • Parse NEW_VERSION into major, minor, and patch components, compute the next patch, and build a NEXT_BETA_VERSION string of the form X.Y.(Z+1)-beta.1.
  • Expose NEXT_BETA_VERSION as a beta_version output from the sync preparation step.
  • Read the current beta version from MCPForUnity/package.json via jq, and update and commit it only if it differs from NEXT_BETA_VERSION.
  • Include the new beta version information in the sync PR body for transparency.
.github/workflows/release.yml
Create and merge the sync PR from the temporary branch into beta in a more robust, auto-merge-capable way.
  • Change the sync PR base/head to merge the temporary sync branch into beta instead of main directly into beta.
  • Use the sync_branch step outputs (branch name and beta_version) as inputs to the PR creation step and include descriptive PR messaging.
  • On merge, first attempt an auto-merge with branch deletion, then poll for up to ~2 minutes, retrying direct merges until the PR is merged or timing out with diagnostic output.
  • Delete the sync branch on successful merges to keep the repository clean.
.github/workflows/release.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Implements beta-aware package update checks in the Unity editor, makes client-config dropdown matching more robust, registers an EditorPref key, and overhauls the release workflow to sync main→beta via a dedicated sync branch with merge conflict handling, version preservation/bump, PR creation, resilient auto-merge polling, tagging, and cleanup.

Changes

Cohort / File(s) Summary
Release workflow
.github/workflows/release.yml
Replaces direct main→beta PR with a sync-branch flow: base from beta, fetch/compare branches, create sync/main-v<NEW_VERSION>-into-beta-<RUN_ID>, perform no-FF merge of origin/main into sync branch, preserve beta prerelease entries on conflicts, commit, compute/persist next beta version, push branch, create PR → beta, attempt auto-merge with polling/retries, tag release and clean temp branches.
Package update service (beta support)
MCPForUnity/Editor/Services/PackageUpdateService.cs
Adds beta-aware cache keys and branch selection, branch-parameterized GitHub fetch, semantic version parser/comparer with prerelease ranking, IsNewerVersion API, branch-detection logic for Git installs, and clears beta-specific cache keys.
Editor UI: update checks & prefs
MCPForUnity/Editor/Windows/MCPForUnityEditorWindow.cs, MCPForUnity/Editor/Windows/EditorPrefs/EditorPrefsWindow.cs
Adds debounced/queued package update check integration into the editor window lifecycle and registers LastSelectedClientId as a string EditorPrefs key for editing.
Client config dropdown resilience
MCPForUnity/Editor/Windows/Components/ClientConfig/McpClientConfigSection.cs
Replaces brittle index restoration with helpers (FindConfiguratorIndex, GetIndexForDropdownValue, NormalizeClientToken) to robustly map persisted client IDs/display names to dropdown indices and guard against invalid selections.

Sequence Diagram

sequenceDiagram
    actor Workflow as GitHub Workflow
    participant Git as Git
    participant MergeHandler as MergeHandler
    participant Versioner as Versioner
    participant PR as PR Service

    Workflow->>Git: fetch origin/main and origin/beta
    Git-->>Workflow: branches fetched
    Workflow->>Git: compare commits (is beta behind main?)
    alt beta up-to-date
        Workflow->>Workflow: skip sync
    else beta behind
        Workflow->>Git: create SYNC_BRANCH from origin/beta
        Git-->>Workflow: SYNC_BRANCH created
        Workflow->>Git: merge origin/main into SYNC_BRANCH (no-ff, no-commit)
        Git-->>MergeHandler: conflict? 
        alt conflicts
            MergeHandler->>MergeHandler: preserve beta prerelease entries (package.json/pyproject)
            MergeHandler->>Git: stage resolved files / abort if unresolved
        else clean merge
            Git-->>Workflow: merge successful
        end
        Workflow->>Versioner: compute next beta version (X.Y.(Z+1)-beta.1)
        Versioner-->>Workflow: updated files
        Workflow->>Git: push SYNC_BRANCH
        Workflow->>PR: create PR (SYNC_BRANCH → beta) with NEXT_BETA_VERSION output
        PR-->>Workflow: PR created
        Workflow->>PR: attempt auto-merge
        alt auto-merge fails
            PR->>PR: poll for mergeability / retry direct merge (up to ~2 min)
        end
        PR-->>Workflow: PR merged
        Workflow->>Git: fetch main, create release tag, delete temp branches
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I nudged main into beta, branch by branch,

Kept the pre-release carrots when conflicts ran amok,
Bumped a tiny patch, then pushed and made a PR,
Polled and merged until the tag was put in place,
A hop, a merge, a tidy springtime sync.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: making the release sync_beta process deterministic and bumping the beta version post-release.
Description check ✅ Passed The pull request description comprehensively covers all required sections with clear explanations of changes, rationale, and validation approach.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/release.yml:
- Around line 377-385: The workflow updates MCPForUnity/package.json to
NEXT_BETA_VERSION but does not update Server/pyproject.toml, causing a mismatch;
modify the release job to also parse NEXT_BETA_VERSION into a PEP 440 prerelease
string and inline-update Server/pyproject.toml (do not call
tools/update_versions.py), e.g., read NEXT_BETA_VERSION, convert the semver
prerelease suffix into PEP 440 format, replace the version field in
Server/pyproject.toml accordingly, git add/commit the file along with
MCPForUnity/package.json, and ensure commit message references NEW_VERSION and
NEXT_BETA_VERSION for clarity.
🧹 Nitpick comments (2)
.github/workflows/release.yml (2)

342-342: Nit: -m message is ignored when --no-commit is used.

The commit message on this line is never used because --no-commit prevents the merge from committing. The actual commit message is supplied on line 368. Consider removing -m "..." here to avoid confusion.

Suggested diff
-          if git merge origin/main --no-ff --no-commit -m "chore: sync main (v${NEW_VERSION}) into beta"; then
+          if git merge origin/main --no-ff --no-commit; then

410-441: Merge retry logic is solid; consider adding a sync branch cleanup step.

The retry pattern with direct merge attempts is a pragmatic approach given GitHub's eventually-consistent mergeability status. However, unlike the bump job (line 286–294) which has an if: always() cleanup step for its temporary branch, there's no equivalent here for the sync branch. If the merge fails at line 441, the branch and open PR remain.

This is acceptable since the branch name includes GITHUB_RUN_ID (no collisions) and leaving the PR open aids manual investigation — but adding a cleanup step would keep the repo tidy.

Optional: add cleanup step
      - name: Clean up sync branch
        if: always() && steps.sync_branch.outputs.skipped != 'true'
        env:
          GH_TOKEN: ${{ github.token }}
          SYNC_BRANCH: ${{ steps.sync_branch.outputs.name }}
        shell: bash
        run: |
          set -euo pipefail
          git push origin --delete "$SYNC_BRANCH" || true

Comment on lines +377 to +385
CURRENT_BETA_VERSION=$(jq -r '.version' MCPForUnity/package.json)
if [[ "$CURRENT_BETA_VERSION" != "$NEXT_BETA_VERSION" ]]; then
jq --arg v "$NEXT_BETA_VERSION" '.version = $v' MCPForUnity/package.json > tmp.json
mv tmp.json MCPForUnity/package.json
git add MCPForUnity/package.json
git commit -m "chore: set beta version to ${NEXT_BETA_VERSION} after release v${NEW_VERSION}"
else
echo "Beta version already at target: $NEXT_BETA_VERSION"
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

echo "=== Check Server/pyproject.toml version format ==="
if [ -f "Server/pyproject.toml" ]; then
  cat -n Server/pyproject.toml | head -40
else
  echo "File not found at Server/pyproject.toml"
fi

Repository: CoplayDev/unity-mcp

Length of output: 1835


🏁 Script executed:

#!/bin/bash

echo "=== Check tools/update_versions.py ==="
if [ -f "tools/update_versions.py" ]; then
  cat -n tools/update_versions.py
else
  echo "File not found at tools/update_versions.py"
fi

Repository: CoplayDev/unity-mcp

Length of output: 11660


🏁 Script executed:

#!/bin/bash

echo "=== Examine the sync_beta job in .github/workflows/release.yml ==="
if [ -f ".github/workflows/release.yml" ]; then
  # Get lines around 370-388 for full context
  sed -n '350,400p' .github/workflows/release.yml | cat -n
else
  echo "Workflow file not found"
fi

Repository: CoplayDev/unity-mcp

Length of output: 2653


🏁 Script executed:

#!/bin/bash

echo "=== Check if there are any other version management patterns ==="
rg -n "version\s*=" --type toml --type json | head -20

Repository: CoplayDev/unity-mcp

Length of output: 169


Server/pyproject.toml is not updated to the next beta version, creating a version mismatch on the beta branch.

After this step, MCPForUnity/package.json will be set to X.Y.(Z+1)-beta.1, but Server/pyproject.toml will remain at the release version X.Y.Z. Both files should be updated consistently.

Note: tools/update_versions.py is designed for release versions only and does not support prerelease formats, so it cannot be used directly here. Instead, manually update pyproject.toml with the proper PEP 440 prerelease format.

Suggested fix: also update pyproject.toml
          CURRENT_BETA_VERSION=$(jq -r '.version' MCPForUnity/package.json)
          if [[ "$CURRENT_BETA_VERSION" != "$NEXT_BETA_VERSION" ]]; then
            jq --arg v "$NEXT_BETA_VERSION" '.version = $v' MCPForUnity/package.json > tmp.json
            mv tmp.json MCPForUnity/package.json
            git add MCPForUnity/package.json
+
+           # Keep pyproject.toml in sync (PEP 440 prerelease format)
+           PYPI_BETA_VERSION="${MAJOR}.${MINOR}.${NEXT_PATCH}b1"
+           sed -i "s/^version = .*/version = \"${PYPI_BETA_VERSION}\"/" Server/pyproject.toml
+           git add Server/pyproject.toml
+
            git commit -m "chore: set beta version to ${NEXT_BETA_VERSION} after release v${NEW_VERSION}"
          else
            echo "Beta version already at target: $NEXT_BETA_VERSION"
          fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
CURRENT_BETA_VERSION=$(jq -r '.version' MCPForUnity/package.json)
if [[ "$CURRENT_BETA_VERSION" != "$NEXT_BETA_VERSION" ]]; then
jq --arg v "$NEXT_BETA_VERSION" '.version = $v' MCPForUnity/package.json > tmp.json
mv tmp.json MCPForUnity/package.json
git add MCPForUnity/package.json
git commit -m "chore: set beta version to ${NEXT_BETA_VERSION} after release v${NEW_VERSION}"
else
echo "Beta version already at target: $NEXT_BETA_VERSION"
fi
CURRENT_BETA_VERSION=$(jq -r '.version' MCPForUnity/package.json)
if [[ "$CURRENT_BETA_VERSION" != "$NEXT_BETA_VERSION" ]]; then
jq --arg v "$NEXT_BETA_VERSION" '.version = $v' MCPForUnity/package.json > tmp.json
mv tmp.json MCPForUnity/package.json
git add MCPForUnity/package.json
# Keep pyproject.toml in sync (PEP 440 prerelease format)
PYPI_BETA_VERSION="${MAJOR}.${MINOR}.${NEXT_PATCH}b1"
sed -i "s/^version = .*/version = \"${PYPI_BETA_VERSION}\"/" Server/pyproject.toml
git add Server/pyproject.toml
git commit -m "chore: set beta version to ${NEXT_BETA_VERSION} after release v${NEW_VERSION}"
else
echo "Beta version already at target: $NEXT_BETA_VERSION"
fi
🤖 Prompt for AI Agents
In @.github/workflows/release.yml around lines 377 - 385, The workflow updates
MCPForUnity/package.json to NEXT_BETA_VERSION but does not update
Server/pyproject.toml, causing a mismatch; modify the release job to also parse
NEXT_BETA_VERSION into a PEP 440 prerelease string and inline-update
Server/pyproject.toml (do not call tools/update_versions.py), e.g., read
NEXT_BETA_VERSION, convert the semver prerelease suffix into PEP 440 format,
replace the version field in Server/pyproject.toml accordingly, git add/commit
the file along with MCPForUnity/package.json, and ensure commit message
references NEW_VERSION and NEXT_BETA_VERSION for clarity.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@MCPForUnity/Editor/Services/PackageUpdateService.cs`:
- Around line 120-143: GetPrereleaseRank currently returns 5 for unknown labels
which incorrectly ranks unrecognized prerelease labels above rc; change the
switch default in GetPrereleaseRank to return 0 so unknown labels sort
conservatively below alpha/beta/rc (keep the existing check for null/empty
returning 0). Update any comment or docstring near GetPrereleaseRank if present
to reflect that unknown prerelease labels are treated as lowest priority.
🧹 Nitpick comments (2)
MCPForUnity/Editor/Services/PackageUpdateService.cs (1)

145-187: Consider caching the compiled Regex as a static field.

TryParseVersion recompiles the regex on each call. While not a hot path today, a static readonly Regex with RegexOptions.Compiled is a low-effort improvement that prevents future performance surprises if call frequency increases.

Proposed refactor
+        private static readonly Regex VersionRegex = new Regex(
+            @"^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(?:-(?<label>[A-Za-z]+)(?:\.(?<number>\d+))?)?$",
+            RegexOptions.Compiled);
+
         private static bool TryParseVersion(string version, out ParsedVersion parsed)
         {
             parsed = default;
             if (string.IsNullOrWhiteSpace(version))
             {
                 return false;
             }
 
             string normalized = version.Trim().TrimStart('v', 'V');
-            var match = Regex.Match(
-                normalized,
-                @"^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(?:-(?<label>[A-Za-z]+)(?:\.(?<number>\d+))?)?$");
+            var match = VersionRegex.Match(normalized);
MCPForUnity/Editor/Windows/MCPForUnityEditorWindow.cs (1)

325-328: QueueUpdateCheck() on line 327 is redundant — RefreshAllData() on line 326 already calls it.

The dedup guard makes this harmless, but the explicit call reads as intentional when it's actually a no-op. Consider removing it to avoid confusion.

Proposed cleanup
             // Initial updates
             RefreshAllData();
-            QueueUpdateCheck();
         }

Comment on lines +120 to +143
private static int GetPrereleaseRank(string label)
{
if (string.IsNullOrEmpty(label))
{
return 0;
}

switch (label.ToLowerInvariant())
{
case "a":
case "alpha":
return 1;
case "b":
case "beta":
return 2;
case "rc":
return 3;
case "preview":
case "pre":
return 4;
default:
return 5;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Default prerelease rank of 5 for unrecognized labels ranks them higher than rc.

Unknown prerelease labels (e.g., a typo like "gama") would be treated as newer than rc.1, which is counterintuitive. Consider using a lower default (e.g., 0) so unrecognized labels sort conservatively below alpha.

Proposed fix
                 default:
-                    return 5;
+                    return 0;
🤖 Prompt for AI Agents
In `@MCPForUnity/Editor/Services/PackageUpdateService.cs` around lines 120 - 143,
GetPrereleaseRank currently returns 5 for unknown labels which incorrectly ranks
unrecognized prerelease labels above rc; change the switch default in
GetPrereleaseRank to return 0 so unknown labels sort conservatively below
alpha/beta/rc (keep the existing check for null/empty returning 0). Update any
comment or docstring near GetPrereleaseRank if present to reflect that unknown
prerelease labels are treated as lowest priority.

@dsarno dsarno merged commit aa0cde5 into CoplayDev:beta Feb 10, 2026
1 of 2 checks passed
@dsarno dsarno deleted the fix/release-sync-beta-postrelease-v3 branch February 13, 2026 04:28
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