Skip to content

Commit c7076e3

Browse files
authored
docs(wiki): improve discoverability of workspace status reports (#1977)
docs(wiki): add workspace status reports index and navigation links Improve discoverability of branch-specific workspace status pages by generating a Workspace Status Reports proxy page, linking it from the sidebar, and adding a user guide quick-reference link. Detect report pages dynamically from existing wiki branch report pages. Made-with: Cursor
1 parent e298603 commit c7076e3

2 files changed

Lines changed: 78 additions & 2 deletions

File tree

.github/workflows/github-script/sync-user-guide-to-wiki.js

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ ${repoLines.join('\n')}`;
168168
content.WORKFLOW_EXPORT = `${baseUrl}/actions/workflows/export-workspaces-as-dynamic.yaml`;
169169
content.WORKFLOW_UPDATE_REFS = `${baseUrl}/actions/workflows/update-plugins-repo-refs.yaml`;
170170
content.WIKI_URL = `${baseUrl}/wiki`;
171+
content.WORKSPACE_STATUS_REPORTS_PAGE = 'Workspace-Status-Reports';
171172

172173
return content;
173174
}
@@ -212,7 +213,11 @@ function transformForWiki(content, dynamicContent) {
212213
/**
213214
* Generate the wiki sidebar navigation
214215
*/
215-
function generateSidebar(workspaceStats) {
216+
function generateSidebar(workspaceStats, reportPages) {
217+
const reportLinks = reportPages.length > 0
218+
? reportPages.map(({ branchName, pageName }) => ` * [${branchName}](${pageName})`).join('\n')
219+
: ' * [main](main)';
220+
216221
return `### 📚 User Guide
217222
* [Home](Home)
218223
* [Getting Started](Getting-Started)
@@ -226,6 +231,8 @@ function generateSidebar(workspaceStats) {
226231
227232
### 📊 Generated Reports
228233
* [Backstage Compatibility Report](Backstage-Compatibility-Report)
234+
* [Workspace Status Reports](Workspace-Status-Reports)
235+
${reportLinks}
229236
230237
### 📈 Stats
231238
* **${workspaceStats.total}** workspaces
@@ -238,6 +245,62 @@ function generateSidebar(workspaceStats) {
238245
`;
239246
}
240247

248+
/**
249+
* Detect branch-specific workspace status pages in the wiki.
250+
* Expected page names are `main` and `release-*`.
251+
*/
252+
async function detectWorkspaceStatusReportPages(wikiDir) {
253+
const files = await fs.readdir(wikiDir, { withFileTypes: true });
254+
const pages = files
255+
.filter(file => file.isFile() && file.name.endsWith('.md'))
256+
.map(file => file.name.replace(/\.md$/, ''))
257+
.filter(name => name === 'main' || name.startsWith('release-'))
258+
.sort((a, b) => {
259+
if (a === 'main') return -1;
260+
if (b === 'main') return 1;
261+
return b.localeCompare(a, undefined, { numeric: true });
262+
})
263+
.map(pageName => ({ pageName, branchName: pageName }));
264+
265+
if (!pages.some(page => page.pageName === 'main')) {
266+
pages.unshift({ pageName: 'main', branchName: 'main' });
267+
}
268+
269+
return pages;
270+
}
271+
272+
/**
273+
* Generate a discoverability page for branch-specific workspace status reports.
274+
*/
275+
function generateWorkspaceStatusReportsPage(reportPages) {
276+
const pageLinks = reportPages
277+
.map(({ branchName, pageName }) => `- [\`${branchName}\`](${pageName})`)
278+
.join('\n');
279+
280+
return `# Workspace Status Reports
281+
282+
This repository publishes regularly generated workspace status pages for merged content on \`main\` and each maintained \`release-*\` branch. There is one generated status page per branch.
283+
284+
## Available Branch Reports
285+
286+
${pageLinks}
287+
288+
## What These Reports Contain
289+
290+
- A **last updated** timestamp for the generated report
291+
- The **total workspaces** count for that branch snapshot
292+
- A **Workspace Overview** table that summarizes each workspace
293+
- Searchable details for each workspace, including workspace name, source repository and ref, Backstage version, plugin package/version details, and visual warnings/markers (for example version override warnings and metadata status indicators)
294+
295+
## How to Use These Pages
296+
297+
- Start with the branch that matches your target deployment line (for example \`main\` or \`release-1.9\`)
298+
- Use your browser search to quickly locate a workspace by name or package
299+
- Compare source repo/ref and Backstage version data when validating updates or troubleshooting exports
300+
- Check markers and warnings to spot metadata gaps, overlays/patch usage, and version overrides
301+
`;
302+
}
303+
241304
/**
242305
* Generate the wiki home page with dynamic content
243306
*/
@@ -377,6 +440,10 @@ async function syncUserGuideToWiki({ github, context, core }) {
377440

378441
// Clone wiki
379442
await cloneWiki(wikiUrl, wikiDir, core);
443+
444+
// Detect existing workspace status report pages before writing new content
445+
const reportPages = await detectWorkspaceStatusReportPages(wikiDir);
446+
core.info(`Detected ${reportPages.length} workspace status report pages`);
380447

381448
// Process each user guide file
382449
core.info('\nProcessing user guide files...');
@@ -403,7 +470,15 @@ async function syncUserGuideToWiki({ github, context, core }) {
403470

404471
// Generate sidebar with stats
405472
core.info('Generating _Sidebar.md...');
406-
await fs.writeFile(join(wikiDir, '_Sidebar.md'), generateSidebar(workspaceStats), 'utf-8');
473+
await fs.writeFile(join(wikiDir, '_Sidebar.md'), generateSidebar(workspaceStats, reportPages), 'utf-8');
474+
475+
// Generate workspace status reports index page
476+
core.info('Generating Workspace-Status-Reports.md...');
477+
await fs.writeFile(
478+
join(wikiDir, 'Workspace-Status-Reports.md'),
479+
generateWorkspaceStatusReportsPage(reportPages),
480+
'utf-8'
481+
);
407482

408483
// Always regenerate home page with latest stats
409484
core.info('Generating Home.md with dynamic content...');

user-guide/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ This guide covers the essential workflows for using the **rhdh-plugin-export-ove
3838
| Fix build failure | [02 - Export Tools](./02-export-tools.md#troubleshooting) |
3939
| Sync metadata | [04 - Metadata Synchronization](./04-metadata-synchronization.md) |
4040
| Create/update a patch | [06 - Patch Management](./06-patch-management.md) |
41+
| Check branch workspace status reports | [Workspace Status Reports]({{AUTO:WORKSPACE_STATUS_REPORTS_PAGE}}) |
4142

4243
---
4344

0 commit comments

Comments
 (0)