Skip to content

Sync SDK and example READMEs to their dev.dotcms.com documentation pages #38024

Description

@jdcmsd

Description

Twelve dev.dotcms.com documentation pages (the SDK libraries, the MCP server, and the Next.js, Angular and Astro examples) show READMEs from this repo. Today the devsite fetches each README from GitHub every time the page loads (GITHUB_DOCS_MAP in the devsite). As a result:

  • the page text isn't stored in dotCMS, so site search and indexing can't find it;
  • the stored page bodies are placeholder text;
  • each page depends on GitHub being reachable when it loads.

This adds a GitHub Actions workflow to core. When a merge to main changes a markdown file, the workflow updates each mapped page whose text differs. It fires the authoring server's Push Publish workflow action with disabledWYSIWYG, which saves, publishes and pushes the page to production, then confirms the push succeeded. The file remains the single source of truth, and the text becomes part of dotCMS.

Which pages are synced is set in dotCMS, not in the workflow. DotcmsDocumentation has a new indexed text field, readmeSource. Any page whose readmeSource holds a https://github.com/dotCMS/core/blob/main/<path>.md URL is synced from that file. Adding or removing a page is a field edit in dotCMS and needs no core PR. URLs pointing anywhere else (other repos, npm) are ignored by this workflow, which leaves room for other sources later.

Acceptance Criteria

  • A merge to main that changes any markdown file triggers a sync of every page whose readmeSource points into this repo. Changed pages are published on the authoring server and pushed to production, left unlocked, with markdown formatting kept (disabledWYSIWYG). The run confirms each push succeeded.
  • Pages whose content already matches are skipped without a write.
  • Adding or clearing a page's readmeSource in dotCMS adds it to or removes it from the sync, with no workflow change.
  • A manual run is available, as a dry run by default, with the differences shown in the run summary.
  • A failed run (including a rejected token, no mapped pages found, or a push that doesn't succeed) sends a Slack DM to a fixed list of people, without affecting existing dotBot notifications.
  • The 12 current pages have readmeSource set and are seeded with their cleaned READMEs, published and pushed to production. This was done ahead of merge.

Priority

Medium

Additional Context

  • Uses the existing AUTODOC_DOTCMS_BASE_URL variable and the AUTODOC_DOTCMS_API_TOKEN_PUBLISH secret, which belongs to the CI Autodoc Publish User.
    • That user exists only on the authoring server.
    • Its Dev Publish role has View, Edit and Publish on the site and on the Documentation content type, permission to use the Push Publish action, and permission to push to prod.
    • The draft-only CI Autodoc user remains for autodoc, whose new docs need human review.
  • readmeSource must stay System Indexed. The workflow finds its pages with a single search on that field. If indexing is turned off, saved pages drop out of the index and the run fails with "no mapped pages found". The fix is to re-enable indexing and reindex the content type.
  • Out of scope:
    • the PHP SDK pages, which live in the private dotcms-php-sdk repo
    • the .NET example page
    • removing the synced entries from the devsite's GITHUB_DOCS_MAP, which is a follow-up

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions