fix(ci): install dotnet from global.json#22
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughBackend CI workflow now resolves .NET SDK version from a ChangesCI .NET SDK Version Resolution
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested labels
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
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.xwithglobal-json-file: global.jsonin the CI workflow.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
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
📒 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 tradeoffAll 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.
| @@ -39,7 +39,7 @@ jobs: | |||
| - name: Setup .NET 10 | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.jsonbeing 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
| @@ -39,7 +39,7 @@ jobs: | |||
| - name: Setup .NET 10 | |||
There was a problem hiding this comment.
⚪ 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.
| - name: Setup .NET 10 | |
| - name: Setup .NET |
Summary
Validation