Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable tools view regeneration on a build time #2264

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

princerajpoot20
Copy link
Member

@princerajpoot20 princerajpoot20 commented Oct 24, 2023

Description

  • Added manual tools regeneration.
  • In regenerate-tools.yml, the default function, buildTools, will be used.
  • During a build, the buildToolsManual function is used. This function utilizes the currently available tools-automated.json, ensuring automated tools don't regenerate with every build. This ensures changes are visible in PR preview.

Resolves #2124

@netlify
Copy link

netlify bot commented Oct 24, 2023

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit da35a34
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/660cd159f518ae0009f72871
😎 Deploy Preview https://deploy-preview-2264--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@princerajpoot20 princerajpoot20 changed the title adding tool preview workflow ci: adding tools view regeneration on a PR level Oct 24, 2023
@princerajpoot20 princerajpoot20 changed the title ci: adding tools view regeneration on a PR level feat: adding tools view regeneration on a PR level Oct 29, 2023
@github-actions
Copy link

github-actions bot commented Oct 29, 2023

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 30
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🔴 PWA 30

Lighthouse ran on https://deploy-preview-2264--asyncapi-website.netlify.app/

Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks pretty clean to me, @akshatnema thoughts?

scripts/build-tools.js Show resolved Hide resolved
@derberg derberg changed the title feat: adding tools view regeneration on a PR level feat: enable tools view regeneration on a build time Oct 30, 2023
@akshatnema
Copy link
Member

looks pretty clean to me, @akshatnema thoughts?

I'm not in support of including the building of tools in build time because if we make these scripts at the build level, tools.json will be updated or regenerated at every start of the website. And we don't have such frequent changes in the tools. So, we can make a workflow such that whenever there will be changes in tools-manual.json, it can trigger PR workflow to update tools.json in the PR.

@princerajpoot20
Copy link
Member Author

princerajpoot20 commented Nov 6, 2023

So, We can have a new workflow such that if there are any changes to tools-manual.json, a new PR will be triggered to update tools.json.

A few things we have to take into account:

  • We have to add a /do-not-merge label to the newly generated PR since we already have a workflow that automatically approves and merges PRs generated by the asyncapi-bot. This PR should not be merged until the contributor's PR is merged. We can use this PR for preview at the PR level.

  • If there are any new commits in the contributor's PR, then we need to update/regenerate tools.json in the generated PR accordingly to reflect the new changes. There is no need to create a new PR for these updates.

  • After the successful merge of the contributor's PR, we have to remove the /do-not-merge tag from the generated PR, so that it can also be merged.

The problem that may occur is that if adding the /do-not-merge script takes more time than expected, then the PR could get merged during that period.

Another approach could be:

To push the changes into the contributor's PR directly. This could be possible when:

  • The PR is marked to Allow edits and access to secrets by maintainers, which is the default setting.

  • I am not sure, but I believe the asyncapi-bot does not have access, and only the asyncapi-bot-eve has maintainer rights, so only that account can push changes to the contributor's PR directly. I'm not sure about this.

What are your views @akshatnema, @derberg ?

@princerajpoot20
Copy link
Member Author

@asyncapi-bot is working like a charm.😄

@derberg
Copy link
Member

derberg commented Nov 6, 2023

@akshatnema but building of tools during build just handles manual tools only, quick operation. During build we build also other things, like rss feed, or case studies - that also do not change often.

ci/cd automation is nice but the more custom workflows the harder migration is (you could see how long it took to migrate recently)

@akshatnema
Copy link
Member

ci/cd automation is nice but the more custom workflows the harder migration is (you could see how long it took to migrate recently)

Ok, got your point well. But looking into present changes made by @princerajpoot20, I think we should have a separate file for building manual tools at build time. I'm not in preference to change the current build-tools automation because I've a different plan for it (to restructure the implementation of tools generation). Therefore, it would be nice, if we take building of manual tools in separate script file. WDYT? @derberg

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Dec 19, 2023

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 30
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-2264--asyncapi-website.netlify.app/

@derberg
Copy link
Member

derberg commented Dec 19, 2023

@akshatnema really depends. The question is when do you plan these changes. Cause if not soon, then I say we merge as it is and later just refactor.

@princerajpoot20
Copy link
Member Author

@derberg @akshatnema Ping Pong 😅

@akshatnema
Copy link
Member

@princerajpoot20 Kindly resolve the conflicts first.

@sambhavgupta0705
Copy link
Member

@princerajpoot20 any update on this issue?

@princerajpoot20
Copy link
Member Author

Done. resolved conflicts.

@sambhavgupta0705
Copy link
Member

@derberg @akshatnema PTAL

@sambhavgupta0705
Copy link
Member

@princerajpoot20 please resolve the conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support tools view regeneration on a PR level for manual tools
5 participants