Skip to content

Enhance publish-docs workflow: Include triggering upstream PR details in autogenerated docs PRs#11159

Open
Copilot wants to merge 8 commits intomainfrom
copilot/enhance-publish-docs-workflow
Open

Enhance publish-docs workflow: Include triggering upstream PR details in autogenerated docs PRs#11159
Copilot wants to merge 8 commits intomainfrom
copilot/enhance-publish-docs-workflow

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

Description

The publish-docs workflow generates PRs against the docs repository without context about the triggering upstream change. This makes it difficult for reviewers to trace documentation updates back to source code changes.

Changes

Added context extraction step that detects trigger type and formats rich PR descriptions:

  1. Merged PRs - Extracts PR number and title from squash merge commit messages using pattern \(#([0-9]+)\)$

    • Title: Update auto-generated documentation (PR #1234)
    • Body: Links to upstream PR, includes title, author, branch, commit SHA
  2. Direct commits - Captures commit metadata for non-PR changes

    • Title: Update auto-generated documentation (main)
    • Body: Branch name, commit link, author, commit message
  3. Manual triggers - Identifies workflow_dispatch invocations

    • Title: Update auto-generated documentation (manual trigger)
    • Body: Trigger source, actor, branch, commit

Implementation: Pure bash/git pattern matching. No API calls, no additional permissions required.

Before

Title: Update auto-generated documentation
Body:  GitHub SHA: abc123

After

Title: Update auto-generated documentation (PR #1234)
Body:
  **Pull Request:** #1234 - Fix CLI command docs
  **Author:** Jane Developer
  **Commit:** abc123

Type of change

  • This pull request adds or changes features of Radius and has an approved issue (issue link required).

Contributor checklist

Please verify that the PR meets the following requirements, where applicable:

  • An overview of proposed schema changes is included in a linked GitHub issue.
    • Not applicable
  • A design document PR is created in the design-notes repository, if new APIs are being introduced.
    • Not applicable
  • The design document has been reviewed and approved by Radius maintainers/approvers.
    • Not applicable
  • A PR for the samples repository is created, if existing samples are affected by the changes in this PR.
    • Not applicable
  • A PR for the documentation repository is created, if the changes in this PR affect the documentation or any user facing updates are made.
    • Not applicable
  • A PR for the recipes repository is created, if existing recipes are affected by the changes in this PR.
    • Not applicable
Original prompt

This section details on the original issue you should resolve

<issue_title>Enhance publish-docs workflow: Include triggering upstream PR details in autogenerated docs PRs</issue_title>
<issue_description>## Background

The current .github/workflows/publish-docs.yaml workflow in the radius repository generates a pull request (PR) against the docs repository whenever reference documentation is auto-generated. However, the resulting PR that is created is sparse on details and does not make it clear which upstream PR or commit triggered the workflow to run.

Request

Please update the publish-docs workflow so that the auto-generated documentation PR includes clear information on:

  • The upstream PR (or commit) in the radius repo that triggered the workflow.
  • Preferably, a link to that upstream PR or commit and basic context (such as PR title/author or commit message).

This will make it easier for reviewers and maintainers to understand the source of documentation changes and trace them back to the originating changes in the codebase.

File reference: radius-project/radius/.github/workflows/publish-docs.yaml


Acceptance Criteria

  • Auto-generated documentation PRs should include upstream PR/commit details in the PR title and/or body
  • Information must include at least a link to the upstream PR/commit, and ideally context such as PR title/author
  • Implementation should be documented or commented if workaround is required

/cc @radius-project/maintainers</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits February 3, 2026 22:22
Co-authored-by: willtsai <28876888+willtsai@users.noreply.github.com>
Co-authored-by: willtsai <28876888+willtsai@users.noreply.github.com>
…ation

Co-authored-by: willtsai <28876888+willtsai@users.noreply.github.com>
Co-authored-by: willtsai <28876888+willtsai@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance publish-docs workflow to include upstream PR details Enhance publish-docs workflow: Include triggering upstream PR details in autogenerated docs PRs Feb 3, 2026
Copilot AI requested a review from willtsai February 3, 2026 22:30
@radius-functional-tests
Copy link

radius-functional-tests bot commented Feb 4, 2026

Radius functional test overview

🔍 Go to test action run

Click here to see the test run details
Name Value
Repository radius-project/radius
Commit ref 65471b4
Unique ID funcae08cec3f6
Image tag pr-funcae08cec3f6
  • gotestsum 1.13.0
  • KinD: v0.29.0
  • Dapr: 1.14.4
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-funcae08cec3f6
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-funcae08cec3f6
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-funcae08cec3f6
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcae08cec3f6
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcae08cec3f6
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@willtsai willtsai requested a deployment to external-contributor-approval March 3, 2026 21:28 — with GitHub Actions Waiting
@github-actions
Copy link

github-actions bot commented Mar 3, 2026

Unit Tests

    2 files  ±0    415 suites  ±0   6m 43s ⏱️ +2s
4 862 tests ±0  4 860 ✅ ±0  2 💤 ±0  0 ❌ ±0 
5 762 runs  ±0  5 760 ✅ ±0  2 💤 ±0  0 ❌ ±0 

Results for commit 186899b. ± Comparison against base commit a1059b6.

@willtsai willtsai marked this pull request as ready for review March 3, 2026 22:45
@willtsai willtsai requested a review from a team as a code owner March 3, 2026 22:45
Copilot AI review requested due to automatic review settings March 3, 2026 22:45
@willtsai willtsai requested review from a team as code owners March 3, 2026 22:45
Copy link
Contributor

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

Updates the publish-docs GitHub Actions workflow so autogenerated PRs to the docs repo include richer context about what triggered the docs generation (merged PR vs direct commit vs manual dispatch), improving traceability back to Radius changes.

Changes:

  • Add a workflow step to infer trigger context from the triggering commit message and build a formatted PR title/body.
  • Use the generated title/body outputs when creating the docs pull request.

Comment on lines +181 to +194
echo "**Branch:** \`${GITHUB_REF##*/}\`" >> $GITHUB_OUTPUT
echo "**Commit:** [\`${{ github.sha }}\`](https://github.com/${{ github.repository }}/commit/${{ github.sha }})" >> $GITHUB_OUTPUT
echo "**Author:** $COMMIT_AUTHOR" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
else
# Regular push commit (not from a PR merge)
echo "pr-title=Update auto-generated documentation (${GITHUB_REF##*/})" >> $GITHUB_OUTPUT
echo "pr-body<<EOF" >> $GITHUB_OUTPUT
echo "## Autogenerated PR" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "This PR updates the auto-generated reference documentation." >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "### Triggered by" >> $GITHUB_OUTPUT
echo "**Branch:** \`${GITHUB_REF##*/}\`" >> $GITHUB_OUTPUT
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

${GITHUB_REF##*/} only keeps the last path segment, so for branches like release/0.32 this will render as 0.32. Use ${{ github.ref_name }} (preferred) or strip only the refs/heads/ prefix so the full branch name is preserved in the generated PR body.

Suggested change
echo "**Branch:** \`${GITHUB_REF##*/}\`" >> $GITHUB_OUTPUT
echo "**Commit:** [\`${{ github.sha }}\`](https://github.com/${{ github.repository }}/commit/${{ github.sha }})" >> $GITHUB_OUTPUT
echo "**Author:** $COMMIT_AUTHOR" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
else
# Regular push commit (not from a PR merge)
echo "pr-title=Update auto-generated documentation (${GITHUB_REF##*/})" >> $GITHUB_OUTPUT
echo "pr-body<<EOF" >> $GITHUB_OUTPUT
echo "## Autogenerated PR" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "This PR updates the auto-generated reference documentation." >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "### Triggered by" >> $GITHUB_OUTPUT
echo "**Branch:** \`${GITHUB_REF##*/}\`" >> $GITHUB_OUTPUT
echo "**Branch:** \`${{ github.ref_name }}\`" >> $GITHUB_OUTPUT
echo "**Commit:** [\`${{ github.sha }}\`](https://github.com/${{ github.repository }}/commit/${{ github.sha }})" >> $GITHUB_OUTPUT
echo "**Author:** $COMMIT_AUTHOR" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
else
# Regular push commit (not from a PR merge)
echo "pr-title=Update auto-generated documentation (${{ github.ref_name }})" >> $GITHUB_OUTPUT
echo "pr-body<<EOF" >> $GITHUB_OUTPUT
echo "## Autogenerated PR" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "This PR updates the auto-generated reference documentation." >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "### Triggered by" >> $GITHUB_OUTPUT
echo "**Branch:** \`${{ github.ref_name }}\`" >> $GITHUB_OUTPUT

Copilot uses AI. Check for mistakes.
Comment on lines +181 to +194
echo "**Branch:** \`${GITHUB_REF##*/}\`" >> $GITHUB_OUTPUT
echo "**Commit:** [\`${{ github.sha }}\`](https://github.com/${{ github.repository }}/commit/${{ github.sha }})" >> $GITHUB_OUTPUT
echo "**Author:** $COMMIT_AUTHOR" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
else
# Regular push commit (not from a PR merge)
echo "pr-title=Update auto-generated documentation (${GITHUB_REF##*/})" >> $GITHUB_OUTPUT
echo "pr-body<<EOF" >> $GITHUB_OUTPUT
echo "## Autogenerated PR" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "This PR updates the auto-generated reference documentation." >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "### Triggered by" >> $GITHUB_OUTPUT
echo "**Branch:** \`${GITHUB_REF##*/}\`" >> $GITHUB_OUTPUT
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

${GITHUB_REF##*/} truncates branch names containing slashes (e.g., release/0.32 becomes 0.32), which can make the autogenerated PR title misleading. Prefer ${{ github.ref_name }} or a safer prefix strip (${GITHUB_REF#refs/heads/}).

Suggested change
echo "**Branch:** \`${GITHUB_REF##*/}\`" >> $GITHUB_OUTPUT
echo "**Commit:** [\`${{ github.sha }}\`](https://github.com/${{ github.repository }}/commit/${{ github.sha }})" >> $GITHUB_OUTPUT
echo "**Author:** $COMMIT_AUTHOR" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
else
# Regular push commit (not from a PR merge)
echo "pr-title=Update auto-generated documentation (${GITHUB_REF##*/})" >> $GITHUB_OUTPUT
echo "pr-body<<EOF" >> $GITHUB_OUTPUT
echo "## Autogenerated PR" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "This PR updates the auto-generated reference documentation." >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "### Triggered by" >> $GITHUB_OUTPUT
echo "**Branch:** \`${GITHUB_REF##*/}\`" >> $GITHUB_OUTPUT
echo "**Branch:** \`${{ github.ref_name }}\`" >> $GITHUB_OUTPUT
echo "**Commit:** [\`${{ github.sha }}\`](https://github.com/${{ github.repository }}/commit/${{ github.sha }})" >> $GITHUB_OUTPUT
echo "**Author:** $COMMIT_AUTHOR" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
else
# Regular push commit (not from a PR merge)
echo "pr-title=Update auto-generated documentation (${{ github.ref_name }})" >> $GITHUB_OUTPUT
echo "pr-body<<EOF" >> $GITHUB_OUTPUT
echo "## Autogenerated PR" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "This PR updates the auto-generated reference documentation." >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "### Triggered by" >> $GITHUB_OUTPUT
echo "**Branch:** \`${{ github.ref_name }}\`" >> $GITHUB_OUTPUT

Copilot uses AI. Check for mistakes.
Comment on lines +194 to +195
echo "**Branch:** \`${GITHUB_REF##*/}\`" >> $GITHUB_OUTPUT
echo "**Commit:** [\`${{ github.sha }}\`](https://github.com/${{ github.repository }}/commit/${{ github.sha }})" >> $GITHUB_OUTPUT
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

${GITHUB_REF##*/} drops everything before the last /, so the docs PR will show the wrong branch for release/* pushes. Use ${{ github.ref_name }} or ${GITHUB_REF#refs/heads/} to keep release/<version> intact.

Copilot uses AI. Check for mistakes.
Comment on lines +148 to +152
- name: Prepare PR context
id: pr-context
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.open_pull_request == 'true')
run: |
# Change to radius directory to extract commit information
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

The trigger-detection/formatting logic here is fairly large and hard to test outside CI. Consider moving it into a versioned script under radius/.github/scripts/ (invoked from the workflow) so it can be run locally and keeps the workflow YAML focused on orchestration.

Copilot generated this review using guidance from repository custom instructions.
echo "### Triggered by" >> $GITHUB_OUTPUT
echo "**Trigger:** Manual workflow dispatch" >> $GITHUB_OUTPUT
echo "**Triggered by:** @${{ github.actor }}" >> $GITHUB_OUTPUT
echo "**Branch:** \`${GITHUB_REF##*/}\`" >> $GITHUB_OUTPUT
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

${GITHUB_REF##*/} truncates branch names that include / (e.g., release/0.32). Use ${{ github.ref_name }} (preferred) or ${GITHUB_REF#refs/heads/} so the manual-trigger PR body shows the full branch name.

Suggested change
echo "**Branch:** \`${GITHUB_REF##*/}\`" >> $GITHUB_OUTPUT
echo "**Branch:** \`${{ github.ref_name }}\`" >> $GITHUB_OUTPUT

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

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.09%. Comparing base (a1059b6) to head (186899b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11159      +/-   ##
==========================================
- Coverage   51.10%   51.09%   -0.01%     
==========================================
  Files         699      699              
  Lines       44067    44067              
==========================================
- Hits        22519    22517       -2     
- Misses      19401    19402       +1     
- Partials     2147     2148       +1     

☔ 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.

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.

Enhance publish-docs workflow: Include triggering upstream PR details in autogenerated docs PRs

3 participants