feat(docs): automate compatibility and workspace table updates#7605
feat(docs): automate compatibility and workspace table updates#7605Ayushmore1214 wants to merge 4 commits intobackstage:mainfrom
Conversation
Signed-off-by: Ayushmore1214 <ayushmore42595@gmail.com>
awanlin
left a comment
There was a problem hiding this comment.
Thanks for getting this started @Ayushmore1214, left a few comments for you to help get it moving forward. I'd rebase first as you have some conflicts, please don't close this PR, it's a great chance to learn and improve your git skills if you hit issues.
As for the CI error, that's an odd one, let see if after the rebase it just fixes itself. 👍
| } | ||
|
|
||
| const table = args.includes('--table'); | ||
| const table = arrayToTable(backendFeatureReports); |
There was a problem hiding this comment.
For this I would expect the flags to keep working the way they do but you would simply add a --save flag and then follow the same logic as what is done here:
community-plugins/scripts/list-feature.js
Lines 137 to 153 in b05e847
| > [!NOTE] | ||
| > The "supported" column means the plugin has support for the New Frontend System, if the "alpha" column is "true" that means that the support is exported under the `/alpha` path. | ||
|
|
||
| <!-- This table is automatically generated by the list-feature script --> |
There was a problem hiding this comment.
I would expect these comments to stay in place as they are needed when the script tries to update this the next time around.
| | @backstage-community/plugin-stack-overflow | frontend-plugin | true | 1.47.2 | true | [README](https://github.com/backstage/community-plugins/blob/master/workspaces/stack-overflow/plugins/stack-overflow/README.md) | | ||
| | @backstage-community/plugin-stackstorm | frontend-plugin | | 1.47.2 | | [README](https://github.com/backstage/community-plugins/blob/master/workspaces/stackstorm/plugins/stackstorm/README.md) | | ||
| | @backstage-community/plugin-tech-insights | frontend-plugin | true | 1.47.2 | true | [README](https://github.com/backstage/community-plugins/blob/master/workspaces/tech-insights/plugins/tech-insights/README.md) | | ||
| | @backstage-community/plugin-tech-insights-maturity | frontend-plugin | | 1.47.2 | | [README](https://github.com/backstage/community-plugins/blob/master/workspaces/tech-insights/plugins/tech-insights-maturity/README.md) | |
| | @backstage-community/plugin-vault | frontend-plugin | true | 1.43.2 | true | [README](https://github.com/backstage/community-plugins/blob/master/workspaces/vault/plugins/vault/README.md) | | ||
| | @backstage-community/plugin-wheel-of-names | frontend-plugin | | 1.43.2 | | [README](https://github.com/backstage/community-plugins/blob/master/workspaces/wheel-of-names/plugins/wheel-of-names/README.md) | | ||
| | @backstage-community/plugin-xcmetrics | frontend-plugin | | 1.42.3 | | [README](https://github.com/backstage/community-plugins/blob/master/workspaces/xcmetrics/plugins/xcmetrics/README.md) | | ||
| ## Generating Table |
There was a problem hiding this comment.
It makes sense to me to just removed this entirely but add a section to the workflow docs describing the workflow and the process: https://github.com/backstage/community-plugins/blob/main/docs/workflows.md
| @@ -17,227 +17,212 @@ The Compatibility folder contains the following items: | |||
|
|
|||
| ## Workspaces and Their Plugins | |||
There was a problem hiding this comment.
I expect to see this table being wrapped in a comment like this:
<!-- This table is automatically generated by the list-workspaces-for-docs script --> Table Contents <!-- end of table -->
| @@ -5,116 +5,111 @@ | |||
| The following table lists what version of Backstage each workspace is currently compatible with. The Backstage version listed for each workspace is determined by looking at the `backstage.json` file at the root of each workspace. The badges are using the [Shields.io Dynamic JSON Badge](https://shields.io/badges/dynamic-json-badge) feature and are kept up to date automatically (when the page loads it will do this check against the file as it is on the `main` branch). | |||
|
|
|||
| > [!NOTE] | |||
There was a problem hiding this comment.
We can remove this, I mention documenting the workflow in the docs in another similar comment
| | [vault](https://github.com/backstage/community-plugins/tree/main/workspaces/vault) |  | | ||
| | [wheel-of-names](https://github.com/backstage/community-plugins/tree/main/workspaces/wheel-of-names) |  | | ||
| | [xcmetrics](https://github.com/backstage/community-plugins/tree/main/workspaces/xcmetrics) |  | | ||
| > This table is automatically updated by the `update-docs-tables` workflow. |
There was a problem hiding this comment.
I expect to see this table being wrapped in a comment like this:
<!-- This table is automatically generated by the list-compatibility script --> Table Contents <!-- end of table -->
| node scripts/list-workspaces-for-docs.js | ||
|
|
||
| echo "🔄 Updating Compatibility Tables..." | ||
| node scripts/list-compatibility.js |
There was a problem hiding this comment.
There should be 3 scripts called here, you are missing running list-feature.js
| cc @backstage/community-plugins-maintainers | ||
| branch: "auto/docs-table-update" | ||
| base: main | ||
| delete-branch: true No newline at end of file |
There was a problem hiding this comment.
Can you add a new line to the bottom of this file
| - `docs/compatibility/compatibility.md` | ||
| - `docs/compatibility/new-frontend-system.md` | ||
|
|
||
| cc @backstage/community-plugins-maintainers |
There was a problem hiding this comment.
We don't need this as we get automatically assigned based on the CODEOWNERS file. Also, as we will trigger it manually the person who did will be expecting it to generate 👍
Signed-off-by: Ayush More <ayushmore42595@gmail.com>
Signed-off-by: Ayushmore1214 <ayushmore42595@gmail.com>
awanlin
left a comment
There was a problem hiding this comment.
Hi @Ayushmore1214, I gave this another review, I'm not sure that's what you wanted to not yet as some of the comments look unresolved. Sorry about that. Going forward please just ping me so I know if I should review or not 👍
| } | ||
|
|
||
| const table = args.includes('--table'); | ||
| // --- AWANLIN'S REQUESTED LOGIC --- |
There was a problem hiding this comment.
You can remove this, we don't need it in the final script.
| // Use the Regex replacement method requested in the PR | ||
| const newContent = fileContent.replace( | ||
| /[\s\S]*/, | ||
| `\n${tableContent}\n` |
There was a problem hiding this comment.
This is an improvement but does this actually work? You removed the comments form the docs itself so my gut say no. I'd really suggest taking a deep dive into how scripts/list-feature.j works as that's the ideal pattern the script should follow.
| console.error(error.stack || error); | ||
| process.exit(1); | ||
| }); | ||
| }); No newline at end of file |
There was a problem hiding this comment.
Can you add a new line, please?
|
@awanlin sorry for late follow up on this been busy last 4-5 days will push the changes by end of this week! |
Signed-off-by: Ayush More <ayushmore42595@gmail.com>
|
Hi @Ayushmore1214, ready for review? |
|
Yes it is! |
|
This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution! |
Hey, I just made a Pull Request!
This PR automates the updating of workspace and compatibility tables, addressing #7583.
Previously, these tables had to be generated manually via local scripts, leading to stale documentation. This introduces a GitHub workflow that can be triggered on-demand to run the scripts, inject the fresh tables directly into the markdown files, and open a PR with the changes.
✔️ Checklist
Signed-off-byline in the message. (more info)