Skip to content

Comments

Docfx/context7 chat#18

Merged
gimlichael merged 3 commits intomainfrom
docfx/context7-chat
Feb 20, 2026
Merged

Docfx/context7 chat#18
gimlichael merged 3 commits intomainfrom
docfx/context7-chat

Conversation

@gimlichael
Copy link
Member

This pull request introduces a new automated workflow for handling service updates, specifically targeting dependency version bumps for Codebelt and related packages. It adds scripts and workflows to streamline downstream package updates when a new release is published, while ensuring only relevant internal packages are updated (not third-party dependencies). Additionally, it standardizes the formatting of release notes and makes a minor documentation enhancement.

The most important changes are:

Automated Service Update Workflows:

  • Added .github/workflows/service-update.yml to automate service update pull requests, including bumping internal package versions, updating release notes, and creating PRs when triggered by upstream releases or manual dispatch.
  • Added .github/workflows/trigger-downstream.yml to automatically trigger downstream service update workflows in other repositories when a new release is published, using a dispatch mechanism and a list of target repositories.
  • Added .github/dispatch-targets.json as a configuration file to specify downstream repositories for automated update dispatches.

Dependency Bumping Script:

  • Added .github/scripts/bump-nuget.py, a Python script that selectively bumps only Codebelt/Cuemon/Savvyio package versions in Directory.Packages.props based on the triggering source and version, skipping unrelated third-party packages.

Release Notes and Documentation:

  • Standardized the version formatting in .nuget/Codebelt.Extensions.Globalization/PackageReleaseNotes.txt by changing Version X.Y.Z to Version: X.Y.Z throughout the file. [1] [2]
  • Enhanced the documentation footer in .docfx/docfx.json to include a contextual widget script for user assistance.

@gimlichael gimlichael self-assigned this Feb 20, 2026
Copilot AI review requested due to automatic review settings February 20, 2026 17:12
@coderabbitai
Copy link

coderabbitai bot commented Feb 20, 2026

Warning

Rate limit exceeded

@gimlichael has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 23 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docfx/context7-chat

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

Adds automation to create/trigger “service update” pull requests across Codebelt repos when releases are published, plus small release-notes and DocFX footer updates.

Changes:

  • Introduces GitHub Actions workflows to dispatch downstream updates on release and to open service-update PRs in target repos.
  • Adds a Python script to selectively bump internal NuGet package versions in Directory.Packages.props.
  • Standardizes release note “Version:” formatting and injects a Context7 widget script into the DocFX footer.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
.github/workflows/trigger-downstream.yml Dispatches repository_dispatch events to configured downstream repos upon stable release publish.
.github/workflows/service-update.yml Consumes dispatch/manual inputs, bumps packages, updates release notes + changelog, and opens a PR.
.github/scripts/bump-nuget.py Implements selective version bumping for internal packages based on the triggering repo/version.
.github/dispatch-targets.json Configuration list for downstream dispatch targets.
.nuget/Codebelt.Extensions.Globalization/PackageReleaseNotes.txt Standardizes release-note headers to Version: X.Y.Z.
.docfx/docfx.json Extends DocFX footer with an external “contextual widget” script.

Comment on lines +72 to +74
TFM=$(grep -m1 "^Availability:" "$f" | sed 's/Availability: //' || echo ".NET 10, .NET 9 and .NET Standard 2.0")
ENTRY="Version: ${NEW}\nAvailability: ${TFM}\n \n# ALM\n- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)\n \n"
{ printf "$ENTRY"; cat "$f"; } > "$f.tmp" && mv "$f.tmp" "$f"
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The TFM=$(grep ... | sed ... || echo ...) fallback won’t work as intended because sed will exit 0 even when grep finds nothing, so the || echo ... branch won’t run. Also, printf "$ENTRY" treats $ENTRY as a format string, so any % in the content can be misinterpreted. Prefer an explicit check for the Availability line and print the entry with a safe format (e.g., printf '%b' ... / printf '%s' ...) to avoid formatting surprises.

Suggested change
TFM=$(grep -m1 "^Availability:" "$f" | sed 's/Availability: //' || echo ".NET 10, .NET 9 and .NET Standard 2.0")
ENTRY="Version: ${NEW}\nAvailability: ${TFM}\n \n# ALM\n- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)\n \n"
{ printf "$ENTRY"; cat "$f"; } > "$f.tmp" && mv "$f.tmp" "$f"
AVAIL_LINE=$(grep -m1 "^Availability:" "$f" || true)
if [ -n "$AVAIL_LINE" ]; then
TFM="${AVAIL_LINE#Availability: }"
else
TFM=".NET 10, .NET 9 and .NET Standard 2.0"
fi
ENTRY="Version: ${NEW}\nAvailability: ${TFM}\n \n# ALM\n- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)\n \n"
{ printf '%b' "$ENTRY"; cat "$f"; } > "$f.tmp" && mv "$f.tmp" "$f"

Copilot uses AI. Check for mistakes.
Comment on lines +66 to +71
req = urllib.request.Request(url, data=payload, method='POST', headers={
'Authorization': f'Bearer {token}',
'Accept': 'application/vnd.github+json',
'Content-Type': 'application/json',
'X-GitHub-Api-Version': '2022-11-28'
})
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

GitHub’s REST API expects a User-Agent header on requests; the urllib.request.Request(..., headers={...}) here omits it, which can cause the dispatch call to be rejected. Add an explicit User-Agent (and optionally handle HTTPError to surface per-repo failures more clearly).

Copilot uses AI. Check for mistakes.
Comment on lines +61 to +65
if not TRIGGER_SOURCE or not TRIGGER_VERSION:
print(
"Error: TRIGGER_SOURCE and TRIGGER_VERSION environment variables required"
)
print(f" TRIGGER_SOURCE={TRIGGER_SOURCE}")
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

After validating TRIGGER_SOURCE/TRIGGER_VERSION, the script does not validate that TRIGGER_SOURCE is a supported key in SOURCE_PACKAGE_MAP. If an unknown source is provided, the run will succeed but update nothing, and the workflow may still open a “service update” PR with only changelog/release note changes. Consider failing fast when TRIGGER_SOURCE is not in the map (or when it maps to an empty prefix list) to avoid generating misleading PRs.

Copilot uses AI. Check for mistakes.
Comment on lines +119 to +122
if skipped_third_party:
print()
print(f"Skipped {len(skipped_third_party)} third-party package(s):")
print("\n".join(skipped_third_party[:5])) # Show first 5
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

skipped_third_party is populated for every package that doesn’t match the triggering source, including other internal Codebelt packages (not just third-party ones). This makes the summary output misleading ("Skipped ... third-party package(s)"). Consider renaming the variable/message to something like “skipped non-target packages” or explicitly distinguishing third-party vs other internal packages if that matters.

Copilot uses AI. Check for mistakes.
"globalMetadata": {
"_appTitle": "Extensions for Globalization by Codebelt",
"_appFooter": "<span>Generated by <strong>DocFX</strong>. Copyright 2024-2026 Geekle. All rights reserved.</span>",
"_appFooter": "<span>Generated by <strong>DocFX</strong>. Copyright 2024-2026 Geekle. All rights reserved.</span>\n<script src=\"https://context7.com/widget.js\" data-library=\"/codebeltnet/globalization\" data-color=\"#059669\" data-position=\"bottom-right\" data-placeholder=\"Ask about Codebelt Globalization\"></script>",
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The footer now injects a third-party script from https://context7.com/widget.js into the generated docs. This increases supply-chain/XSS risk for the published site; consider hosting/pinning the script (or adding Subresource Integrity + a documented allowlist/CSP) so the build output isn’t executing unpinned remote code.

Suggested change
"_appFooter": "<span>Generated by <strong>DocFX</strong>. Copyright 2024-2026 Geekle. All rights reserved.</span>\n<script src=\"https://context7.com/widget.js\" data-library=\"/codebeltnet/globalization\" data-color=\"#059669\" data-position=\"bottom-right\" data-placeholder=\"Ask about Codebelt Globalization\"></script>",
"_appFooter": "<span>Generated by <strong>DocFX</strong>. Copyright 2024-2026 Geekle. All rights reserved.</span>",

Copilot uses AI. Check for mistakes.
[ -f "$f" ] || continue
TFM=$(grep -m1 "^Availability:" "$f" | sed 's/Availability: //' || echo ".NET 10, .NET 9 and .NET Standard 2.0")
ENTRY="Version: ${NEW}\nAvailability: ${TFM}\n \n# ALM\n- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)\n \n"
{ printf "$ENTRY"; cat "$f"; } > "$f.tmp" && mv "$f.tmp" "$f"
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

PackageReleaseNotes.txt currently starts with a UTF-8 BOM; prepending content via { printf ...; cat "$f"; } will push the BOM into the middle of the file (as part of the old first line), which can show up as a stray character in some consumers. Consider preserving/removing the BOM explicitly (e.g., rewrite using a tool that keeps BOM at the beginning, or strip it before concatenation).

Suggested change
{ printf "$ENTRY"; cat "$f"; } > "$f.tmp" && mv "$f.tmp" "$f"
{
printf "$ENTRY"
python3 - << 'EOF' < "$f"
import sys
data = sys.stdin.read()
if data.startswith('\ufeff'):
data = data[1:]
sys.stdout.write(data)
EOF
} > "$f.tmp" && mv "$f.tmp" "$f"

Copilot uses AI. Check for mistakes.
Comment on lines +61 to +65
- name: Bump NuGet packages
run: python3 .github/scripts/bump-nuget.py
env:
TRIGGER_SOURCE: ${{ steps.trigger.outputs.source }}
TRIGGER_VERSION: ${{ steps.trigger.outputs.version }}
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The workflow_dispatch inputs source_repo / source_version default to empty, but the Bump NuGet packages step will fail when either is empty (the script exits 1). Consider making the inputs required for manual runs, or guard this step (and later PR creation) with a check that resolved source/version are non-empty.

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@gimlichael gimlichael merged commit 722f599 into main Feb 20, 2026
24 of 25 checks passed
@gimlichael gimlichael deleted the docfx/context7-chat branch February 20, 2026 19:31
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