Skip to content

feat(roadmap): a Pages health step finds deploy faults and missing pages #5154

Done

Description

@dan-petty

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_type is legacy, and a workflow file of the repository uses actions/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-commit meta tag of child 1, and else the Last-Modified header.
  • Pages that 404: lychee (pinned by digest) checks the URLs of the live sitemap.xml and 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.py or docs/_config.yml.
  • A repository with no Pages site (GET /pages gives 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: legacy and a deploy-pages workflow gives 1 pages:deploy-paths group. A fixture with build_type: workflow gives 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 plan writes nothing. --dry-run sends 0 requests.

Dependencies

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.mode value
  • THEN roadmap.pages_health.mode is plan.

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: legacy and a workflow file that uses actions/deploy-pages
  • THEN the step returns one group with the key pages:deploy-paths and 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.yml with actions/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: legacy and no workflow uses actions/deploy-pages
  • THEN the planned requests hold repos/{owner}/{repo}/pages/builds and 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: legacy and .github/workflows/pages.yml uses actions/deploy-pages
  • THEN the planned requests hold repos/{owner}/{repo}/pages/builds and repos/{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:deploy that 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-commit meta tag and has a Last-Modified header
  • THEN the step uses the time of the Last-Modified header 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/** under on.push.paths and a commit changes docs/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: legacy with source.branch: main and source.path: /docs, and a commit changes docs/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.xml holds 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.xml and 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}/pages with 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 off and 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 plan and 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 on and 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 lychee executable is on PATH
  • 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: legacy and a workflow that uses actions/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 is src/devops_cli/commands/roadmap_step_pages_health.py. One line in src/devops_cli/commands/roadmap_step.py registers 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/builds for a legacy build. Read the runs of the workflow that uses actions/deploy-pages for a workflow build. 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/builds only. The archived change records that this list holds only the legacy builds, so it misses the runs of pages.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 uses actions/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-pages is the deploy path.
    • Rejected: Hard-code pages.yml. The name is not the same in each repository.
  • How does the step find the site paths?: Read on.push.paths of the deploy workflow. Read source.branch and source.path from GET /pages when the build is legacy and no deploy workflow exists. (best practice) [sources: .github/workflows/pages.yml, src/devops_cli/github/pages.py]
    • Chosen: Workflow on.push.paths and legacy source.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 to src/ changes no site file and would report a false late deploy.
  • How does the step find the live build commit and build time?: Read the devops-build-commit meta tag of the live home page. Use the time of the Last-Modified header as the build time when the tag is absent. (best practice) [sources: overrides/main.html, src/devops_cli/docs/site.py]
    • Chosen: devops-build-commit meta tag. overrides/main.html writes the commit into the tag of each page, so it gives the exact commit of the build.
    • Rejected: Last-Modified header. It gives the time of the file, not the commit, so it is only the fallback.
  • 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:deploy when 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-Modified header 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.xml and their internal links. Read the internal links of the live home page when sitemap.xml answers 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_binary and run the lychee executable by name, as the docs build runs zensical. (best practice) [sources: src/devops_cli/docs/site.py, AGENTS.md]
    • Chosen: Run lychee by name through require_binary. src/devops_cli/docs/site.py uses this pattern for the zensical binary.
    • 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.
  • What does each mode of roadmap.pages_health.mode do?: off sends nothing and skips the step. plan computes the groups and writes nothing. on files 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 default plan. Every other roadmap row declares its mode as RowMode with a plan default.
    • Rejected: A boolean setting. It gives no dry mode, and the other rows use three modes.
  • How does the step send 0 requests with --dry-run?: Build each GitHub request with planned_gh and each site request as a PlannedRequest. 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_gh and PlannedRequest. src/devops_cli/github/pages.py builds its Pages request this way, and request_plan.py is the helper every job plans with.
    • Rejected: A separate dry-run branch in each check. Two code paths make a second path to test.
  • 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.md gives a repository setting to a person only.
    • Rejected: Change the Pages source in the step. The step would change a repository setting.
  • 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 read GET /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.html writes the commit into the devops-build-commit meta tag of each built page, and src/devops_cli/docs/site.py holds the tag name. [sources: overrides/main.html, src/devops_cli/docs/site.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#5153

Moved to new items

#7668

Activity

  1. added
    source/agent
    on Nov 12, 2026
  2. added
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 12, 2026
  3. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 12, 2026
  5. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Facts of main at 050a6ef (2026-11-12), after #5183 moved the docs site to Zensical:

    • The lychee step is gone from .github/workflows/docs-site.yml. This item says that lychee is in use in docs-site.yml, which is no longer true. The 404 check must bring its own pinned lychee.
    • docs/_config.yml is deleted. The Jekyll settings file is no longer a site build signal for this repository.
    • GET repos/dan-petty/devops-cli/pages gives build_type: workflow. This repository is now the workflow case of the deploy-paths check.
    • GET repos/dan-petty/devops-cli/pages/builds stops at f4b1d73, the last run of the GitHub-managed pages-build-deployment workflow. It does not list the deploys of pages.yml. So the health step must read the pages.yml runs (actions/workflows/pages.yml/runs) or the github-pages deployments (deployments?environment=github-pages), not /pages/builds.

    #5212 removes devops gh pages builds and devops gh pages build, so this item cannot use them.

  6. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    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)

    • License: Apache-2.0
    • Last activity: 2026-11-13
    • Maintained: yes

    Covers:

    • 404 page detection by checking URLs in sitemap.xml and their internal links

    Lacks:

    • Deploy-path detection (build_type legacy alongside actions/deploy-pages workflow)
    • Failed or late deploy detection via Pages API
    • Site build warning detection

    Tools considered:

    Searches run:

    • open source GitHub Pages health check tool detect broken links failed builds sitemap, results: 5
    • lychee link checker GitHub Pages 404 detection CI, results: 5
    • GitHub Pages deployment health monitor open source tool detect failed deploys, results: 5
    • link checker tool detect 404 pages sitemap.xml open source lychee alternatives, results: 5
    • lychee broken link checker github.com, results: 5
    • lychee link checker rust github manusa, results: 5
    • lychee broken link checker github repository, results: 5
    • "GitHub Pages" health check tool "build_type" OR "deploy-pages" OR "sitemap" monitoring open source, results: 5
    • GitHub Pages build health monitor "pages/builds" tool CLI, results: 5
    • website health check tool detect broken links sitemap verify deploy status CI pipeline, results: 5

    Sources:

    Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.

  7. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    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.

  8. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    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.

  9. added
    status/ready
    and removed
    status/new
    on Nov 29, 2026
  10. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

  11. added
    status/in-progress
    and removed
    status/ready
    on Nov 29, 2026
  12. added
    status/in-review
    and removed
    status/in-progress
    on Nov 29, 2026
  13. removed
    status/in-review
    on Nov 29, 2026
  14. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-29 16:17 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions