Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-pr-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
script: |
const fs = require('fs');
const config = JSON.parse(fs.readFileSync('repos-config.json', 'utf8'));
const ALLOWED_REFS = new Set(['main', 'docs-ng']);
const ALLOWED_REFS = new Set(['main']);

const errors = [];
for (const repo of config.repos) {
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docs-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: gardenlinux/docs-ng
repository: gardenlinux/docs

- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # pin@v6.2.0
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: gardenlinux/docs-ng
repository: gardenlinux/docs

- name: Download aggregated docs
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: gardenlinux/docs-ng
repository: gardenlinux/docs

- name: Download aggregated docs
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: gardenlinux/docs-ng
repository: gardenlinux/docs

- name: Download aggregated docs
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
with:
client-id: ${{ secrets.DOCS_BOT_APP_ID }}
private-key: ${{ secrets.DOCS_BOT_PRIVATE_KEY }}
repositories: docs-ng,${{ github.event.client_payload.repo || inputs.repo }}
repositories: docs,${{ github.event.client_payload.repo || inputs.repo }}

- name: Checkout docs-ng
- name: Checkout docs
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
token: ${{ steps.app-token.outputs.token }}
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Garden Linux Documentation Framework

`docs-ng` is the primary documentation aggregation framework and hosting hub.
`docs` is the primary documentation aggregation framework and hosting hub.

The documentation is hosted at https://gardenlinux-docs.netlify.app
The documentation is hosted at https://docs.gardenlinux.org

This repository contains all source code of our custom aggregation system, as
well as any relevant documentation related to the topic of documenting.

## Documentation

To learn everything related to our approach of documenting, check the
[Documentation](https://gardenlinux-docs.netlify.app/contributing/documentation/)
[Documentation](https://docs.gardenlinux.org/contributing/documentation/)
subsection of our contributing page.

You can also jump directly into topics like
[how to work with the documentation system locally](https://gardenlinux-docs.netlify.app/contributing/documentation/working-locally.html),
[our documentation workflow & review process](https://gardenlinux-docs.netlify.app/contributing/documentation/documentation_workflow.html)
[how to work with the documentation system locally](https://docs.gardenlinux.org/contributing/documentation/working-locally.html),
[our documentation workflow & review process](https://docs.gardenlinux.org/contributing/documentation/documentation_workflow.html)
and the
[quality markers](https://gardenlinux-docs.netlify.app/contributing/documentation/writing_good_docs.html)
[quality markers](https://docs.gardenlinux.org/contributing/documentation/writing_good_docs.html)
we use to verify the quality of contributed documentation.

While browsing our docs, if you find something that you would like to correct or
Expand Down Expand Up @@ -46,7 +46,7 @@ https://lists.neonephos.org/g/gardenlinux-security-embargo
We welcome your contributions to Gardenlinux or any supporting projects.

To find out more, visit our
[Contributor Documentation](https://gardenlinux-docs.netlify.app/contributing).
[Contributor Documentation](https://docs.gardenlinux.org/contributing).

## Licensing

Expand Down
3 changes: 1 addition & 2 deletions docs/contributing/documentation/adding-repos.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Here's a complete configuration:
"name": "example-tool",
"url": "https://github.com/gardenlinux/example-tool",
"docs_path": "documentation",
"ref": "docs-ng",
"ref": "main",
"commit": "1234567890abcdef",
"root_files": ["README.md"],
"structure": "flat",
Expand All @@ -204,7 +204,6 @@ The `docs_path` field defaults to `"docs"` and may be omitted when the documenta
### Files Not Appearing

- Verify `docs_path` points to the correct directory
- Check that the repository has a `docs-ng` branch or adjust `ref`
- Ensure `github_target_path` front-matter is correct

### Media Not Copied
Expand Down
82 changes: 41 additions & 41 deletions docs/contributing/documentation/ci-architecture.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Documentation CI Architecture"
description: "How the GitHub Actions workflows across docs-ng and aggregated repositories work together to validate, preview, and publish documentation"
description: "How the GitHub Actions workflows across docs and aggregated repositories work together to validate, preview, and publish documentation"
order: 6
related_topics:
- /contributing/documentation/documentation_workflow.md
Expand All @@ -26,7 +26,7 @@ The documentation CI pipeline serves three guarantees:
it can influence the published site.
2. **Preview**: contributors and reviewers can inspect exactly how a pull
request's documentation changes will look on the live site, via a Netlify
deploy preview attached to an automated draft PR in `docs-ng`.
deploy preview attached to an automated draft PR in `docs`.
3. **Always latest docs**: once a PR of an aggregated repository (source PR) is merged, the `repos-config.json`
commit lock for that repository is automatically updated so the published
site reflects the latest content without any manual intervention.
Expand All @@ -37,33 +37,33 @@ for the per-workflow details.

## Actors and Repositories

### [`gardenlinux/docs-ng`](https://github.com/gardenlinux/docs-ng)
### [`gardenlinux/docs`](https://github.com/gardenlinux/docs)

The central aggregation hub. It hosts:

- The reusable quality-checks workflow ([`docs-checks.yml`](https://github.com/gardenlinux/docs-ng/blob/main/.github/workflows/docs-checks.yml)), which can be
- The reusable quality-checks workflow ([`docs-checks.yml`](https://github.com/gardenlinux/docs/blob/main/.github/workflows/docs-checks.yml)), which can be
called from any aggregated repo.
- The automated PR workflow ([`docs-pr.yml`](https://github.com/gardenlinux/docs-ng/blob/main/.github/workflows/docs-pr.yml)), which creates and maintains draft
PRs in `docs-ng` when aggregated repos signal a documentation change.
- The config validator workflow ([`check-pr-main.yml`](https://github.com/gardenlinux/docs-ng/blob/main/.github/workflows/check-pr-main.yml)), which guards `main`
against non-production refs in [`repos-config.json`](https://github.com/gardenlinux/docs-ng/blob/main/repos-config.json).
- The [`repos-config.json`](https://github.com/gardenlinux/docs-ng/blob/main/repos-config.json) file that records which repo and which exact commit
- The automated PR workflow ([`docs-pr.yml`](https://github.com/gardenlinux/docs/blob/main/.github/workflows/docs-pr.yml)), which creates and maintains draft
PRs in `docs` when aggregated repos signal a documentation change.
- The config validator workflow ([`check-pr-main.yml`](https://github.com/gardenlinux/docs/blob/main/.github/workflows/check-pr-main.yml)), which guards `main`
against non-production refs in [`repos-config.json`](https://github.com/gardenlinux/docs/blob/main/repos-config.json).
- The [`repos-config.json`](https://github.com/gardenlinux/docs/blob/main/repos-config.json) file that records which repo and which exact commit
is currently published.

### Aggregated repositories

Each repository listed in `repos-config.json` contains `docs-check.yml` workflow that:

- reacts to pull request and push events on documentation-relevant paths,
- calls the reusable `docs-checks.yml` from `docs-ng`, passing the PR's
- calls the reusable `docs-checks.yml` from `docs`, passing the PR's
branch and commit as override inputs, and
- on success (or on merge), dispatches a `repository_dispatch` event to
`docs-ng` to trigger the automated PR workflow.
`docs` to trigger the automated PR workflow.

### `gardenlinux-docs-bot` GitHub App

A GitHub App with write access to both `docs-ng` and the aggregated repositories.
It's responsible for generating short-lived tokens that allow cross-repository API calls without using a personal access token, opening and updating draft PRs in `docs-ng` and posting comments back to the PRs in the aggregated repo which include links to the Netlify preview.
A GitHub App with write access to both `docs` and the aggregated repositories.
It's responsible for generating short-lived tokens that allow cross-repository API calls without using a personal access token, opening and updating draft PRs in `docs` and posting comments back to the PRs in the aggregated repo which include links to the Netlify preview.

Required secrets (configured in each aggregated repository):

Expand All @@ -74,39 +74,39 @@ Required secrets (configured in each aggregated repository):

### Netlify

`docs-ng` has a [Netlify](https://www.netlify.com/) integration that automatically creates a deploy preview
`docs` has a [Netlify](https://www.netlify.com/) integration that automatically creates a deploy preview
for every open PR. The `docs-pr.yml` workflow posts the preview URL as a
comment on the originating aggregated repo PR so reviewers do not have to navigate
to `docs-ng` manually.
to `docs` manually.

## Build Flow

The diagram below shows the path from a documentation change in an aggregated
repository through to a merged commit lock update in `docs-ng`.
repository through to a merged commit lock update in `docs`.

```mermaid
flowchart TD
A[Developer opens / updates PR\nin aggregated repo] --> B

subgraph source["Aggregated Repo (e.g. gardenlinux)"]
B["docs-check.yml\ntriggered by PR event\non docs/** paths"]
B --> C["calls reusable workflow\ndocs-checks.yml @ docs-ng\nwith override-repo, override-ref,\noverride-commit"]
B --> C["calls reusable workflow\ndocs-checks.yml @ docs\nwith override-repo, override-ref,\noverride-commit"]
end

subgraph docsng["gardenlinux/docs-ng"]
subgraph docsng["gardenlinux/docs"]
C --> D["docs-checks.yml\nJob: aggregate\n(runs aggregate.py with overrides)"]
D --> E["Job: linkcheck\n(lychee)"]
D --> F["Job: spelling\n(codespell via make spelling)"]
D --> G["Job: woke\n(inclusive language)"]
end

E & F & G -->|all pass| H["notify-docs-ng job\nin aggregated repo"]
E & F & G -->|all pass| H["notify-docs job\nin aggregated repo"]
H -->|repository_dispatch\nevent: docs-pr| I

subgraph docsng2["gardenlinux/docs-ng"]
subgraph docsng2["gardenlinux/docs"]
I["docs-pr.yml\ncreates or updates branch\nauto/<repo>/<pr-number>"]
I --> J["Updates repos-config.json\ncommit lock"]
J --> K["git push -f\nOpens / updates draft PR\nin docs-ng"]
J --> K["git push -f\nOpens / updates draft PR\nin docs"]
K --> L["Posts preview comment\non source repo PR"]
K --> M["check-pr-main.yml\nvalidates repos-config.json\nref must be main or semver"]
K --> N["Netlify deploy preview\nbuilt from draft PR branch"]
Expand All @@ -117,8 +117,8 @@ flowchart TD

O --> P{Source PR merged?}
P -->|yes| Q["docs-check.yml\nclosed+merged event\nskips quality checks\ndispatches event=merged"]
Q --> R["docs-pr.yml\nupdates lock to merge commit\nsets ref to base branch\nun-drafts PR in docs-ng"]
R --> S[Maintainer merges\ndocs-ng PR]
Q --> R["docs-pr.yml\nupdates lock to merge commit\nsets ref to base branch\nun-drafts PR in docs"]
R --> S[Maintainer merges\ndocs PR]
S --> T[Published site updated]

P -->|no, more commits| A
Expand All @@ -144,7 +144,7 @@ sequenceDiagram
autonumber
actor Dev as Developer
participant SrcRepo as Aggregated Repo<br/>(e.g. gardenlinux)
participant DocsNG as gardenlinux/docs-ng
participant DocsNG as gardenlinux/docs
participant Bot as gardenlinux-docs-bot
participant Netlify

Expand All @@ -156,14 +156,14 @@ sequenceDiagram
DocsNG->>DocsNG: spelling job (codespell)
DocsNG->>DocsNG: woke job (inclusive language)
DocsNG-->>SrcRepo: all checks pass ✓
SrcRepo->>SrcRepo: notify-docs-ng job runs
SrcRepo->>Bot: create GitHub App token<br/>(repos: docs-ng, aggregated repo)
SrcRepo->>SrcRepo: notify-docs job runs
SrcRepo->>Bot: create GitHub App token<br/>(repos: docs, aggregated repo)
SrcRepo->>DocsNG: repository_dispatch<br/>event_type: docs-pr<br/>payload: {repo, pr_number, commit_sha, ref, event: pr_success}
DocsNG->>DocsNG: docs-pr.yml triggered
DocsNG->>DocsNG: create/update branch<br/>auto/<repo>/<pr_number>
DocsNG->>DocsNG: update repos-config.json<br/>commit lock → override-commit
DocsNG->>DocsNG: git push -f to branch
DocsNG->>DocsNG: open/update draft PR in docs-ng<br/>(status: Draft)
DocsNG->>DocsNG: open/update draft PR in docs<br/>(status: Draft)
DocsNG->>DocsNG: check-pr-main.yml validates<br/>repos-config.json refs
Netlify->>Netlify: build deploy preview<br/>from draft PR branch
Bot->>SrcRepo: post/update comment on source PR<br/>📚 Preview PR link<br/>😎 Netlify deploy preview URL
Expand All @@ -174,19 +174,19 @@ sequenceDiagram

When the source PR is merged, `docs-check.yml` fires again with
`action: closed` and `merged: true`. The quality checks are skipped; only the
notification job runs to promote the draft docs-ng PR to ready-for-review.
notification job runs to promote the draft docs PR to ready-for-review.

```mermaid
sequenceDiagram
autonumber
actor Maint as Maintainer
participant SrcRepo as Aggregated Repo
participant DocsNG as gardenlinux/docs-ng
participant DocsNG as gardenlinux/docs
participant Bot as gardenlinux-docs-bot

Maint->>SrcRepo: merge PR into main
SrcRepo->>SrcRepo: docs-check.yml triggered<br/>(PR closed + merged = true)<br/>docs-checks job SKIPPED
SrcRepo->>SrcRepo: notify-docs-ng job runs<br/>(always, merged condition)
SrcRepo->>SrcRepo: notify-docs job runs<br/>(always, merged condition)
SrcRepo->>Bot: create GitHub App token
SrcRepo->>DocsNG: repository_dispatch<br/>event_type: docs-pr<br/>payload: {repo, pr_number,<br/>commit_sha: merge_commit_sha,<br/>ref: base_branch,<br/>event: merged}
DocsNG->>DocsNG: docs-pr.yml triggered
Expand All @@ -195,7 +195,7 @@ sequenceDiagram
DocsNG->>DocsNG: git push -f to branch
DocsNG->>DocsNG: update existing PR:<br/>draft: false (ready for review)<br/>status: "Ready for review"
Bot->>SrcRepo: update comment on source PR<br/>with current status
Maint->>DocsNG: review and merge docs-ng PR
Maint->>DocsNG: review and merge docs PR
DocsNG->>DocsNG: published site updated<br/>(next aggregation run picks up new lock)
```

Expand All @@ -207,9 +207,9 @@ be visible.
### Quality checks fail in the aggregated repo

If any of the `linkcheck`, `spelling`, or `woke` jobs in `docs-checks.yml`
fail, the `notify-docs-ng` job in `docs-check.yml` does **not** run (the
fail, the `notify-docs` job in `docs-check.yml` does **not** run (the
`needs: [docs-checks]` condition `result == 'success'` is not met). No
dispatch event is sent to `docs-ng`, and no draft PR is created or updated.
dispatch event is sent to `docs`, and no draft PR is created or updated.

The failure is visible as a failed status check directly on the aggregated repo PR.

Expand All @@ -223,19 +223,19 @@ If the `docs-pr.yml` workflow fails (e.g., because the GitHub App token cannot
be obtained, or because the `repos-config.json` entry for the aggregated repo does
not exist), no draft PR is opened and no comment is posted.

Check the `docs-pr.yml` run in the **Actions** tab of `docs-ng` for the error.
Check the `docs-pr.yml` run in the **Actions** tab of `docs` for the error.

### `check-pr-main.yml` blocks the docs-ng PR
### `check-pr-main.yml` blocks the docs PR

If the docs-ng draft PR's `repos-config.json` still contains a non-`main`,
If the docs draft PR's `repos-config.json` still contains a non-`main`,
non-semver `ref` when someone tries to merge it to `main`, `check-pr-main.yml`
will fail and prevent the merge. This happens if the source PR was never
merged (the draft PR still points at a feature branch ref).

The fix is to either wait for the source PR to be merged (which will update the
ref to `main`) or to close the draft PR if the source PR was abandoned.

<!-- TODO(screenshot): docs-ng PR with check-pr-main.yml failing due to non-main ref -->
<!-- TODO(screenshot): docs PR with check-pr-main.yml failing due to non-main ref -->
![non-main ref check failed](../assets/check-pr-main-fail.png)

### Netlify preview not available
Expand All @@ -257,10 +257,10 @@ details.
|---------|--------------|
| aggregatated-repo (source) PR missing docs status check | **Actions** tab of the aggregated repo → `Documentation Quality Check` run |
| Quality check job details (which lint rule failed) | Expand the failing job step in the aggregated repo Actions run |
| No comment on source PR with preview link | **Actions** tab of `docs-ng` → `Create/Update Docs PR` run; check the `Comment on source PR` step |
| Draft PR in `docs-ng` not created | **Actions** tab of `docs-ng` → `Create/Update Docs PR` run; check `Create or update branch` and `Create or update PR` steps |
| `repos-config.json` ref validation fails | **Checks** tab on the draft PR in `docs-ng` → `Validate repos-config.json` run |
| Netlify preview not building | Netlify dashboard → deploy log for the docs-ng PR branch |
| No comment on source PR with preview link | **Actions** tab of `docs` → `Create/Update Docs PR` run; check the `Comment on source PR` step |
| Draft PR in `docs` not created | **Actions** tab of `docs` → `Create/Update Docs PR` run; check `Create or update branch` and `Create or update PR` steps |
| `repos-config.json` ref validation fails | **Checks** tab on the draft PR in `docs` → `Validate repos-config.json` run |
| Netlify preview not building | Netlify dashboard → deploy log for the docs PR branch |
| Bot cannot authenticate | Verify `DOCS_BOT_APP_ID` and `DOCS_BOT_PRIVATE_KEY` secrets are set in the aggregated repository's settings |

## Related Topics
Expand Down
Loading
Loading