website icon indicating copy to clipboard operation
website copied to clipboard

feat: enable tools view regeneration on a build time

Open princerajpoot20 opened this issue 2 years ago • 15 comments

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

princerajpoot20 avatar Oct 24 '23 19:10 princerajpoot20

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
Latest commit da35a34f7605be5f559995b1665e7234a5e917ff
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.

netlify[bot] avatar Oct 24 '23 19:10 netlify[bot]

⚡️ 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/

github-actions[bot] avatar Oct 29 '23 19:10 github-actions[bot]

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.

akshatnema avatar Nov 03 '23 21:11 akshatnema

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 avatar Nov 06 '23 15:11 princerajpoot20

@asyncapi-bot is working like a charm.😄

princerajpoot20 avatar Nov 06 '23 16:11 princerajpoot20

@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)

derberg avatar Nov 06 '23 18:11 derberg

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

akshatnema avatar Dec 07 '23 18:12 akshatnema

⚡️ 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/

asyncapi-bot avatar Dec 19 '23 12:12 asyncapi-bot

@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.

derberg avatar Dec 19 '23 14:12 derberg

@derberg @akshatnema Ping Pong 😅

princerajpoot20 avatar Mar 06 '24 18:03 princerajpoot20

@princerajpoot20 Kindly resolve the conflicts first.

akshatnema avatar Mar 07 '24 16:03 akshatnema

@princerajpoot20 any update on this issue?

sambhavgupta0705 avatar Apr 01 '24 17:04 sambhavgupta0705

Done. resolved conflicts.

princerajpoot20 avatar Apr 03 '24 03:04 princerajpoot20

@derberg @akshatnema PTAL

sambhavgupta0705 avatar Apr 06 '24 02:04 sambhavgupta0705

@princerajpoot20 please resolve the conflicts

sambhavgupta0705 avatar Jul 22 '24 08:07 sambhavgupta0705

This pull request 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 pull request, add a comment with detailed explanation.

There can be many reasons why some specific pull request 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 pull request forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] avatar Nov 20 '24 00:11 github-actions[bot]

Walkthrough

The changes introduce a new asynchronous function, combineAutomatedAndManualTools, which enhances the existing buildTools function by incorporating error handling. A new function, buildToolsManual, retrieves automated tools and calls the new function, also with error handling. The exports have been updated to include both functions, and a conditional check ensures buildTools runs when the script is executed directly. Additionally, scripts/index.js has been modified to integrate buildToolsManual into the existing workflow.

Changes

File Change Summary
scripts/build-tools.js Added combineAutomatedAndManualTools and buildToolsManual functions; updated exports.
scripts/index.js Added import for buildToolsManual and modified start function to include a call to it.

Assessment against linked issues

Objective Addressed Explanation
Support tools view regeneration on a PR level for manual tools (#2124)

Possibly related PRs

  • #3168: Modifies the workflow for testing in a Node.js project, potentially affecting the integration of the new buildToolsManual function.
  • #3318: Updates the testing workflow, which could impact how the changes in the main PR are validated in the CI/CD pipeline.

Suggested labels

ready-to-merge, gsoc

Suggested reviewers

  • derberg
  • magicmatatjahu
  • akshatnema
  • sambhavgupta0705
  • Mayaleeeee
  • asyncapi-bot-eve
  • BhaswatiRoy

🐰 In the garden where tools combine,
A manual touch, oh how divine!
With error logs to guide the way,
We build our dreams, come what may.
So hop along, let's make it right,
For every tool shines in the light! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Nov 20 '24 00:11 coderabbitai[bot]

closing this as no response

sambhavgupta0705 avatar Dec 16 '24 11:12 sambhavgupta0705