Skip to content

V0.5.4/ci automation#23

Merged
gimlichael merged 2 commits intomainfrom
v0.5.4/ci-automation
Feb 28, 2026
Merged

V0.5.4/ci automation#23
gimlichael merged 2 commits intomainfrom
v0.5.4/ci-automation

Conversation

@gimlichael
Copy link
Member

@gimlichael gimlichael commented Feb 28, 2026

This pull request updates the Dockerfile for DocFX, makes significant improvements to the NuGet package bumping script, and updates a test SDK dependency. The main focus is on enhancing the .github/scripts/bump-nuget.py script to handle Codebelt-related package updates more intelligently, including fetching the latest stable versions for all Codebelt packages not directly triggered. Additionally, the script now supports a broader set of Codebelt packages and improves output clarity.

NuGet package bumping script improvements:

  • Enhanced .github/scripts/bump-nuget.py to update all Codebelt-related packages to the latest stable version from NuGet, not just those from the triggering source. The script now distinguishes between triggered packages (set to the specified version) and other Codebelt packages (set to latest NuGet version), while still skipping third-party packages. [1] [2] [3] [4] [5]
  • Expanded SOURCE_PACKAGE_MAP to include additional Codebelt packages, such as Codebelt.Extensions.Carter, Codebelt.Extensions.AspNetCore.Newtonsoft.Json, Codebelt.Extensions.AspNetCore.Text.Yaml, and Codebelt.SharedKernel, ensuring broader coverage.

Dependency and base image updates:

  • Updated the DocFX Dockerfile to use codebeltnet/docfx:2.78.5 instead of 2.78.4.
  • Bumped Microsoft.NET.Test.Sdk from version 18.0.1 to 18.3.0 in Directory.Packages.props.

Summary by CodeRabbit

  • Chores
    • Updated DocFX base image to version 2.78.5
    • Upgraded Microsoft.NET.Test.Sdk to 18.3.0
    • Enhanced NuGet package management automation with intelligent version detection and caching

@gimlichael gimlichael self-assigned this Feb 28, 2026
Copilot AI review requested due to automatic review settings February 28, 2026 19:31
@coderabbitai
Copy link

coderabbitai bot commented Feb 28, 2026

📝 Walkthrough

Walkthrough

This PR bumps the DocFX base image version in the build Dockerfile, enhances the NuGet package bumping script with NuGet API version fetching and caching for Codebelt packages, and updates the Microsoft.NET.Test.Sdk dependency version.

Changes

Cohort / File(s) Summary
Infrastructure & Dependencies
.docfx/Dockerfile.docfx, Directory.Packages.props
Bumps base image from codebeltnet/docfx:2.78.4 to 2.78.5 and updates Microsoft.NET.Test.Sdk from 18.0.1 to 18.3.0.
Package Update Script
.github/scripts/bump-nuget.py
Adds NuGet-aware package updating with new helper functions (is_codebelt_package(), get_latest_nuget_version()), version caching mechanism, expanded Codebelt package prefix detection, and reworked update flow to fetch and apply latest stable NuGet versions for non-triggered Codebelt packages. Includes error handling for missing config files and NuGet fetch failures.

Possibly Related PRs

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 A rabbit hops through NuGet's halls,

Fetching versions, caching calls!

DocFX upgrades, test SDKs too,

The warren's packages fresh and new! 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'V0.5.4/ci automation' is vague and generic, using non-descriptive terms that don't clearly convey what specific CI-related changes were made in this pull request. Consider a more specific title that highlights the main change, such as 'Enhance bump-nuget script to update all Codebelt packages to latest stable versions' or 'Update CI automation scripts and dependencies'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch v0.5.4/ci-automation

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

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 enhances CI/service-update automation by updating the DocFX build image, improving the repository’s NuGet package bumping automation, and bumping a test SDK dependency in the centrally-managed package versions file.

Changes:

  • Bump Microsoft.NET.Test.Sdk in Directory.Packages.props.
  • Improve .github/scripts/bump-nuget.py to set triggered packages to the provided version and update other Codebelt-related packages to latest stable from NuGet.
  • Update the DocFX Dockerfile to use codebeltnet/docfx:2.78.5.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Directory.Packages.props Updates centrally-managed package version for Microsoft.NET.Test.Sdk.
.github/scripts/bump-nuget.py Expands Codebelt package mapping and adds NuGet “latest stable” fetching for non-triggered Codebelt packages.
.docfx/Dockerfile.docfx Bumps the DocFX build image tag used for docs generation.

Comment on lines 109 to 113
target_version = TRIGGER_VERSION.lstrip("v")

print(f"Trigger: {TRIGGER_SOURCE} @ {target_version}")
print(f"Only updating packages from: {TRIGGER_SOURCE}")
print(f"Triggered packages set to {target_version}; other Codebelt packages fetched from NuGet.")
print()
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

If TRIGGER_SOURCE is misspelled/unknown (not a key in SOURCE_PACKAGE_MAP), is_triggered_package never matches and the script will not pin any packages to TRIGGER_VERSION; instead it will treat all matching prefixes as “other Codebelt packages” and bump them to latest-from-NuGet. This can silently produce the wrong service update. Consider validating TRIGGER_SOURCE against SOURCE_PACKAGE_MAP (fail fast with a list of allowed values) before proceeding.

Copilot uses AI. Check for mistakes.
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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/scripts/bump-nuget.py (1)

100-107: ⚠️ Potential issue | 🟠 Major

Fail fast for unsupported TRIGGER_SOURCE.

If TRIGGER_SOURCE is misspelled or unmapped, no package is treated as triggered, and the script may still bump many packages via the non-triggered Codebelt path.

Suggested fix
 def main():
     if not TRIGGER_SOURCE or not TRIGGER_VERSION:
         print(
             "Error: TRIGGER_SOURCE and TRIGGER_VERSION environment variables required"
         )
         print(f"  TRIGGER_SOURCE={TRIGGER_SOURCE}")
         print(f"  TRIGGER_VERSION={TRIGGER_VERSION}")
         sys.exit(1)
+    if TRIGGER_SOURCE not in SOURCE_PACKAGE_MAP:
+        print(f"Error: Unsupported TRIGGER_SOURCE '{TRIGGER_SOURCE}'")
+        print(f"  Supported values: {', '.join(sorted(SOURCE_PACKAGE_MAP.keys()))}")
+        sys.exit(1)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/scripts/bump-nuget.py around lines 100 - 107, Add a strict
validation step for TRIGGER_SOURCE immediately after reading the environment
variables (where TRIGGER_SOURCE and TRIGGER_VERSION are currently checked) to
fail fast on misspelled or unmapped sources: verify TRIGGER_SOURCE exists in the
script's mapping of supported trigger sources (e.g., the dict/constant that maps
source names to package triggers) and, if not present, print a clear error
showing the invalid value plus the list of supported values and call
sys.exit(1); keep the existing TRIGGER_VERSION check and printing behavior but
ensure the unsupported-source check runs before any package-bumping logic that
assumes a valid mapping.
🧹 Nitpick comments (1)
.github/scripts/bump-nuget.py (1)

176-176: Simplify constant return expression.

return 0 if changes else 0 is equivalent to return 0.

Suggested cleanup
-    return 0 if changes else 0  # Return 0 even if no changes (not an error)
+    return 0  # Return 0 even if no changes (not an error)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/scripts/bump-nuget.py at line 176, The return expression `return 0
if changes else 0` is redundant; update the function to simply `return 0`
(remove the conditional) where that statement appears (referencing the `changes`
variable and the current return in bump-nuget.py).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/scripts/bump-nuget.py:
- Around line 89-90: The current selection logic for latest stable (variables
"stable", "versions", and "result") incorrectly falls back to a prerelease when
no stable versions exist; change the assignment so "result" is the latest stable
if any (stable[-1]) and otherwise is None (do not return versions[-1] or any
prerelease), and update any callers of the function to handle a None return if
necessary.

---

Outside diff comments:
In @.github/scripts/bump-nuget.py:
- Around line 100-107: Add a strict validation step for TRIGGER_SOURCE
immediately after reading the environment variables (where TRIGGER_SOURCE and
TRIGGER_VERSION are currently checked) to fail fast on misspelled or unmapped
sources: verify TRIGGER_SOURCE exists in the script's mapping of supported
trigger sources (e.g., the dict/constant that maps source names to package
triggers) and, if not present, print a clear error showing the invalid value
plus the list of supported values and call sys.exit(1); keep the existing
TRIGGER_VERSION check and printing behavior but ensure the unsupported-source
check runs before any package-bumping logic that assumes a valid mapping.

---

Nitpick comments:
In @.github/scripts/bump-nuget.py:
- Line 176: The return expression `return 0 if changes else 0` is redundant;
update the function to simply `return 0` (remove the conditional) where that
statement appears (referencing the `changes` variable and the current return in
bump-nuget.py).

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b004a20 and 043ee19.

📒 Files selected for processing (3)
  • .docfx/Dockerfile.docfx
  • .github/scripts/bump-nuget.py
  • Directory.Packages.props

Comment on lines +89 to +90
stable = [v for v in versions if "-" not in v]
result = stable[-1] if stable else (versions[-1] if versions else None)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Do not fall back to prerelease when “latest stable” is required.

Current logic can select a prerelease when no stable version exists, which conflicts with the function contract and PR objective.

Suggested fix
-        stable = [v for v in versions if "-" not in v]
-        result = stable[-1] if stable else (versions[-1] if versions else None)
+        stable = [v for v in versions if "-" not in v]
+        result = stable[-1] if stable else None
+        if versions and not stable:
+            print(
+                f"  Warning: No stable release found for {package_name}; keeping current version."
+            )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/scripts/bump-nuget.py around lines 89 - 90, The current selection
logic for latest stable (variables "stable", "versions", and "result")
incorrectly falls back to a prerelease when no stable versions exist; change the
assignment so "result" is the latest stable if any (stable[-1]) and otherwise is
None (do not return versions[-1] or any prerelease), and update any callers of
the function to handle a None return if necessary.

@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.50%. Comparing base (b004a20) to head (043ee19).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #23   +/-   ##
=======================================
  Coverage   88.50%   88.50%           
=======================================
  Files          11       11           
  Lines         200      200           
  Branches        8        8           
=======================================
  Hits          177      177           
  Misses         23       23           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gimlichael gimlichael merged commit d4544b7 into main Feb 28, 2026
28 checks passed
@gimlichael gimlichael deleted the v0.5.4/ci-automation branch February 28, 2026 19:43
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