Skip to content

Commit 39288a4

Browse files
authored
Switch all documentation syncing from release tags to main branch (#130)
1 parent 46bfe9b commit 39288a4

File tree

12 files changed

+129
-198
lines changed

12 files changed

+129
-198
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ docs/architecture/architecture.mdx
1111

1212
# Component documentation (from all component repos in component-configs.js)
1313
docs/architecture/Components/
14+
docs/architecture/latest-release.md
1415

1516
# Community content (from llm-d/llm-d main repo)
1617
docs/community/contribute.md

README.md

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ This repository contains two types of documentation:
1313
1. **Local Documentation** - Written directly in this repository (blog posts, landing pages, etc.)
1414
2. **Remote Synced Content** - Automatically synced from other llm-d repositories during build
1515

16-
Most technical documentation is automatically synced from source repositories to ensure accuracy and consistency:
17-
- **Architecture docs** (`/docs/architecture/`) - Synced from component repositories
16+
Most technical documentation is automatically synced from the `main` branch of source repositories to ensure accuracy and consistency:
17+
- **Architecture docs** (`/docs/architecture/`) - Synced from llm-d/llm-d repository
1818
- **User guides** (`/docs/guide/`) - Synced from the main llm-d repository
19-
- **Component docs** (`/docs/architecture/Components/`) - Auto-generated from individual component repos
19+
- **Component docs** (`/docs/architecture/Components/`) - Synced from individual component repos
2020
- **Community docs** (`/docs/community/`) - Synced from the main repository
21+
- **Latest Release page** (`/docs/architecture/latest-release.md`) - Generated from `components-data.yaml`
2122

2223
Files with remote content show a "Content Source" banner at the bottom with links to edit the original source.
2324

@@ -28,9 +29,10 @@ Files with remote content show a "Content Source" banner at the bottom with link
2829
The remote content system automatically downloads and syncs content from GitHub repositories during the build process:
2930

3031
1. **Static Configuration** - `remote-content/remote-sources/components-data.yaml` contains:
31-
- Release version information (which tag to sync from)
32-
- List of all components with their descriptions and versions
32+
- Release version information (displayed on the Latest Release page)
33+
- List of all components with their descriptions and version tags
3334
- Repository locations and metadata
35+
- **Note:** All content syncs from `main` branch; version tags are only used for display on the Latest Release page
3436

3537
2. **Content Sources** - Individual files in `remote-content/remote-sources/` define:
3638
- Which repositories to sync from
@@ -93,40 +95,46 @@ git push # Triggers automatic deployment
9395
```
9496

9597
**What gets updated:**
96-
- Release version, date, and URLs shown on the Components page
97-
- Component descriptions and version tags
98-
- **Components** sync from their individual release tags
99-
- **Guides** sync from the llm-d/llm-d release tag
100-
- **Architecture docs** sync from the llm-d/llm-d release tag
101-
- **Community docs** always sync from `main` branch (latest)
98+
- Release version, date, and URLs shown on the **Latest Release** page
99+
- Component descriptions and version tags displayed in the component table
100+
- **Note:** All documentation content (architecture, guides, components, community) syncs from the `main` branch
101+
- The version tags in YAML are only used to render the Latest Release page showing what versions are in the release
102102

103-
### Understanding Versioned vs. Always-Current Content
103+
### Content Syncing Strategy
104104

105-
The remote content system supports two sync strategies:
105+
**All documentation syncs from the `main` branch** of source repositories. This ensures documentation always reflects the latest development state.
106106

107-
**Versioned Content** (syncs from release tags):
108-
- **Guides** (`docs/guide/`) - Uses `RELEASE_INFO.version` from `components-data.yaml`
109-
- **Architecture** (`docs/architecture/`) - Uses `RELEASE_INFO.version` from `components-data.yaml`
110-
- **Components** (`docs/architecture/Components/`) - Each component uses its own `version` field from `components-data.yaml`
111-
- **Infrastructure Providers** (`docs/guide/InfraProviders/`) - Uses `RELEASE_INFO.version` from `components-data.yaml`
112-
113-
These docs are pinned to specific release tags (e.g., `v0.3.1`) to ensure documentation matches the released code. When you update `release.version` in `components-data.yaml`, all versioned content automatically syncs from the new tag.
114-
115-
**Always-Current Content** (syncs from `main` branch):
107+
**Content synced from `main`:**
108+
- **Architecture** (`docs/architecture/architecture.mdx`) - Main llm-d README
109+
- **Component docs** (`docs/architecture/Components/*.md`) - Individual component READMEs
110+
- **Guides** (`docs/guide/`) - Installation and usage guides
116111
- **Community docs** (`docs/community/`) - Contributing guidelines, Code of Conduct, Security Policy, SIGs
117-
- These are configured via `COMMON_REPO_CONFIGS['llm-d-main'].branch = 'main'` in `component-configs.js`
112+
- **Infrastructure Providers** (`docs/guide/InfraProviders/`)
113+
- **Usage docs** (`docs/usage/`)
118114

119-
Community documentation stays current with the latest policies and processes, independent of releases. The `branch` field in `COMMON_REPO_CONFIGS` controls this behavior.
115+
**Generated from YAML (not synced):**
116+
- **Latest Release page** (`docs/architecture/latest-release.md`) - Generated from `components-data.yaml`
117+
- Shows release version, date, and link to GitHub release
118+
- Displays component version table with links to specific release tags
119+
- This is the only place version tags from YAML are used
120120

121121
**How it works:**
122-
- `generateRepoUrls()` in `component-configs.js` prefers `version` over `branch` when both exist
123-
- Versioned content sources call `findRepoConfig('llm-d')` and use `RELEASE_INFO.version`
124-
- Community sources call `findRepoConfig('llm-d')` and use `repoConfig.branch` (which is `'main'`)
125-
- This separation lets you cut releases without worrying about stale community policies
122+
- `generateRepoUrls()` in `component-configs.js` always returns `main` as the branch for content syncing
123+
- Version tags in `components-data.yaml` are used by `components-generator.js` to render the Latest Release page
124+
- The `sync-release.mjs` script updates YAML with release metadata from GitHub, but this doesn't affect which branch content syncs from
126125

127126
### Testing content from a feature branch
128127

129-
To preview remote docs from a work-in-progress branch (for example `liu-cong-debug`), temporarily set `release.version` in `remote-content/remote-sources/components-data.yaml` to that branch name. Run `npm start` or `npm run build` to pull the branch content into the site. When testing is done, change `release.version` back to the released tag so production remains on the official docs.
128+
Since all content syncs from `main`, to test content from a different branch you need to temporarily modify the `generateRepoUrls()` function in `remote-content/remote-sources/component-configs.js`:
129+
130+
```javascript
131+
// Change this line temporarily:
132+
const ref = 'main';
133+
// To your feature branch:
134+
const ref = 'your-feature-branch';
135+
```
136+
137+
Run `npm start` or `npm run build` to pull the branch content. **Remember to change it back to `'main'` before committing.**
130138

131139
### Supporting remote guides from nested directories
132140

@@ -158,13 +166,13 @@ components:
158166
# ... existing components
159167
- name: llm-d-your-component
160168
org: llm-d
161-
branch: main
169+
sidebarLabel: Your Component # Display name in sidebar
162170
description: Description of your component
163-
category: Core Infrastructure
164171
sidebarPosition: 8
172+
version: v1.0.0 # Version tag shown on Latest Release page
165173
```
166174
167-
The component will automatically appear under `/docs/architecture/Components/` on the next build.
175+
The component README will be synced from `main` branch and appear at `/docs/architecture/Components/your-component.md` on the next build. The version tag is only used for display on the Latest Release page.
168176

169177
### Adding New Content Sources
170178

docusaurus.config.js

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,14 @@ const config = {
1616
tagline: "Powered by Docusaurus",
1717
favicon: "img/llm-d-favicon.png",
1818

19-
// Set the production url of your site here
20-
//url: "https://kproche.github.io/",
21-
// url: "https://jessicachitas.github.io/",
2219
url: "https://llm-d.ai/",
23-
// Set the /<baseUrl>/ pathname under which your site is served
24-
// For GitHub pages deployment, it is often '/<projectName>/'
25-
//baseUrl: "/llm-d.github.io/",
2620
baseUrl: "/",
2721

2822
// GitHub pages deployment config.
2923
// If you aren't using GitHub pages, you don't need these.
3024

31-
//IF YOU ARE DEPLOYING PREVIEW PAGES via GITHUB PAGES FOR THE MAIN REPO
32-
// UNCOMMENT THE NEXT TWO LINES AND COMMENT OUT THE FORK SECTION BELOW
3325
organizationName: "llm-d", // Usually your GitHub org/user name.
34-
//projectName: "webdocs", // Usually your repo name.
3526

36-
//IF YOU ARE DEPLOYING PREVIEW PAGES VIA GITHUB PAGES FOR A BRANCH OF A FORK IN YOUR ACCOUNT
37-
//EDIT THESE LINES APPROPRIATELY
38-
//organizationName: "jessicachitas", // Usually your GitHub org/user name.
39-
//organizationName: "kproche", // Usually your GitHub org/user name.
4027
projectName: "llm-d.github.io", // Usually your repo name.
4128
deploymentBranch: "gh-pages",
4229

@@ -59,10 +46,6 @@ const config = {
5946
docs: {
6047
sidebarPath: "./sidebars.js",
6148
sidebarCollapsible: false,
62-
// Please change this to your repo.
63-
// Remove this to remove the "edit this page" links.
64-
// editUrl:
65-
// "https://github.com/llm-d/llm-d-website.github.io/tree/main/",
6649
},
6750
blog: {
6851
showReadingTime: true,
@@ -192,6 +175,10 @@ const config = {
192175
label: "Overview",
193176
to: "docs/architecture",
194177
},
178+
{
179+
label: "Latest Release",
180+
to: "docs/architecture/latest-release",
181+
},
195182
{
196183
label: "Inference Scheduler",
197184
to: "docs/architecture/Components/inference-scheduler",

remote-content/remote-content.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const remoteContentPlugins = [
4646

4747
// Architecture remote content sources (docs/architecture/)
4848
architectureMainSource,
49-
...componentSources, // Spread all dynamically generated component sources
49+
...componentSources, // Spread all dynamically generated component sources (includes Latest Release page)
5050

5151
// Guide remote content sources (docs/guide/)
5252
...guideSources, // Spread all dynamically generated guide sources
@@ -60,4 +60,4 @@ const remoteContentPlugins = [
6060
// Add more remote sources here in the appropriate section above
6161
];
6262

63-
export default remoteContentPlugins;
63+
export default remoteContentPlugins;

remote-content/remote-sources/architecture/architecture-main.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,22 @@
44
* Downloads the README.md file from the main llm-d repository
55
* and transforms it into docs/architecture/architecture.mdx
66
*
7-
* Syncs from the specific release version defined in components-data.yaml,
8-
* not from the main branch. This ensures documentation matches the released version.
7+
* Syncs from the main branch to always show the latest development content.
98
*/
109

1110
import { createContentWithSource } from '../utils.js';
12-
import { findRepoConfig, RELEASE_INFO } from '../component-configs.js';
11+
import { findRepoConfig, generateRepoUrls } from '../component-configs.js';
1312
import { getRepoTransform } from '../repo-transforms.js';
1413

1514
// Get repository configuration from centralized config
1615
const repoConfig = findRepoConfig('llm-d');
17-
const releaseVersion = RELEASE_INFO.version;
16+
const { repoUrl, sourceBaseUrl, ref } = generateRepoUrls(repoConfig);
1817

19-
// Build URLs using the release version instead of main branch
20-
const repoUrl = `https://github.com/${repoConfig.org}/${repoConfig.name}`;
21-
const sourceBaseUrl = `https://raw.githubusercontent.com/${repoConfig.org}/${repoConfig.name}/${releaseVersion}/`;
22-
23-
// Create a custom transform that uses the release version instead of 'main'
18+
// Create a content transform using main branch
2419
const transform = getRepoTransform(repoConfig.org, repoConfig.name);
2520
const contentTransform = (content, sourcePath) => transform(content, {
2621
repoUrl,
27-
branch: releaseVersion, // Use release version, not 'main'
22+
branch: ref, // Always 'main'
2823
org: repoConfig.org,
2924
name: repoConfig.name,
3025
sourcePath
@@ -33,7 +28,7 @@ const contentTransform = (content, sourcePath) => transform(content, {
3328
export default [
3429
'docusaurus-plugin-remote-content',
3530
{
36-
// Basic configuration - URLs use release version
31+
// Basic configuration - URLs use main branch
3732
name: 'architecture-main',
3833
sourceBaseUrl,
3934
outDir: 'docs/architecture',
@@ -54,11 +49,9 @@ export default [
5449
filename: 'README.md',
5550
newFilename: 'architecture.mdx',
5651
repoUrl,
57-
branch: releaseVersion, // Use release version for footer
52+
branch: ref, // Always 'main' for footer
5853
content,
5954
contentTransform
60-
// Note: Not passing mainReleaseVersion here since this IS the main llm-d repo
61-
// This will use Scenario 2 footer format: "llm-d v0.3.0, the latest public release"
6255
});
6356
}
6457
return undefined;

0 commit comments

Comments
 (0)