From 70ff0739b910236149178386d76284856c9929eb Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Thu, 17 Sep 2026 14:20:53 -0700 Subject: [PATCH 1/6] chore: open issues on docfx failures --- .github/workflows/docs.yml | 94 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ecc637d802ab..598e7b081dba 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -15,7 +15,32 @@ name: docs permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +env: + NOX_DEFAULT_VENV_BACKEND: "uv" + UV_VENV_SEED: "1" + PARALLEL_WORKERS: "4" + jobs: + check_changes: + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + outputs: + run_docfx: ${{ steps.filter.outputs.docfx }} + steps: + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + with: + persist-credentials: false + - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 + id: filter + with: + filters: | + docfx: + - '.github/workflows/docs.yml' + docs: runs-on: ubuntu-latest steps: @@ -34,19 +59,35 @@ jobs: - name: Install nox run: | python -m pip install --upgrade setuptools pip wheel - python -m pip install nox + python -m pip install nox uv - name: Run docs env: - BUILD_TYPE: presubmit + BUILD_TYPE: ${{ github.event_name == 'push' && 'continuous' || 'presubmit' }} TARGET_BRANCH: ${{ github.base_ref || github.event.merge_group.base_ref || github.ref_name }} TEST_TYPE: docs # TODO(https://github.com/googleapis/google-cloud-python/issues/13775): Specify `PY_VERSION` rather than relying on the default python version of the nox session. PY_VERSION: "unused" run: | + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + git fetch --no-tags --quiet origin "${TARGET_BRANCH}:refs/remotes/origin/${TARGET_BRANCH}" --depth=200 || true + if ! git diff --quiet "origin/${TARGET_BRANCH}..." -- .github/workflows/docs.yml && git diff --quiet "origin/${TARGET_BRANCH}..." -- packages/ preview-packages/; then + echo "Workflow modified with no package changes; testing packages/google-cloud-core." + export PACKAGE_LIST="packages/google-cloud-core" + fi + fi ci/run_conditional_tests.sh + docfx: - if: github.event_name == 'push' && github.ref == 'refs/heads/main' + needs: [check_changes] + if: >- + always() && ( + (github.event_name == 'push' && github.ref == 'refs/heads/main') || + needs.check_changes.outputs.run_docfx == 'true' + ) runs-on: ubuntu-latest + permissions: + contents: read + issues: write steps: - name: Checkout uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 @@ -63,13 +104,56 @@ jobs: - name: Install nox run: | python -m pip install --upgrade setuptools pip wheel - python -m pip install nox + python -m pip install nox uv - name: Run docfx env: - BUILD_TYPE: presubmit + BUILD_TYPE: ${{ github.event_name == 'push' && 'continuous' || 'presubmit' }} TARGET_BRANCH: ${{ github.base_ref || github.event.merge_group.base_ref || github.ref_name }} TEST_TYPE: docfx + CONTINUE_ON_ERROR: "true" # TODO(https://github.com/googleapis/google-cloud-python/issues/13775): Specify `PY_VERSION` rather than relying on the default python version of the nox session. PY_VERSION: "unused" run: | + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + git fetch --no-tags --quiet origin "${TARGET_BRANCH}:refs/remotes/origin/${TARGET_BRANCH}" --depth=200 || true + if ! git diff --quiet "origin/${TARGET_BRANCH}..." -- .github/workflows/docs.yml && git diff --quiet "origin/${TARGET_BRANCH}..." -- packages/ preview-packages/; then + echo "Workflow modified with no package changes; testing packages/google-cloud-core." + export PACKAGE_LIST="packages/google-cloud-core" + fi + fi ci/run_conditional_tests.sh + - name: Create issue on failure + if: ${{ failure() && github.event_name == 'push' && github.repository == 'googleapis/google-cloud-python' }} + uses: googleapis/librarian/.github/actions/create-issue-on-failure@bb2ee61752bd0f5387195b54c509e4d01a52b41d + with: + title: "docfx check failed" + labels: "priority: p1,type: bug" + body: | + The post-submit [docfx check](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed on commit `${{ github.sha }}`. + + Please investigate the workflow logs to see which package(s) failed to build DocFX YAML. + + docfx-release-blocker: + name: docfx release blocker + if: "github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'autorelease: pending')" + runs-on: ubuntu-latest + permissions: + contents: read + actions: read + issues: read + steps: + - name: Check post-submit docfx health + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + ISSUE_URL=$(gh issue list --repo "${GITHUB_REPOSITORY}" --state open --search '"docfx check failed" in:title' --json url --jq '.[0].url') + if [ -n "${ISSUE_URL}" ]; then + echo "::error::Release blocked due to open docfx failure issue: ${ISSUE_URL}" + exit 1 + fi + + LATEST_RUN=$(gh run list --repo "${GITHUB_REPOSITORY}" --workflow=docs.yml --branch=main --event=push --status=completed --limit=1 --json conclusion,url --jq '.[0]') + if [ "$(echo "$LATEST_RUN" | jq -r '.conclusion')" = "failure" ]; then + echo "::error::Release blocked because latest post-submit docs workflow on main failed: $(echo "$LATEST_RUN" | jq -r '.url')" + exit 1 + fi From f28921835d271ebd62a36298c33300a985a4e649 Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Thu, 17 Sep 2026 16:33:47 -0700 Subject: [PATCH 2/6] simulate error --- .github/workflows/docs.yml | 11 +++++++++-- packages/google-cloud-core/noxfile.py | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 598e7b081dba..928597dd9351 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -123,7 +123,8 @@ jobs: fi ci/run_conditional_tests.sh - name: Create issue on failure - if: ${{ failure() && github.event_name == 'push' && github.repository == 'googleapis/google-cloud-python' }} + # TODO: Restore `github.event_name == 'push' &&` after testing on this PR + if: ${{ failure() && github.repository == 'googleapis/google-cloud-python' }} uses: googleapis/librarian/.github/actions/create-issue-on-failure@bb2ee61752bd0f5387195b54c509e4d01a52b41d with: title: "docfx check failed" @@ -135,7 +136,13 @@ jobs: docfx-release-blocker: name: docfx release blocker - if: "github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'autorelease: pending')" + needs: [check_changes, docfx] + # TODO: Remove `needs.check_changes.outputs.run_docfx == 'true'` after testing on this PR + if: >- + always() && ( + (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'autorelease: pending')) || + needs.check_changes.outputs.run_docfx == 'true' + ) runs-on: ubuntu-latest permissions: contents: read diff --git a/packages/google-cloud-core/noxfile.py b/packages/google-cloud-core/noxfile.py index 772c0c136b3d..9abc3525de5a 100644 --- a/packages/google-cloud-core/noxfile.py +++ b/packages/google-cloud-core/noxfile.py @@ -224,6 +224,8 @@ def docs(session): def docfx(session): """Build the docfx yaml files for this library.""" + session.error("Intentional failure to test docfx CI check") + session.install("-e", ".") session.install( # We need to pin to specific versions of the `sphinxcontrib-*` packages From 5e8bc7b1c251132414db4d8136b9c5900122b735 Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Thu, 17 Sep 2026 17:07:36 -0700 Subject: [PATCH 3/6] reverted intentional breakages --- .github/workflows/docs.yml | 11 ++--------- packages/google-cloud-core/noxfile.py | 2 -- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 928597dd9351..598e7b081dba 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -123,8 +123,7 @@ jobs: fi ci/run_conditional_tests.sh - name: Create issue on failure - # TODO: Restore `github.event_name == 'push' &&` after testing on this PR - if: ${{ failure() && github.repository == 'googleapis/google-cloud-python' }} + if: ${{ failure() && github.event_name == 'push' && github.repository == 'googleapis/google-cloud-python' }} uses: googleapis/librarian/.github/actions/create-issue-on-failure@bb2ee61752bd0f5387195b54c509e4d01a52b41d with: title: "docfx check failed" @@ -136,13 +135,7 @@ jobs: docfx-release-blocker: name: docfx release blocker - needs: [check_changes, docfx] - # TODO: Remove `needs.check_changes.outputs.run_docfx == 'true'` after testing on this PR - if: >- - always() && ( - (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'autorelease: pending')) || - needs.check_changes.outputs.run_docfx == 'true' - ) + if: "github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'autorelease: pending')" runs-on: ubuntu-latest permissions: contents: read diff --git a/packages/google-cloud-core/noxfile.py b/packages/google-cloud-core/noxfile.py index 9abc3525de5a..772c0c136b3d 100644 --- a/packages/google-cloud-core/noxfile.py +++ b/packages/google-cloud-core/noxfile.py @@ -224,8 +224,6 @@ def docs(session): def docfx(session): """Build the docfx yaml files for this library.""" - session.error("Intentional failure to test docfx CI check") - session.install("-e", ".") session.install( # We need to pin to specific versions of the `sphinxcontrib-*` packages From dd96042cbda5df66f5d4341c7cc62c4a6150a3f9 Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Thu, 17 Sep 2026 17:17:16 -0700 Subject: [PATCH 4/6] set release blocker step to run, but skip on non-releases --- .github/workflows/docs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 598e7b081dba..2161cf1d7ccc 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -135,7 +135,7 @@ jobs: docfx-release-blocker: name: docfx release blocker - if: "github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'autorelease: pending')" + if: github.event_name != 'push' runs-on: ubuntu-latest permissions: contents: read @@ -143,6 +143,7 @@ jobs: issues: read steps: - name: Check post-submit docfx health + if: "contains(github.event.pull_request.labels.*.name, 'autorelease: pending')" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | From 388313deea39ee5e98b1fcd5dd1e890cf2de1acb Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Thu, 17 Sep 2026 17:19:48 -0700 Subject: [PATCH 5/6] removed test against api_core --- .github/workflows/docs.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2161cf1d7ccc..00e08fce745e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -68,13 +68,6 @@ jobs: # TODO(https://github.com/googleapis/google-cloud-python/issues/13775): Specify `PY_VERSION` rather than relying on the default python version of the nox session. PY_VERSION: "unused" run: | - if [[ "${{ github.event_name }}" == "pull_request" ]]; then - git fetch --no-tags --quiet origin "${TARGET_BRANCH}:refs/remotes/origin/${TARGET_BRANCH}" --depth=200 || true - if ! git diff --quiet "origin/${TARGET_BRANCH}..." -- .github/workflows/docs.yml && git diff --quiet "origin/${TARGET_BRANCH}..." -- packages/ preview-packages/; then - echo "Workflow modified with no package changes; testing packages/google-cloud-core." - export PACKAGE_LIST="packages/google-cloud-core" - fi - fi ci/run_conditional_tests.sh docfx: @@ -114,13 +107,6 @@ jobs: # TODO(https://github.com/googleapis/google-cloud-python/issues/13775): Specify `PY_VERSION` rather than relying on the default python version of the nox session. PY_VERSION: "unused" run: | - if [[ "${{ github.event_name }}" == "pull_request" ]]; then - git fetch --no-tags --quiet origin "${TARGET_BRANCH}:refs/remotes/origin/${TARGET_BRANCH}" --depth=200 || true - if ! git diff --quiet "origin/${TARGET_BRANCH}..." -- .github/workflows/docs.yml && git diff --quiet "origin/${TARGET_BRANCH}..." -- packages/ preview-packages/; then - echo "Workflow modified with no package changes; testing packages/google-cloud-core." - export PACKAGE_LIST="packages/google-cloud-core" - fi - fi ci/run_conditional_tests.sh - name: Create issue on failure if: ${{ failure() && github.event_name == 'push' && github.repository == 'googleapis/google-cloud-python' }} From 8067503977bf4b6708b5bc6cb311240a68206810 Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Thu, 17 Sep 2026 17:23:25 -0700 Subject: [PATCH 6/6] disabled runs when yaml was touched --- .github/workflows/docs.yml | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 00e08fce745e..566c831d8e9e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -25,23 +25,8 @@ env: PARALLEL_WORKERS: "4" jobs: - check_changes: - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest - outputs: - run_docfx: ${{ steps.filter.outputs.docfx }} - steps: - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - persist-credentials: false - - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 - id: filter - with: - filters: | - docfx: - - '.github/workflows/docs.yml' - docs: + if: github.event_name != 'push' runs-on: ubuntu-latest steps: - name: Checkout @@ -62,7 +47,7 @@ jobs: python -m pip install nox uv - name: Run docs env: - BUILD_TYPE: ${{ github.event_name == 'push' && 'continuous' || 'presubmit' }} + BUILD_TYPE: presubmit TARGET_BRANCH: ${{ github.base_ref || github.event.merge_group.base_ref || github.ref_name }} TEST_TYPE: docs # TODO(https://github.com/googleapis/google-cloud-python/issues/13775): Specify `PY_VERSION` rather than relying on the default python version of the nox session. @@ -71,12 +56,7 @@ jobs: ci/run_conditional_tests.sh docfx: - needs: [check_changes] - if: >- - always() && ( - (github.event_name == 'push' && github.ref == 'refs/heads/main') || - needs.check_changes.outputs.run_docfx == 'true' - ) + if: github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest permissions: contents: read @@ -100,7 +80,7 @@ jobs: python -m pip install nox uv - name: Run docfx env: - BUILD_TYPE: ${{ github.event_name == 'push' && 'continuous' || 'presubmit' }} + BUILD_TYPE: continuous TARGET_BRANCH: ${{ github.base_ref || github.event.merge_group.base_ref || github.ref_name }} TEST_TYPE: docfx CONTINUE_ON_ERROR: "true"