website
website copied to clipboard
Support tools view regeneration on a PR level for manual tools
Context
This page: https://www.asyncapi.com/tools Gets regenerated once a week (or anytime by manual trigger) thanks to https://github.com/asyncapi/website/blob/master/.github/workflows/regenerate-tools.yml Basically this script is called: https://github.com/asyncapi/website/blob/master/scripts/build-tools.js More info about entire solution you can find in: https://github.com/asyncapi/community/blob/master/new-tool-documentation.md
Problem/Limitation
So people can add tools also manually to the website, through a PR: https://github.com/asyncapi/website/pull/2114 But problem is, that tools (as mentioned above) are not refreshed during website build, which means preview on PR level do not reflect PR changes.
- So basically review is harder
- After merge reviewer needs to remember to call rebuild workflow manually
No-go solution
Solution is not to rebuild tools, with the same script that we have now, on build level. We use logs of GH API there and do not want to run out of credits too soon
Hi @derberg, I would like to work on this issue. Can you please assign this to me.
please go ahead @Arbtrage
@Arbtrage any updates?
Hey @akshatnema , I am still searching for a solution for this issue. Can you guide me on some approaches ?
Hey @derberg and @akshatnema,
I would like to work on this. The solution I am considering involves having two workflows: automatic and manual.
The manual workflow can be used to preview the PR. This workflow can be triggered by a comment from the code owner.
The automatic workflow will be invoked when a PR is merged. If there are changes in the ansycapi-tools section, then only will this automatic workflow be triggered.
What are your views on this?
The automatic workflow will be invoked when a PR is merged. If there are changes in the ansycapi-tools section, then only will this automatic workflow be triggered.
We already have automatic workflow to update the tools every Monday. We only want to check for manual tools and update the manual tools of there is any changes in the file.
Hey @derberg and @akshatnema,
For the PR preview workflow, the approach I'm considering is to:
- have a workflow, which will be run by the maintainer.
- This workflow will generate the manual tools section. If there are changes, it will create a new PR. This new PR will target the contributor's PR. In this way, the changes in the tools section will directly be pushed to the contributor's PR, allowing us to preview changes at the PR level.
What are your thoughts on this? Am I on the right track? If not, could you please guide me further?
@akshatnema correct me if you do not agree but imho the right way is:
because we already have https://github.com/asyncapi/website/blob/master/package.json#L16C5-L16C53 script to build tools, what has to be done is:
- refactor https://github.com/asyncapi/website/blob/master/scripts/build-tools.js so we have a way to run a script without invoking
let automatedTools = await convertTools(githubExtractData). This could be done with some environment variable, or just maybe we need separate script, one for build of automated tools and one for manual build. Up to contributor to suggest what would be cleanest and better to maintain and understand - we do not need any workflows, rebuilding of manual tools can be done as part of next.js netlify build. So new script for manual only should be invoked in https://github.com/asyncapi/website/blob/master/scripts/index.js
thoughts?
Yeah @derberg, that's what I think of to have a separate file to check for manual tools and run that file only for each PR checks. We can do that using node scripts/tools/check-tools.js, some what like this.
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart: