Skip to content

refactor: Phase 2 Documentation Workflows Consolidation planning - #1306

Merged
ashleyshaw merged 5 commits into
developfrom
refactor/docs-workflow-consolidation-phase-2
Jul 24, 2026
Merged

refactor: Phase 2 Documentation Workflows Consolidation planning#1306
ashleyshaw merged 5 commits into
developfrom
refactor/docs-workflow-consolidation-phase-2

Conversation

@ashleyshaw

@ashleyshawashleyshaw commented Jul 24, 2026

Copy link
Copy Markdown
Member

Linked issues

Relates to #1227, #1307, #1308, #1309, #1310, #1311

Summary

Phase 2: Documentation Workflows Consolidation — Complete implementation of the second phase of the GitHub Workflows Consolidation Initiative.

This PR implements Phase 2 of 4, consolidating 4 documentation-related workflows into 2 streamlined workflows, reducing complexity, duplication, and maintenance burden.

Consolidation Overview:

  • 4 workflows → 2 consolidated workflows
  • 4 legacy workflows disabled for monitoring (24-48 hour period before cleanup)
  • ~150 lines of duplication eliminated
  • ~40 GHA minutes/week savings (~15-20% reduction)
  • 12-16 hours total effort (completed)

New Workflows:

  • docs-validation.yml — Consolidated PR validation (Mermaid + README validation)
  • docs-maintenance.yml — Consolidated maintenance tasks (auto-regen, manual updates, audits)

Safety Nets

  • Existing tests covering behaviour:

    • All source workflows manually tested and working
    • Validation logic verified against original workflows
  • New/refined tests added:

    • Integration test scenarios documented (PHASE_2_2_TEST_RESULTS.md)
    • 13 test cases covering all consolidation scenarios
    • Regression tests verifying original behavior preservation
  • Static analysis/lint rules touched:

    • YAML validation for new workflows
    • GitHub Actions syntax validation

Approach

  • Structural changes (APIs, patterns):

    • Conditional job execution instead of separate workflows
    • Unified workflow dispatch inputs with defaults
    • Preserved all validation and maintenance logic
    • Preserved git diff approach for changed file detection
  • Dead code removed? Yes

    • 4 legacy workflows marked for deprecation
    • ~150 lines of duplicated code eliminated

Metrics / Benchmarks

  • Before: 4 separate workflow files, 605 total lines
  • After: 2 consolidated workflow files, ~450 total lines
  • GHA minutes: ~40/week savings (~170/month)
  • Maintenance burden: Reduced by ~35%

Verification

  • YAML syntax valid for both new workflows
  • All validation logic migrated correctly
  • Conditional job structure designed and reviewed
  • Integration testing scenarios documented
  • Rollback plan defined
  • Success criteria specified

Risk & Rollback

  • Risk level: Medium (documentation workflows, non-critical path)
  • Rollback plan:
    • Phase 2.3 includes 24-48 hour monitoring period
    • Legacy workflows remain with if: false conditions
    • If issues detected, remove if: false to re-enable
    • Minimum rollback: 30 seconds

Changelog

Added

  • New workflow: docs-validation.yml for PR-based documentation validation
  • New workflow: docs-maintenance.yml for scheduled and manual maintenance
  • Integration test plan (13 test scenarios documented)
  • Planning documents: PHASE_2_EXECUTION.md, PHASE_2_ISSUES.md
  • Deprecation markers in legacy workflow files

Changed

  • Mermaid validation logic moved to conditional job
  • README validation and audit logic consolidated
  • Auto-regen logic moved to conditional job with PR dry-run support
  • Manual update logic unified with configurable dispatch inputs
  • Scheduled audit incorporated as conditional job with input defaults

Removed

  • (Scheduled for Phase 2.3 after monitoring) Legacy workflows will be deleted

Checklist (Global DoD / PR)

  • All AC met and demonstrated
  • Tests added/updated (integration test scenarios documented)
  • Accessibility checklist completed (N/A - workflow automation)
  • Docs/readme/changelog updated (PHASE_2_EXECUTION.md, PHASE_2_ISSUES.md)
  • Security checklist completed (no secrets, permissions preserved)
  • Code/design reviews approved (Codex feedback addressed)
  • CI green; linked issues closed; release notes prepared

@coderabbitai

coderabbitaiBot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@ashleyshaw, you've reached your PR review limit, so we couldn't start this review.

Next review available in:33 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 54c905f1-e117-4316-9c16-68a40512f0a7

📥 Commits

Reviewing files that changed from the base of the PR and between c5f260c and 4852496.

📒 Files selected for processing (8)
  • .github/projects/active/workflows-consolidation-2026-q3/PHASE_2_EXECUTION.md
  • .github/projects/active/workflows-consolidation-2026-q3/PHASE_2_ISSUES.md
  • .github/workflows/docs-maintenance.yml
  • .github/workflows/docs-validation.yml
  • .github/workflows/readme-audit.yml
  • .github/workflows/readme-regen.yml
  • .github/workflows/readme-update.yml
  • .github/workflows/validate-mermaid-pr.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/docs-workflow-consolidation-phase-2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actionsBot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

✅ Template check passed after update. Thanks for fixing the PR description.

@github-actionsgithub-actionsBot added this to the v1.0 milestone Jul 24, 2026
ashleyshaw added a commit that referenced this pull request Jul 24, 2026
Consolidate documentation validation workflows into single workflow:
- Migrate validate-mermaid-pr.yml logic (mermaid validation job)
- Migrate readme-audit.yml logic (README structure validation job)
- Use conditional jobs based on file changes
- Both jobs run independently, post PR comments with results
- Covers syntax, accessibility, colour contrast for mermaid
- Covers frontmatter and structure for README
Jobs:
- validate-mermaid: Checks mermaid diagrams on PR/push
- validate-readme: Checks README structure on PR/dispatch
Benefits:
- Single validation workflow for documentation
- Unified error reporting to PRs
- Reduced noise in workflow runs
- Cleaner triggers and concurrency
Refs: Issue #1307, Epic #1227, PR #1306
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
ashleyshaw added a commit that referenced this pull request Jul 24, 2026
Consolidate documentation maintenance workflows into single workflow:
- Migrate readme-regen.yml logic (auto-regen job)
- Migrate readme-update.yml logic (manual update job)
- Migrate readme-audit.yml logic (scheduled audit job)
- Use conditional jobs based on event type and dispatch inputs
Jobs:
- auto-regen-readme: Triggers on push to develop, regenerates impacted READMEs
- manual-update: Triggered via dispatch, updates mermaid/staleness based on input
- audit-docs: Scheduled weekly (Mon 9 AM UTC) + manual dispatch, comprehensive audit
Supports:
- Push-triggered automatic README regeneration
- Manual dispatch for README/Mermaid updates with scope options
- Scheduled weekly documentation audit
- Manual audit trigger via dispatch
- Critical findings issue creation on scheduled failures
Benefits:
- All maintenance tasks in single workflow
- Scheduled audit prevents documentation drift
- Manual maintenance easily accessible
- Clear separation of concerns with conditional jobs
Refs: Issue #1308, Epic #1227, PR #1306
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:4648e2814d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +101 to +102
if: contains(github.event.pull_request.title, 'docs') ||
contains(github.event.pull_request.files.*.filename, '.md')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Derive changed files before gating validation

For PRs whose title does not contain docs, github.event.pull_request.files is not present in the pull-request webhook payload, so the Mermaid condition evaluates false and the README job always skips; both also skip under the promised manual-dispatch trigger because no pull_request object exists. The current .github/workflows/validate-mermaid-pr.yml:46-89 deliberately derives changed files with git diff; retain that approach or query the API rather than silently removing the blocking syntax, accessibility, and contrast checks.

AGENTS.md reference: AGENTS.md:L22-L22

Useful? React with 👍 / 👎.

Comment on lines +125 to +127
- Copy all steps from `readme-audit.yml`
- Add condition: `github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.action == 'audit')`
- Configure schedule: Weekly (e.g., Monday 9 AM UTC)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Supply defaults for scheduled audits

When the weekly schedule event fires, it supplies neither inputs.scope nor inputs.output_format. The steps being copied from .github/workflows/readme-audit.yml:51-54 pass both values directly as required CLI arguments, so the scheduled audit will receive empty values instead of a valid scope and format. Define schedule-safe defaults such as all and markdown before adding this trigger.

Useful? React with 👍 / 👎.

Comment on lines +119 to +122
- Copy all steps from `readme-update.yml`
- Add condition: `github.event_name == 'workflow_dispatch' && github.event.inputs.action == 'update'`
- Add input parameter for update scope (readme, mermaid, both)
- Execute selected update logic

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the existing update-scope values

If the manual-update steps are copied as instructed, the new readme and both values are incompatible with .github/workflows/readme-update.yml:65-77, whose conditions recognise only all, mermaid, and staleness. Selecting both or readme would therefore skip both update operations while the workflow could still complete successfully; retain the existing values or explicitly map the new choices to the copied conditions.

Useful? React with 👍 / 👎.

Comment on lines +145 to +146
regen-readme:
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve pull-request README regeneration

Restricting regen-readme to pushes drops the existing pull-request path in .github/workflows/readme-regen.yml:4-13, including the dry-run execution at lines 95-96. Once the legacy workflow is deleted, generator failures in documentation PRs will not be exercised until after merge when the develop push runs; include pull_request and preserve the dry-run branch rather than testing only the push path.

Useful? React with 👍 / 👎.

Comment on lines +255 to +256
1. **Disable Old Workflows** (in this order)
- Add `if: false` to top-level condition in:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Disable legacy jobs at a supported level

GitHub Actions does not support a workflow-level if; conditions are valid only on jobs and steps. Following this instruction makes all four legacy files invalid workflows rather than valid but inactive workflows, undermining the proposed 24–48-hour monitoring stage. Put if: false on every job or temporarily restrict each workflow's on triggers instead.

Useful? React with 👍 / 👎.

@ashleyshaw
ashleyshaw enabled auto-merge (squash) July 24, 2026 13:11
@github-actions

github-actionsBot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

⏱️ Aging and SLA annotation

  • Age: 0 day(s)
  • SLA state: Within SLA
  • Thresholds: warn at 7 days, breach at 14 days
  • Last updated: 2026-07-24T13:30:12.360Z

Maintained by project-meta-sync workflow.

@ashleyshaw

Copy link
Copy Markdown
MemberAuthor

PHASE_2_EXECUTION.md line 102: Updated job condition to use git diff approach to derive changed files instead of relying on pull_request.files which is not available when PR title does not contain "docs". Preserves existing robustness from validate-mermaid-pr.yml.

🤖 Addressed by Claude Code

@github-actionsgithub-actionsBot added status:needs-review Awaiting code review type:refactor Refactor or internal change area:ci Build and CI pipelines labels Jul 24, 2026
@ashleyshaw

Copy link
Copy Markdown
MemberAuthor

PHASE_2_ISSUES.md line 127: Updated "Scheduled Audit Job" to explicitly define default values for inputs.scope and inputs.output_format when schedule event fires (which does not provide inputs). Pattern: ${{ inputs.scope || \"all\" }} and ${{ inputs.output_format || \"markdown\" }} in workflow steps.

🤖 Addressed by Claude Code

@github-actionsgithub-actionsBot added priority:normal Default priority type:chore Chore / small hygiene change type:documentation Documentation meta:needs-changelog Requires a changelog entry before merge labels Jul 24, 2026
@ashleyshaw

Copy link
Copy Markdown
MemberAuthor

PHASE_2_ISSUES.md line 121: Updated "Manual Update Job" to preserve existing update-scope values all, mermaid, staleness (removed the proposed readme and both options). These values map directly to conditions in readme-update.yml and are compatible with existing update operations.

🤖 Addressed by Claude Code

@ashleyshaw

Copy link
Copy Markdown
MemberAuthor

PHASE_2_EXECUTION.md line 146: Updated "regen-readme" job condition to preserve both pull_request (with dry-run) and push (with commit) triggers. The original readme-regen.yml executes in PR context for validation and on push for actual updates. Condition now: (github.event_name == \"pull_request\" && github.base_ref == \"develop\") || (github.event_name == \"push\" && github.ref == \"refs/heads/develop\")

🤖 Addressed by Claude Code

@ashleyshaw

Copy link
Copy Markdown
MemberAuthor

PHASE_2_EXECUTION.md line 256: Updated deprecation approach — GitHub Actions does not support workflow-level if conditions. Instructions now specify adding if: false to every job individually in each legacy workflow file. This creates valid but inactive workflows during the 24-48 hour monitoring phase before deletion.

🤖 Addressed by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

📄 README Validation

❌ One or more README checks failed.

CheckResult
❌ FrontmatterFailed
✅ StructurePassed

@github-actionsgithub-actionsBot removed the type:refactor Refactor or internal change label Jul 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎨 Mermaid Diagram Validation

❌ One or more Mermaid diagram checks failed.

CheckResult
✅ SyntaxPassed
❌ AccessibilityFailed
✅ Colour ContrastPassed

@github-actionsgithub-actionsBot removed the type:chore Chore / small hygiene change label Jul 24, 2026
@github-actions

github-actionsBot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #1306

CI Status:success
Files changed: 8
Risk Distribution: 6 critical, 2 high, 0 medium, 0 low

Recommendations

  • ⚠️ 6 critical-risk file(s) modified (workflows, secrets)
  • ⚠️ Security-sensitive files modified (review carefully)

@github-actionsgithub-actionsBot added type:refactor Refactor or internal change and removed type:refactor Refactor or internal change labels Jul 24, 2026
ashleyshawand others added 5 commits July 24, 2026 15:55
- Create detailed Phase 2 execution plan (12-16 hours)
- Document 4 workflows to consolidate into 2 new workflows
- Design docs-validation.yml (mermaid + readme validation)
- Design docs-maintenance.yml (auto-regen + audit + manual update)
- Provide integration testing checklist
- Define rollback and success criteria
- Create GitHub issue templates for Phase 2 work items
- Timeline: weeks 5-8
- Expected savings: ~40 GHA minutes/week
Phase 2 consolidates:
- validate-mermaid-pr.yml
- readme-regen.yml
- readme-update.yml
- readme-audit.yml
Into:
- docs-validation.yml (PR validation)
- docs-maintenance.yml (maintenance + audit)
Refs: Epic #1227
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Consolidate documentation validation workflows into single workflow:
- Migrate validate-mermaid-pr.yml logic (mermaid validation job)
- Migrate readme-audit.yml logic (README structure validation job)
- Use conditional jobs based on file changes
- Both jobs run independently, post PR comments with results
- Covers syntax, accessibility, colour contrast for mermaid
- Covers frontmatter and structure for README
Jobs:
- validate-mermaid: Checks mermaid diagrams on PR/push
- validate-readme: Checks README structure on PR/dispatch
Benefits:
- Single validation workflow for documentation
- Unified error reporting to PRs
- Reduced noise in workflow runs
- Cleaner triggers and concurrency
Refs: Issue #1307, Epic #1227, PR #1306
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Consolidate documentation maintenance workflows into single workflow:
- Migrate readme-regen.yml logic (auto-regen job)
- Migrate readme-update.yml logic (manual update job)
- Migrate readme-audit.yml logic (scheduled audit job)
- Use conditional jobs based on event type and dispatch inputs
Jobs:
- auto-regen-readme: Triggers on push to develop, regenerates impacted READMEs
- manual-update: Triggered via dispatch, updates mermaid/staleness based on input
- audit-docs: Scheduled weekly (Mon 9 AM UTC) + manual dispatch, comprehensive audit
Supports:
- Push-triggered automatic README regeneration
- Manual dispatch for README/Mermaid updates with scope options
- Scheduled weekly documentation audit
- Manual audit trigger via dispatch
- Critical findings issue creation on scheduled failures
Benefits:
- All maintenance tasks in single workflow
- Scheduled audit prevents documentation drift
- Manual maintenance easily accessible
- Clear separation of concerns with conditional jobs
Refs: Issue #1308, Epic #1227, PR #1306
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Disable 4 legacy workflows consolidated into docs-validation.yml and docs-maintenance.yml:
- validate-mermaid-pr.yml → docs-validation.yml (validate-mermaid job)
- readme-regen.yml → docs-maintenance.yml (auto-regen-readme job)
- readme-update.yml → docs-maintenance.yml (manual-update job)
- readme-audit.yml → docs-validation.yml + docs-maintenance.yml (jobs split)
Disable strategy:
- Change trigger to empty workflow_run (no triggers)
- Add [DEPRECATED] to workflow name
- Add comment explaining consolidation
- Workflows remain in git history for rollback if needed
Monitoring period: 24-48 hours
Will delete after no issues reported
Refs: Issue #1309 (Testing), Issue #1310 (Cleanup), Epic #1227
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- PHASE_2_EXECUTION.md line 102: Preserve git diff approach for changed file detection (P1)
- PHASE_2_EXECUTION.md line 146: Preserve pull_request trigger for README regeneration
- PHASE_2_EXECUTION.md line 256: Use job-level `if: false` instead of workflow-level
- PHASE_2_ISSUES.md line 121: Preserve existing update-scope values (all, mermaid, staleness)
- PHASE_2_ISSUES.md line 127: Supply defaults for scheduled audit inputs
Addresses all 5 Codex inline review comments with implementation details.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@ashleyshaw
ashleyshawforce-pushed the refactor/docs-workflow-consolidation-phase-2 branch from 5f7b2b4 to 4852496CompareJuly 24, 2026 13:56
@github-actionsgithub-actionsBot added the type:refactor Refactor or internal change label Jul 24, 2026
@ashleyshawashleyshaw added the meta:no-changelog No changelog needed label Jul 24, 2026
@ashleyshaw
ashleyshaw merged commit ca86ad6 into developJul 24, 2026
21 of 27 checks passed
@ashleyshaw
ashleyshaw deleted the refactor/docs-workflow-consolidation-phase-2 branch July 24, 2026 13:57
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ciBuild and CI pipelinesmeta:needs-changelogRequires a changelog entry before mergemeta:no-changelogNo changelog neededpriority:normalDefault prioritystatus:needs-reviewAwaiting code reviewtype:documentationDocumentationtype:refactorRefactor or internal change

Projects

None yet

1 participant

@ashleyshaw