mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-12-03 18:43:38 +01:00
Docs-only pull requests and pushes skip Build and Test's frontend lint
job via scripts/ci_docs_only.py, relying on .github/workflows/public-docs.yml
to guard public documentation and shipped in-app Help. Previously, Public
docs omitted four frontend doc-lint audits that only ran under Build and
Test's npm run lint:
- Run the three zero-dependency Node doc audits unconditionally before
the docs recipe shards in Public docs (no actions/setup-node or npm ci
overhead): feature-release-audit.mjs (blocks unreleased build/preview
feature guides from shipped Help and release notes),
external-domain-audit.mjs (blocks fabricated Pulse-branded domains),
and planning-doc-status-audit.mjs (requires explicit Status headers on
docs/*_{SPEC,PLAN,CONTRACT}.md).
- Run npm run lint:shipped-docs-links (added in #5448) inside Public
docs' existing in-app Help check immediately after npm ci so broken
relative repository links, invalid /docs/* routes, and missing heading
anchors fail docs-only PRs before merging.
- Extend scripts/tests/test_public_docs_workflow.py to assert all four
workflow steps and ordering, execute the three zero-dependency audits
against both the live repository and failing/passing temporary git
fixtures, and verify the package.json script binding for
lint:shipped-docs-links.
Contract-Neutral: Extends the Public docs GitHub Actions workflow and its workflow contract tests to run existing frontend doc-lint audits on docs-only changes with no runtime, API, schema, or subsystem contract delta.
Change-source: pulse-maintainer
154 lines
6.1 KiB
YAML
154 lines
6.1 KiB
YAML
name: Public docs
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "*.md"
|
|
- "docs/**"
|
|
- "frontend-modern/public/docs/**"
|
|
- ".github/ISSUE_TEMPLATE/**"
|
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
|
- "scripts/check_public_docs.py"
|
|
- "scripts/check_docs_mirror.py"
|
|
- "scripts/readme_entrypoints_test.py"
|
|
# Match the docs inventory in scripts/tests/run.sh, its local fixture
|
|
# imports and its runner. Other smoke suites keep their Build and Test
|
|
# route without taking four recipe slots and a second verdict runner.
|
|
- "scripts/tests/test_*docs*.py"
|
|
- "scripts/tests/test_vm_disk_diagnostics.py"
|
|
- "scripts/tests/test_troubleshooting_logs.py"
|
|
- "scripts/tests/test-retired-trial-acquisition-docs.sh"
|
|
- "scripts/tests/agent_installer_test_support.py"
|
|
- "scripts/tests/run.sh"
|
|
- "scripts/run-script-tests.py"
|
|
- "scripts/run-docs-shards.py"
|
|
- "scripts/ci_docs_only.py"
|
|
- "scripts/select-smoke-test-shard.py"
|
|
- ".github/scripts/docs-test-seconds.txt"
|
|
- "scripts/test-vm-disk.sh"
|
|
- ".github/workflows/public-docs.yml"
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "*.md"
|
|
- "docs/**"
|
|
- "frontend-modern/public/docs/**"
|
|
- ".github/ISSUE_TEMPLATE/**"
|
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
|
- "scripts/check_public_docs.py"
|
|
- "scripts/check_docs_mirror.py"
|
|
- "scripts/readme_entrypoints_test.py"
|
|
- "scripts/tests/test_*docs*.py"
|
|
- "scripts/tests/test_vm_disk_diagnostics.py"
|
|
- "scripts/tests/test_troubleshooting_logs.py"
|
|
- "scripts/tests/test-retired-trial-acquisition-docs.sh"
|
|
- "scripts/tests/agent_installer_test_support.py"
|
|
- "scripts/tests/run.sh"
|
|
- "scripts/run-script-tests.py"
|
|
- "scripts/run-docs-shards.py"
|
|
- "scripts/ci_docs_only.py"
|
|
- "scripts/select-smoke-test-shard.py"
|
|
- ".github/scripts/docs-test-seconds.txt"
|
|
- "scripts/test-vm-disk.sh"
|
|
- ".github/workflows/public-docs.yml"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: public-docs-${{ github.ref }}
|
|
# Main needs a complete verdict even when several doc changes land quickly.
|
|
# Keep one active run and let GitHub replace only the pending main run.
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
jobs:
|
|
# Preserve the existing required check name on one ubuntu-24.04 runner.
|
|
# Fast static validations fail before recipe work; all four isolated recipe
|
|
# shards then run concurrently without dependency setup, followed by
|
|
# conditional Help assertions when guides change.
|
|
check:
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 10
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
fetch-depth: 2
|
|
|
|
- name: Validate public documentation
|
|
env:
|
|
PUBLIC_DOCS_BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
|
|
run: python3 scripts/check_public_docs.py
|
|
|
|
- name: Check getting-started safety and current plans
|
|
run: python3 scripts/readme_entrypoints_test.py
|
|
|
|
- name: Check shipped docs mirror sync
|
|
run: python3 scripts/check_docs_mirror.py
|
|
|
|
- name: Check documentation safety workflow contract
|
|
run: python3 scripts/tests/test_public_docs_workflow.py
|
|
|
|
- name: Check unreleased feature guide boundaries
|
|
working-directory: frontend-modern
|
|
run: node scripts/feature-release-audit.mjs
|
|
|
|
- name: Check external Pulse-branded domains
|
|
working-directory: frontend-modern
|
|
run: node scripts/external-domain-audit.mjs
|
|
|
|
- name: Check planning document status headers
|
|
working-directory: frontend-modern
|
|
run: node scripts/planning-doc-status-audit.mjs
|
|
|
|
# Build and Test skips smoke for docs-only changes. Discover and run
|
|
# all four isolated docs shards concurrently inside this runner without
|
|
# dependency setup; measured whole-suite scheduling retains sorted,
|
|
# isolated execution and every recipe deadline.
|
|
- name: Exercise documentation safety and diagnostic recipes
|
|
run: python3 scripts/run-docs-shards.py
|
|
|
|
# A byte-identical guide can still break a rendered Help assertion.
|
|
# Build and Test skips its unit job for Markdown-only diffs. Exercise the
|
|
# existing Help suites here without a bundle build or dependency audit.
|
|
- name: Detect in-app Help changes
|
|
id: help
|
|
env:
|
|
BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
|
|
run: |
|
|
if [[ "$BASE_SHA" =~ ^[0-9a-f]{40}$ ]] &&
|
|
git diff --quiet --no-ext-diff --no-renames "$BASE_SHA" HEAD -- \
|
|
':(glob)docs/*.md' frontend-modern/public/docs \
|
|
ARCHITECTURE.md CONTRIBUTING.md SECURITY.md TERMS.md \
|
|
.github/workflows/public-docs.yml; then
|
|
echo "required=false" >> "$GITHUB_OUTPUT"
|
|
else
|
|
# A missing or unreachable comparison base is not a clean diff.
|
|
echo "required=true" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Set up Node.js for Help assertions
|
|
if: steps.help.outputs.required != 'false'
|
|
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
node-version: '24'
|
|
cache: npm
|
|
cache-dependency-path: frontend-modern/package-lock.json
|
|
|
|
- name: Install locked Help test dependencies
|
|
if: steps.help.outputs.required != 'false'
|
|
working-directory: frontend-modern
|
|
run: npm ci --no-audit --no-fund
|
|
|
|
- name: Audit shipped in-app Help links
|
|
if: steps.help.outputs.required != 'false'
|
|
working-directory: frontend-modern
|
|
run: npm run lint:shipped-docs-links
|
|
|
|
- name: Check in-app Help content and links
|
|
if: steps.help.outputs.required != 'false'
|
|
working-directory: frontend-modern
|
|
run: npm run test -- src/features/docs/__tests__ src/utils/__tests__/docsLinks.test.ts
|