Skip to content

fix(ci): install dotnet from global.json#22

Merged
ANcpLua merged 1 commit into
mainfrom
codex/pin-dotnet-global-json
May 16, 2026
Merged

fix(ci): install dotnet from global.json#22
ANcpLua merged 1 commit into
mainfrom
codex/pin-dotnet-global-json

Conversation

@ANcpLua
Copy link
Copy Markdown
Owner

@ANcpLua ANcpLua commented May 16, 2026

Summary

  • use actions/setup-dotnet global-json-file so CI installs the SDK pinned by global.json
  • avoid floating 10.0.x SDK resolution drift

Validation

  • workflow YAML parsed locally with Ruby YAML loader
  • git diff --check passed for the workflow change

Copilot AI review requested due to automatic review settings May 16, 2026 03:47
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Updated backend CI workflow configuration for improved .NET setup consistency. No user-facing changes.

Walkthrough

Backend CI workflow now resolves .NET SDK version from a global.json file instead of hardcoding dotnet-version: 10.0.x. This centralizes version management to the repository's configuration file rather than duplicating it in the workflow.

Changes

CI .NET SDK Version Resolution

Layer / File(s) Summary
.NET setup via global.json
.github/workflows/ci.yml
Backend job's "Setup .NET 10" step switches from dotnet-version: 10.0.x to global-json-file: global.json, making SDK version resolution dependent on the repository's global.json file.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested labels

area:infra

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating CI to install .NET from global.json instead of floating version specification.
Description check ✅ Passed The description clearly relates to the changeset, explaining the motivation (pinning SDK version, preventing drift) and validation steps performed.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/pin-dotnet-global-json
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch codex/pin-dotnet-global-json

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

@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the backend CI .NET setup step to install the SDK version defined by the repository’s global.json, reducing SDK version drift from the previously floating 10.0.x value.

Changes:

  • Replaces dotnet-version: 10.0.x with global-json-file: global.json in the CI workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Line 39: The workflow step named "Setup .NET 10" is misleading because the
actual SDK version is taken from global.json; rename the step title string
"Setup .NET 10" to something like "Setup .NET (from global.json)" or update
global.json to pin 10.x, and ensure any other references to the step title are
updated accordingly so the name accurately reflects where the version is
sourced.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f9d7ec66-7212-4343-a872-1522a4d7fc90

📥 Commits

Reviewing files that changed from the base of the PR and between fcea8a7 and 697035a.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: copilot-pull-request-reviewer
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Build & Test (backend)
🧰 Additional context used
📓 Path-based instructions (1)
.github/workflows/*.yml

📄 CodeRabbit inference engine (CLAUDE.md)

Omit the token: ${{ secrets.CODECOV_TOKEN }} line in codecov CI action for public repos with tokenless OIDC upload

Files:

  • .github/workflows/ci.yml
🔇 Additional comments (1)
.github/workflows/ci.yml (1)

42-42: ⚖️ Poor tradeoff

All concerns verified—global.json exists and is properly configured.

The global.json file exists at the repository root with valid syntax and specifies SDK version 10.0.300, which aligns with the step name "Setup .NET 10". The actions/setup-dotnet@v5 action fully supports the global-json-file parameter. This change intentionally pins the .NET SDK version to 10.0.300 instead of allowing patch-level flexibility (10.0.x), centralizing version management—a deliberate architectural choice rather than a silent behavior change.

Comment thread .github/workflows/ci.yml
@@ -39,7 +39,7 @@ jobs:
- name: Setup .NET 10
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Step name claims ".NET 10" but version now delegated to global.json.

If global.json specifies a different major version (e.g., 9.x or 11.x), the step name becomes misleading. Either verify global.json pins to 10.x or rename the step to reflect version delegation (e.g., "Setup .NET (from global.json)").

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml at line 39, The workflow step named "Setup .NET 10"
is misleading because the actual SDK version is taken from global.json; rename
the step title string "Setup .NET 10" to something like "Setup .NET (from
global.json)" or update global.json to pin 10.x, and ensure any other references
to the step title are updated accordingly so the name accurately reflects where
the version is sourced.

Copy link
Copy Markdown

@codacy-production codacy-production Bot left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR successfully updates the GitHub Actions CI workflow to manage the .NET SDK version via global.json instead of a hardcoded value. This change ensures environment consistency and aligns with best practices for preventing build drift. Codacy analysis indicates the changes are up to standards with no new quality issues.

The only recommended adjustment is a minor cleanup of the step label in the workflow file to reflect its dynamic nature. Additionally, ensure that global.json is present in the repository root to avoid workflow failures.

About this PR

  • The workflow now relies on global.json being present in the repository root. If this file is missing from the repository, the CI run will fail. Please confirm the file exists in the root.

Test suggestions

  • Verify the CI workflow correctly initializes the .NET SDK from the root global.json file.
  • Confirm that the NuGet cache key includes the global.json hash to trigger invalidation upon SDK changes.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

Comment thread .github/workflows/ci.yml
@@ -39,7 +39,7 @@ jobs:
- name: Setup .NET 10
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚪ LOW RISK

Nitpick: The step name 'Setup .NET 10' is now misleading because the SDK version is dynamically resolved from global.json. Consider renaming the step to a generic name like 'Setup .NET' or 'Setup .NET SDK' for better maintainability.

Suggested change
- name: Setup .NET 10
- name: Setup .NET

@ANcpLua ANcpLua merged commit 9da5146 into main May 16, 2026
6 of 7 checks passed
@ANcpLua ANcpLua deleted the codex/pin-dotnet-global-json branch May 16, 2026 04:27
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.

2 participants