Skip to content

Conversation

@networkfusion
Copy link
Member

@networkfusion networkfusion commented Aug 24, 2025

Description

Pin vmImage used for CI jobs.

Motivation and Context

A change for windows-latest from Windows 2022 to Windows 2025 is imminent. Rather than winging it, we should pin to the working version, and test before we suffer the consequences.

Reasons:

  • pleanty of time before the 2022 image is deprecated.
  • pinning a version will make it less likely to break.
  • already getting warnings in the CI which report failure.

How Has This Been Tested?

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Unit Tests (add new Unit Test(s) or improved existing one(s), has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist:

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).
  • I have added new tests to cover my changes.

Summary by CodeRabbit

  • Chores
    • Updated all CI runners to Windows Server 2022 across GitHub Actions workflows and Azure Pipelines, aligning build environments for improved stability and consistency.
    • No changes to job logic, steps, or artifacts; builds and checks continue to run as before.
    • Future-proofs the pipeline against deprecations of older runner images and reduces variability between environments.
    • No user-facing functionality changes in this release.

A change for windows-latest from Windows 2022 to Windows 2025 is imminent. Rather than winging it, we should pin to the working version, and test before we suffer the consequences.
@coderabbitai
Copy link

coderabbitai bot commented Aug 24, 2025

Walkthrough

Updated CI runner images from windows-latest to windows-2022 across GitHub Actions workflows and Azure Pipelines. No changes to steps, logic, or control flow.

Changes

Cohort / File(s) Summary of Changes
GitHub Actions workflows
.github/workflows/NanoFramework-GitHubBot.yml, .github/workflows/check-package-lock.yml, .github/workflows/check-packages-updated.yml, .github/workflows/update-dependencies.yml
Updated runs-on from windows-latest to windows-2022; no other modifications.
Azure Pipelines
azure-pipelines.yml
Updated agent image from windows-latest to windows-2022 in jobs: Check_Build_Options, Build_VersionCop, Build_DependencyUpdater, Build_NanoProfiler, Report_Build_Failure; no other changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pin-vmimage

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 0

🧹 Nitpick comments (6)
.github/workflows/NanoFramework-GitHubBot.yml (2)

24-24: Consider centralizing the runner image or pre-testing Windows 2025.

  • To prevent drift across many workflows, consider a reusable workflow input or a repo-level env in each workflow and reference it from jobs.
  • Optionally, add a canary job/matrix leg on windows-2025 with continue-on-error to surface incompatibilities early.

Example (minimal change using a matrix on this workflow):

 jobs:
   build-and-deploy:
-    runs-on: windows-2022
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [windows-2022] # add windows-2025 later
+    runs-on: ${{ matrix.os }}

If you prefer a single place to tweak the image:

 name: Build and deploy nanoFramework GitHubBot
+env:
+  RUNNER_IMAGE: windows-2022
 ...
 jobs:
   build-and-deploy:
-    runs-on: windows-2022
+    runs-on: ${{ env.RUNNER_IMAGE }}

30-34: Heads-up: .NET 6 is out of support.

Unrelated to this PR, but DOTNET_VERSION is set to 6.0.x. Plan an upgrade path to .NET 8 LTS to avoid toolchain removal on newer images.

.github/workflows/check-packages-updated.yml (1)

20-20: De-duplicate image selection across workflows.

If multiple workflows must pin the same image, consider using a reusable workflow with an image input, or an env variable within each file to make future flips trivial.

Example:

 jobs:
   check_nugets_using_latest_version:
-    runs-on: windows-2022
+    runs-on: ${{ env.RUNNER_IMAGE }}

And at top-level of the workflow:

env:
  RUNNER_IMAGE: windows-2022
.github/workflows/update-dependencies.yml (1)

49-53: Optional: tighten secrets usage and preflight checks.

Since this job creates PRs, adding an os-canary leg or a scheduled run on windows-2025 (continue-on-error) can validate future image compatibility without blocking routine runs.

.github/workflows/check-package-lock.yml (1)

21-21: Nit: make the missing-lock-file loop more explicit to avoid xor toggling.

Not part of this PR, but $lockFileMissing = $lockFileMissing -xor $true can flip back to false if multiple files are missing. Use an OR to latch the failure.

Proposed small refactor inside the existing loop:

-                  $lockFileMissing = $lockFileMissing -xor $true
+                  $lockFileMissing = $true
azure-pipelines.yml (1)

31-31: Reduce duplication by introducing a pipeline variable for vmImage.

Setting the image once avoids touching five job blocks in the next switch (e.g., to windows-2025).

Apply this pattern:

 trigger:
   branches:
     include: [main, develop, "release-*" ]
@@
-jobs:
+variables:
+  vmImage: 'windows-2022'
+
+jobs:
   ##############################
 - job: Check_Build_Options
   pool:
-    vmImage: 'windows-2022'
+    vmImage: $(vmImage)
@@
 - job: Build_VersionCop
   pool:
-    vmImage: 'windows-2022'
+    vmImage: $(vmImage)
@@
 - job: Build_DependencyUpdater
   pool:
-    vmImage: 'windows-2022'
+    vmImage: $(vmImage)
@@
 - job: Build_NanoProfiler
   pool:
-    vmImage: 'windows-2022'
+    vmImage: $(vmImage)
@@
 - job: Report_Build_Failure
   pool:
-    vmImage: 'windows-2022'
+    vmImage: $(vmImage)

Also applies to: 111-111, 230-230, 375-375, 424-424

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between cd9f440 and 0a1c518.

📒 Files selected for processing (5)
  • .github/workflows/NanoFramework-GitHubBot.yml (1 hunks)
  • .github/workflows/check-package-lock.yml (1 hunks)
  • .github/workflows/check-packages-updated.yml (1 hunks)
  • .github/workflows/update-dependencies.yml (1 hunks)
  • azure-pipelines.yml (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: nanoframework.nf-tools (Check_Build_Options)
🔇 Additional comments (9)
.github/workflows/NanoFramework-GitHubBot.yml (1)

24-24: Pinning to windows-2022 is appropriate to avoid surprises from windows-latest flip.

LGTM. This stabilizes the environment ahead of the Windows 2025 switch.

.github/workflows/check-packages-updated.yml (1)

20-20: Runner pinned to windows-2022 — good call for stability.

No functional changes; keeping CI deterministic before windows-latest rebase is sensible.

.github/workflows/update-dependencies.yml (1)

47-47: Pin to windows-2022 looks good.

This job installs tooling and updates dependencies; pinning the image avoids toolchain changes mid-flight.

.github/workflows/check-package-lock.yml (1)

21-21: Pin to windows-2022 is fine here.

No logic changes; behavior remains the same.

azure-pipelines.yml (5)

31-31: Pinned agent image (Check_Build_Options): good for predictability.

Approving this change.


111-111: Pinned agent image (Build_VersionCop): good.

Consistent with the rest of the pipeline.


230-230: Pinned agent image (Build_DependencyUpdater): good.

No issues spotted.


375-375: Pinned agent image (Build_NanoProfiler): good.

VSBuild will continue to use the VS 2022 toolset available on this image.


424-424: Pinned agent image (Report_Build_Failure): good.

Keeps the reporting job aligned with the rest of the pipeline.

@networkfusion
Copy link
Member Author

@josesimoes , any feedback on this since:
image

@josesimoes josesimoes changed the title Pin vmImage [github actions template] Pin vmImage to 2022 Sep 1, 2025
@networkfusion networkfusion merged commit 3c59669 into main Sep 1, 2025
4 checks passed
@networkfusion networkfusion deleted the pin-vmimage branch September 1, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants