Skip to content

CI: Per-PR doc previews are not always cleaned up #628

Open
@leofang

Description

@leofang

Compare the number of folders in the gh-pages branch
https://github.com/NVIDIA/cuda-python/tree/gh-pages/docs/pr-preview
with the number of open PRs that we have:
https://github.com/NVIDIA/cuda-python/pulls
I think the numbers mismatch.

Some logic was oversimplified in the doc_preview action, for example:

# The steps below are executed only when building on main.
- name: Remove doc preview
if: ${{ github.ref_name == 'main' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
git-config-name: cuda-python-bot
git-config-email: [email protected]
folder: ${{ inputs.source-folder }}
target-folder: docs/pr-preview/pr-${{ inputs.pr-number }}/
commit-message: "Clean up doc preview for PR ${{ inputs.pr-number }} (${{ github.sha }})"
- name: Leave a comment after removal
if: ${{ github.ref_name == 'main' }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-preview
number: ${{ inputs.pr-number }}
hide_and_recreate: true
hide_classify: "OUTDATED"
message: |
Doc Preview CI
:---:
Preview removed because the pull request was closed or merged.

These steps are only run when the target branch is main. So one class of cleanup failures came from the previous path finder work, where PRs targeted a feature branch instead of the main branch. However, this bug alone does not seem to account for the discrepancy fully; there seem to exist other issues that I could not tell immediately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CI/CDCI/CD infrastructureP1Medium priority - Should dobugSomething isn't workingtriageNeeds the team's attention

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions