Skip to content

Add a pipeline for Docs PR Preview - #1413

Merged
alexxu-amd merged 48 commits into
developfrom
users/alexxu12/docs-pr-preview
Apr 16, 2026
Merged

alexxu-amd merged 48 commits into
developfrom
users/alexxu12/docs-pr-preview

Conversation

@alexxu-amd

@alexxu-amd alexxu-amd commented Aug 31, 2025 •

Copy link
Copy Markdown
Contributor

Motivation

To provide Tech Writers a preview of their docs development, accelerate the review process.

Technical Details

Key Steps:
docs-pr-preview.yml (triggered via commenting '/docs-preview')

  1. Use the script (.github/scripts/pr_detect_changed_subtrees.py) to detect changed project
  2. Trigger preview build on RTD based on the detected project
  3. Comment the preview URL back to the PR

docs-pr-preview-cleanup.yml (triggered when PR is closed)

  1. Scan through PR comment section
  2. If bot's preview comment is detected, deactivate the preview from RTD

Test Plan

Fork rocm-libraries and run the pipeline in a testing environment.

Test Result

Pipeline runs as expected.

Submission Checklist

@alexxu-amd
alexxu-amd requested a review from a team as a code owner August 31, 2025 20:45
@github-actions github-actions Bot added github actions project: none Does not target any component labels Aug 31, 2025
@alexxu-amd

Copy link
Copy Markdown
Contributor Author

The deploy job requires github-pages to be enabled for this repo, which requires organization admin.

Comment thread .github/workflows/docs-pr-preview.yml Resolved
Comment thread .github/workflows/docs-pr-preview.yml Resolved
Comment thread .github/workflows/docs-pr-preview.yml Resolved
@alexxu-amd
alexxu-amd marked this pull request as draft April 9, 2026 17:09
@alexxu-amd
alexxu-amd marked this pull request as ready for review April 9, 2026 19:22
@alexxu-amd

Copy link
Copy Markdown
Contributor Author

Re-wrote the pipeline without usage of Netlify.

@alexxu-amd
alexxu-amd requested a review from geomin12 April 9, 2026 20:38
@neon60
neon60 requested a review from dsclear-amd April 10, 2026 08:10
@alexxu-amd
alexxu-amd requested a review from neon60 April 10, 2026 13:39
Comment thread .github/workflows/docs-pr-preview.yml Resolved
Comment thread .github/workflows/docs-pr-preview.yml Resolved
Comment thread .github/workflows/docs-pr-preview.yml Resolved
Comment thread .github/workflows/docs-pr-preview.yml Resolved
Comment thread .github/workflows/docs-pr-preview.yml Resolved
@alexxu-amd
alexxu-amd merged commit 2eee624 into develop Apr 16, 2026
11 of 13 checks passed
@alexxu-amd
alexxu-amd deleted the users/alexxu12/docs-pr-preview branch April 16, 2026 20:50
aledudek pushed a commit that referenced this pull request May 20, 2026
## Motivation

To provide Tech Writers a preview of their docs development, accelerate
the review process.

## Technical Details
Key Steps:
`docs-pr-preview.yml` (triggered via commenting '/docs-preview')
1. Use the script (.github/scripts/pr_detect_changed_subtrees.py) to
detect changed project
2. Trigger preview build on RTD based on the detected project
3. Comment the preview URL back to the PR

`docs-pr-preview-cleanup.yml` (triggered when PR is closed)
1. Scan through PR comment section
2. If bot's preview comment is detected, deactivate the preview from RTD

## Test Plan
Fork rocm-libraries and run the pipeline in a testing environment.

## Test Result

Pipeline runs as expected.

<!-- Briefly summarize test outcomes. -->

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

---------

Co-authored-by: dsclear-amd <131019604+dsclear-amd@users.noreply.github.com>
arvindcheru pushed a commit to ROCm/rocm-systems that referenced this pull request May 28, 2026
…#6336)

**This PR adds merged pipelines from rocm-libraries.
ROCm/rocm-libraries#1413

## Motivation

To provide Tech Writers a preview of their docs development, accelerate
the review process.

## Technical Details

Key Steps:
`docs-pr-preview.yml` (triggered via commenting '/docs-preview')
1. Use the script (.github/scripts/pr_detect_changed_subtrees.py) to
detect changed project
2. Trigger preview build on RTD based on the detected project
3. Comment the preview URL back to the PR

`docs-pr-preview-cleanup.yml` (triggered when PR is closed)
1. Scan through PR comment section
2. If bot's preview comment is detected, deactivate the preview from RTD

## JIRA ID

<!-- If applicable, mention the JIRA ID resolved by this PR (Example:
Resolves SWDEV-12345). -->
<!-- Do not post any JIRA links here. -->

## Test Plan

Tested on rocm-libraries

## Test Result

Preview behaves as expected

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
gandryey pushed a commit to ROCm/rocm-systems that referenced this pull request May 29, 2026
…#6336)

**This PR adds merged pipelines from rocm-libraries.
ROCm/rocm-libraries#1413

## Motivation

To provide Tech Writers a preview of their docs development, accelerate
the review process.

## Technical Details

Key Steps:
`docs-pr-preview.yml` (triggered via commenting '/docs-preview')
1. Use the script (.github/scripts/pr_detect_changed_subtrees.py) to
detect changed project
2. Trigger preview build on RTD based on the detected project
3. Comment the preview URL back to the PR

`docs-pr-preview-cleanup.yml` (triggered when PR is closed)
1. Scan through PR comment section
2. If bot's preview comment is detected, deactivate the preview from RTD

## JIRA ID

<!-- If applicable, mention the JIRA ID resolved by this PR (Example:
Resolves SWDEV-12345). -->
<!-- Do not post any JIRA links here. -->

## Test Plan

Tested on rocm-libraries

## Test Result

Preview behaves as expected

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
COrruDXC pushed a commit to COrruDXC/rocm-libraries that referenced this pull request Jun 4, 2026
## Motivation

To provide Tech Writers a preview of their docs development, accelerate
the review process.

## Technical Details
Key Steps:
`docs-pr-preview.yml` (triggered via commenting '/docs-preview')
1. Use the script (.github/scripts/pr_detect_changed_subtrees.py) to
detect changed project
2. Trigger preview build on RTD based on the detected project
3. Comment the preview URL back to the PR

`docs-pr-preview-cleanup.yml` (triggered when PR is closed)
1. Scan through PR comment section
2. If bot's preview comment is detected, deactivate the preview from RTD

## Test Plan
Fork rocm-libraries and run the pipeline in a testing environment.

## Test Result

Pipeline runs as expected.

<!-- Briefly summarize test outcomes. -->

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

---------

Co-authored-by: dsclear-amd <131019604+dsclear-amd@users.noreply.github.com>
newling added a commit that referenced this pull request Oct 29, 2026
Repository members and owners can comment `/docs-preview` on a pull
request to request a temporary documentation preview on Read the Docs.
This feature and its cleanup workflow were introduced in
[#1413](#1413). When the PR
closes, the cleanup workflow looks for the bot's preview comment and
deactivates the corresponding Read the Docs version.

Preview creation explicitly supports only branches in
`ROCm/rocm-libraries` and rejects PRs whose source branch is in a fork.
Cleanup, however, runs for every closed PR. On a fork PR, GitHub
withholds repository secrets from the `pull_request` workflow, so
cleanup fails while generating its GitHub App token, before it can check
whether a preview exists. For example, [the cleanup job after #12425
merged failed at token
creation](https://github.com/ROCm/rocm-libraries/actions/runs/36353595348/job/108716843959),
even though that PR had no documentation preview.

Run the cleanup job only when the PR's source repository matches the
repository running the workflow. Fork PRs then skip cleanup before
accessing secrets, while previews from branches in this repository
retain their existing cleanup behavior.

This change aligns cleanup with the preview system's current
limitations. Supporting documentation previews from forks would be a
separate feature: preview creation would need to accept fork sources,
and trusted automation would need to create and deactivate those
previews while keeping credentials isolated from contributor-controlled
code.

Validation: the root pre-commit checks and `git diff --check` pass after
rebasing onto `origin/develop`. `actionlint` reports only the existing
warning about inline use of `github.head_ref`, with identical
diagnostics on the base and this branch. The close-event behavior has
not yet been exercised by a new GitHub Actions run.
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.

6 participants