Repository navigation
Description
Problem or Motivation
On 2026-11-12, devops-cli had two Pages deploy paths: GET /repos/dan-petty/devops-cli/pages gave build_type: legacy, and .github/workflows/pages.yml also deployed. Each push that changed docs/ made 2 deployments. No check reported it after #4656 merged on 2026-11-11, because nothing reads the Pages state. The site also had 183 links to a 404 page. No job checks the Pages site of a Service repository.
Proposed Solution & Architectural Design
Add devops roadmap step pages-health --repo <owner/repo> on the step frame of #5014 (src/devops_cli/commands/roadmap_step.py). The setting roadmap.pages_health.mode has the type RowMode (off|plan|on) and the default plan (ADR 0021 rule 5). The step files and edits issues through the finding-issue module (child 2). Checks, all by rule, with no model:
- Deploy paths:
build_typeislegacy, and a workflow file of the repository usesactions/deploy-pages. The issue names the owner step (set the source to GitHub Actions), because it is a repository setting. - Failed or late deploy: the latest Pages build or Pages workflow run failed. Or the live build commit is older than the newest commit that changed the site paths, for more than 24 hours. The step reads the
devops-build-commitmeta tag of child 1, and else theLast-Modifiedheader. - Pages that 404: lychee (pinned by digest) checks the URLs of the live
sitemap.xmland their internal links. External links are out of scope. - Site build warnings: the step runs the site build command of the repository profile (feat(roadmap): track one project profile for all repositories #4627). Until the profile reader exists, it finds
zensical.toml,mkdocs.yml,conf.pyordocs/_config.yml. - A repository with no Pages site (
GET /pagesgives 404) has no finding.
Each finding group is one check, with one key (pages:deploy-paths, pages:deploy, or one page path). --dry-run sends 0 requests.
Target Subsystem
SDLC, Git & PR Governance (src/devops_cli/roadmap/steps/, src/devops_cli/github/pages.py).
Existing Tool Considered
The GitHub Pages REST API (src/devops_cli/github/pages.py reads it today), lychee (Apache-2.0 or MIT, in use in docs-site.yml) and the site generator of each repository. Custom code: about 200 lines with tests. Cost (estimate): about 250,000 tokens and 1 day elapsed.
Acceptance Criteria
- A fixture with
build_type: legacyand adeploy-pagesworkflow gives 1pages:deploy-pathsgroup. A fixture withbuild_type: workflowgives 0. - A fixture with a 404 page in the sitemap gives 1 group for that page.
- A repository with no Pages site gives 0 groups.
- Mode
planwrites nothing.--dry-runsends 0 requests.
Dependencies
- feat(docs): move the docs site to Zensical with a full nav and version #5152 (the build commit meta tag).
- feat(roadmap): file, update and close finding issues by fingerprint #5153 (the finding-issue module).
Source: #5151
Alternatives check of 2026-11-27: partly.
Tool: lycheeverse/lychee (https://github.com/lycheeverse/lychee), Apache-2.0, last activity 2026-11-23, maintained.
Reason: Searches found no tool that inspects Pages deploy state, but lychee, already used by the project, checks the live site's pages and internal links for 404s, covering only the broken-page part of the need.
Covers:
- Checks a live site's URLs and internal links for 404s
- Exclude patterns and status-code filters limit the checked set
- JSON output names each failing URL for the finding group
Lacks:
- Does not read Pages build_type or detect a second deploy path
- Does not read deploy workflow runs or report a failed deploy
- Does not compare live build commit with the newest site commit
Proposed design
Problem statement
Add the pages-health roadmap step to report duplicate Pages deploy paths, failed or late deploys, and 404 pages. The step uses lychee for the 404 check and custom code for the deploy-state checks. It depends on #5153. The site build warning check is deferred to a new issue.
Acceptance criteria
Requirement: Command registration
The devops roadmap step pages-health --repo <owner/repo> command SHALL be registered on the roadmap step group.
Scenario: Help lists pages-health
- WHEN a user runs
devops roadmap step --help - THEN the help output lists
pages-health.
Requirement: Mode setting default
The setting roadmap.pages_health.mode SHALL have the type RowMode and the default plan.
Scenario: Default settings
- WHEN the settings load with no
roadmap.pages_health.modevalue - THEN
roadmap.pages_health.modeisplan.
Requirement: Deploy-path finding
The step SHALL return one pages:deploy-paths group when GET /pages gives build_type: legacy and a workflow file of the repository uses actions/deploy-pages.
Scenario: Legacy site with a deploy workflow
- WHEN a fixture gives
build_type: legacyand a workflow file that usesactions/deploy-pages - THEN the step returns one group with the key
pages:deploy-pathsand the group body names the owner action to set the Pages source to GitHub Actions.
Requirement: Workflow site has no deploy-path finding
The step MUST return no pages:deploy-paths group when GET /pages gives build_type: workflow.
Scenario: Workflow-built site
- WHEN a fixture gives
build_type: workflow - THEN the step returns no group with the key
pages:deploy-paths.
Requirement: Deploy workflow discovery
The step SHALL find the deploy workflow by scanning the files under .github/workflows/ for actions/deploy-pages.
Scenario: Deploy workflow with another name
- WHEN a fixture repository holds
.github/workflows/site.ymlwithactions/deploy-pages - THEN the planned requests hold
repos/{owner}/{repo}/actions/workflows/site.yml/runs.
Requirement: Workflow build history
The step MUST NOT read GET /repos/{owner}/{repo}/pages/builds when GET /pages gives build_type: workflow.
Scenario: Workflow-built site history
- WHEN a fixture gives
build_type: workflow - THEN the planned requests hold no path that ends in
pages/builds.
Requirement: Legacy build history
The step SHALL read GET /repos/{owner}/{repo}/pages/builds when GET /pages gives build_type: legacy and no workflow uses actions/deploy-pages.
Scenario: Legacy-only site history
- WHEN a fixture gives
build_type: legacyand no workflow usesactions/deploy-pages - THEN the planned requests hold
repos/{owner}/{repo}/pages/buildsand no actions workflow runs request.
Requirement: Both deploy paths history
The step SHALL read both the legacy Pages builds and the deploy workflow runs when GET /pages gives build_type: legacy and a workflow uses actions/deploy-pages.
Scenario: Two deploy paths
- WHEN a fixture gives
build_type: legacyand.github/workflows/pages.ymlusesactions/deploy-pages - THEN the planned requests hold
repos/{owner}/{repo}/pages/buildsandrepos/{owner}/{repo}/actions/workflows/pages.yml/runs.
Requirement: Failed deploy
The step SHALL return one pages:deploy group when the latest deploy record from the selected deploy history reports a failure.
Scenario: Failed deploy run
- WHEN a fixture gives a latest deploy record with
conclusion: failure - THEN the step returns one group with the key
pages:deploy.
Requirement: Late deploy
The step SHALL return one pages:deploy group when the live build commit is older than the newest commit that changed a site path by more than 24 hours.
Scenario: Late deploy
- WHEN a fixture gives a live build commit that is 25 hours older than the newest site-path commit
- THEN the step returns one group with the key
pages:deploythat names both commits.
Requirement: Live build commit
The step MUST read the live build commit from the devops-build-commit meta tag and MUST use the Last-Modified header as the build time when that tag is absent.
Scenario: Meta tag absent
- WHEN a fixture live page has no
devops-build-commitmeta tag and has aLast-Modifiedheader - THEN the step uses the time of the
Last-Modifiedheader as the build time.
Requirement: Site paths from the deploy workflow
The step SHALL read the site paths from the on.push.paths of the deploy workflow.
Scenario: Site path list
- WHEN the deploy workflow lists
docs/**underon.push.pathsand a commit changesdocs/page.md - THEN the step counts that commit as a site commit.
Requirement: Site path from the Pages source
The step MUST use source.branch and source.path from GET /pages as the site path when the build is legacy and no deploy workflow exists.
Scenario: Legacy site path
- WHEN a fixture gives
build_type: legacywithsource.branch: mainandsource.path: /docs, and a commit changesdocs/page.md - THEN the step counts that commit as a site commit.
Requirement: Page that returns 404
The step SHALL return one group for each URL of the live sitemap.xml that lychee reports as 404.
Scenario: 404 page in the sitemap
- WHEN a fixture
sitemap.xmlholds a URL and the lychee binary reports that URL as 404 - THEN the step returns one group keyed by that page path.
Requirement: Site without a sitemap
The step MUST check the internal links of the live home page when the site publishes no sitemap.xml.
Scenario: No sitemap
- WHEN a fixture site answers 404 for
sitemap.xmland its home page holds one internal link - THEN the step checks that link with lychee and returns one group for each link that lychee reports as 404.
Requirement: External links out of scope
The step MUST pass only internal links to lychee and MUST NOT report an external link as a 404 page.
Scenario: External link
- WHEN a fixture page holds one external link and lychee reports that external link as 404
- THEN the step returns no group for that external link.
Requirement: No Pages site
The step MUST return no group when GET /pages gives 404.
Scenario: Repository with no Pages site
- WHEN a fixture answers
GET /repos/{owner}/{repo}/pageswith 404 - THEN the step returns no group.
Requirement: Off mode sends nothing
The step MUST send no request and return no group when roadmap.pages_health.mode is off.
Scenario: Off mode
- WHEN the mode is
offand the fixtures would give one finding - THEN the step sends no request and returns no group.
Requirement: Plan mode writes nothing
The step MUST write nothing when roadmap.pages_health.mode is plan.
Scenario: Plan mode
- WHEN the mode is
planand the fixtures give one finding - THEN the step sends no write request and its result line holds the finding.
Requirement: On mode files an issue
The step SHALL file each group through the finding-issue module when roadmap.pages_health.mode is on.
Scenario: On mode
- WHEN the mode is
onand the fixtures give one finding - THEN the step calls the finding-issue module once for the group and returns its issue number.
Requirement: Dry run sends no request
The step MUST send 0 requests with --dry-run.
Scenario: Dry run
- WHEN the step runs with
--dry-run - THEN the step prints the planned requests and sends 0 requests.
Requirement: Lychee missing
The step MUST exit 1 with a typed stop that names lychee when no lychee executable is on PATH.
Scenario: Lychee missing
- WHEN no
lycheeexecutable is onPATH - THEN the step exits 1 with a typed stop that names
lychee.
Requirement: No Pages setting change
The step MUST NOT send a request that changes the Pages source.
Scenario: Legacy site with a deploy workflow
- WHEN a fixture gives
build_type: legacyand a workflow that usesactions/deploy-pages - THEN the planned requests hold no
PATCH repos/{owner}/{repo}/pages.
Existing Tool Considered
The alternatives check in the issue body gives lychee (https://github.com/lycheeverse/lychee) the verdict partly. It covers the live-site 404 check; the issue body block lists what it lacks. The step uses lychee for the 404 check and adds the deploy-state checks that lychee lacks: it reads GET /repos/{owner}/{repo}/pages for build_type, reads the deploy workflow runs or legacy Pages builds, and compares the live build commit with the newest site-path commit. The custom code costs about 200 lines with tests, about 250,000 tokens and 1 day elapsed.
Key questions
- Where do the step module and its command live?: The step module is
src/devops_cli/roadmap/steps/pages_health.py. The command issrc/devops_cli/commands/roadmap_step_pages_health.py. One line insrc/devops_cli/commands/roadmap_step.pyregisters it. (best practice) [sources: src/devops_cli/commands/roadmap_step.py]- Chosen: New step module and command. The group defines each subcommand in its own module and registers it with one line.
- Rejected: Add the step to an existing command. It mixes two steps in one module and breaks the step frame.
- Which GitHub API gives the deploy history?: Read
GET /repos/{owner}/{repo}/pages/buildsfor alegacybuild. Read the runs of the workflow that usesactions/deploy-pagesfor aworkflowbuild. Read both when both deploy paths exist. (best practice) [sources: openspec/changes/archive/2026-11-13-5212-remove-the-legacy-pages-build-tooling/proposal.md:8, .github/workflows/pages.yml, src/devops_cli/github/pages.py]- Rejected: Workflow runs only. It misses a failed legacy build when no deploy workflow exists.
- Rejected:
GET /pages/buildsonly. The archived change records that this list holds only the legacy builds, so it misses the runs ofpages.yml. - Chosen: Source by
build_type, both when both exist. Each source holds the deploy history of its build type, and the deploy-path finding covers the case with both.
- How does the step find the deploy workflow?: Read the files under
.github/workflows/through the GitHub contents API and take the file that usesactions/deploy-pages. (best practice) [sources: .github/workflows/pages.yml]- Chosen: Scan the workflow files. A managed repository can name its deploy workflow differently, and the file that uses
actions/deploy-pagesis the deploy path. - Rejected: Hard-code
pages.yml. The name is not the same in each repository.
- Chosen: Scan the workflow files. A managed repository can name its deploy workflow differently, and the file that uses
- How does the step find the site paths?: Read
on.push.pathsof the deploy workflow. Readsource.branchandsource.pathfromGET /pageswhen the build islegacyand no deploy workflow exists. (best practice) [sources: .github/workflows/pages.yml, src/devops_cli/github/pages.py]- Chosen: Workflow
on.push.pathsand legacysource.path. Each deploy path already names the files that start a build. - Rejected: A path list in the step. Two lists drift, and the workflow list is the one that starts the build.
- Rejected: Every commit on
main. A commit tosrc/changes no site file and would report a false late deploy.
- Chosen: Workflow
- How does the step find the live build commit and build time?: Read the
devops-build-commitmeta tag of the live home page. Use the time of theLast-Modifiedheader as the build time when the tag is absent. (best practice) [sources: overrides/main.html, src/devops_cli/docs/site.py]- Chosen:
devops-build-commitmeta tag.overrides/main.htmlwrites the commit into the tag of each page, so it gives the exact commit of the build. - Rejected:
Last-Modifiedheader. It gives the time of the file, not the commit, so it is only the fallback.
- Chosen:
- How does the step compare the live build age with the newest site commit?: Read the commit date of the live build commit and the newest commit that changed a site path through the GitHub commits API. Return
pages:deploywhen the live commit is more than 24 hours older. (best practice) [sources: src/devops_cli/github/client.py]- Chosen: GitHub commits API dates. The API gives the commit date and can filter commits by path.
- Rejected:
Last-Modifiedheader only. It gives no commit date and cannot tell which site commit is newer. - Rejected: Local
git log. The step reads a managed repository that it may not have checked out.
- Which pages does the 404 check cover?: Read the URLs of the live
sitemap.xmland their internal links. Read the internal links of the live home page whensitemap.xmlanswers 404. Pass only internal links to lychee. (best practice) [sources: zensical.toml, src/devops_cli/docs/site.py]- Chosen: Sitemap URLs and their internal links. It covers each page that the site publishes, and lychee checks each URL and its internal links.
- Rejected: Internal links of the home page only. It misses a page that no other page links to.
- Rejected: A local build of the site. The live site is the subject, and a local build hides a deploy fault.
- How does the step run lychee?: Use
require_binaryand run thelycheeexecutable by name, as the docs build runszensical. (best practice) [sources: src/devops_cli/docs/site.py, AGENTS.md]- Chosen: Run
lycheeby name throughrequire_binary.src/devops_cli/docs/site.pyuses this pattern for thezensicalbinary. - Rejected: Build a link checker in the step. lychee covers the 404 check and is maintained, so new code is not needed.
- Rejected: Pin a digest in the step. The repository runs its tools by name; the step keeps that pattern.
- Chosen: Run
- What does each mode of
roadmap.pages_health.modedo?:offsends nothing and skips the step.plancomputes the groups and writes nothing.onfiles each group through the finding-issue module. (best practice) [sources: src/devops_cli/config/defaults.py:1273, src/devops_cli/roadmap/steps/review.py]- Chosen:
RowMode(off|plan|on) with defaultplan. Every other roadmap row declares its mode asRowModewith aplandefault. - Rejected: A boolean setting. It gives no dry mode, and the other rows use three modes.
- Chosen:
- How does the step send 0 requests with
--dry-run?: Build each GitHub request withplanned_ghand each site request as aPlannedRequest. Print the plan and send nothing. (best practice) [sources: src/devops_cli/github/pages.py, src/devops_cli/dry_run/requests.py:16, src/devops_cli/roadmap/request_plan.py]- Chosen:
planned_ghandPlannedRequest.src/devops_cli/github/pages.pybuilds its Pages request this way, andrequest_plan.pyis the helper every job plans with. - Rejected: A separate dry-run branch in each check. Two code paths make a second path to test.
- Chosen:
- Does the step change the Pages source?: No. The step reports the finding and names the owner action to set the Pages source to GitHub Actions. Only a person changes a repository setting. (best practice) [sources: AGENTS.md]
- Chosen: Report the finding and name the owner action.
AGENTS.mdgives a repository setting to a person only. - Rejected: Change the Pages source in the step. The step would change a repository setting.
- Chosen: Report the finding and name the owner action.
- Does the step use the legacy Pages build command?: No. The archived change chore(gh): remove the legacy GitHub Pages build tooling #5212 removed the legacy Pages build tooling. The step reads the GitHub REST API directly. (best practice) [sources: openspec/changes/archive/2026-11-13-5212-remove-the-legacy-pages-build-tooling/proposal.md:8, src/devops_cli/github/pages.py]
- Chosen: Read the GitHub REST API directly. The legacy build command is gone, so the step keeps one path that no removal touches.
- Rejected: Use
devops gh pages builds. The archived change chore(gh): remove the legacy GitHub Pages build tooling #5212 removed it, and it readGET /pages/builds, which holds only the legacy builds.
- Does the step still wait on feat(docs): move the docs site to Zensical with a full nav and version #5152 for the live build commit?: No. feat(docs): move the docs site to Zensical with a full nav and version #5152 is done.
overrides/main.htmlwrites the commit into thedevops-build-commitmeta tag of each built page, andsrc/devops_cli/docs/site.pyholds the tag name. [sources: overrides/main.html, src/devops_cli/docs/site.py]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 12, 2026
Both concern GitHub Pages in devops-cli, but #4656 fixed the deploy source while this candidate adds a roadmap step that detects deploy faults and 404 pages.dan-petty commentedon Nov 12, 2026
Facts of main at 050a6ef (2026-11-12), after #5183 moved the docs site to Zensical:
.github/workflows/docs-site.yml. This item says that lychee is in use indocs-site.yml, which is no longer true. The 404 check must bring its own pinned lychee.docs/_config.ymlis deleted. The Jekyll settings file is no longer a site build signal for this repository.GET repos/dan-petty/devops-cli/pagesgivesbuild_type: workflow. This repository is now theworkflowcase of the deploy-paths check.GET repos/dan-petty/devops-cli/pages/buildsstops at f4b1d73, the last run of the GitHub-managedpages-build-deploymentworkflow. It does not list the deploys ofpages.yml. So the health step must read thepages.ymlruns (actions/workflows/pages.yml/runs) or thegithub-pagesdeployments (deployments?environment=github-pages), not/pages/builds.#5212 removes
devops gh pages buildsanddevops gh pages build, so this item cannot use them.devops-cli-service commentedon Nov 16, 2026
Alternatives check: partly
Reason: Lychee (lycheeverse/lychee) is a maintained, Apache-2.0 link checker that covers the 404-page detection check (verifying URLs from a live sitemap.xml and their internal links), but it does not cover the other three checks the issue requires: deploy-path detection (build_type legacy + deploy-pages workflow), failed/late deploy detection, and site build warning detection. No other tool found covers the combined need.
Tool: lycheeverse/lychee (https://github.com/lycheeverse/lychee)
Covers:
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Refine cannot set this item to Ready at c58b592 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 26, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Nov 29, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
test(security): register DEVOPS_CLI_ROADMAP_PAGES_HEALTH_MODE (#5154)
test(roadmap): raise pages-health changed-line coverage (#5154)
chore(main): release 0.247.0 (#7752)
devops-cli-service commentedon Nov 29, 2026
Released in v0.247.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.247.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 16:17 UTC