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

fix: updated commands for generator on website #3545

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

Conversation

SahilDahekar
Copy link
Contributor

@SahilDahekar SahilDahekar commented Jan 4, 2025

Description

  • Updated the commands on /tools/generator page to work with new generator and templates for both normal cli and docker

Screenshots

Before :

Normal command -

Screenshot from 2025-01-04 20-30-42

Docker command -

image

After :

Normal command -

image

Docker command -

image

Related issue(s)

Fixes #3522

Summary by CodeRabbit

  • New Features

    • Updated AsyncAPI generator template to version 3.0.0.
    • Added --use-new-generator flag to generator commands.
    • Enhanced Docker command with --network host option.
  • Improvements

    • Specified explicit template version for HTML template.
    • Updated generator configuration for consistent versioning.
    • Adjusted class name order in the Case Study Card component for improved styling consistency.

Copy link

coderabbitai bot commented Jan 4, 2025

Walkthrough

The pull request focuses on updating AsyncAPI generator templates and configurations to version 3.0.0. Changes are made across multiple configuration files and a React component, specifically updating template references, adding the --use-new-generator flag, and modifying the Docker command execution. These modifications aim to address potential compatibility and functionality issues with the AsyncAPI generator.

Changes

File Change Summary
components/GeneratorInstallation.tsx - Updated template state to @asyncapi/[email protected]
- Modified params state to include --use-new-generator
- Added --network host to Docker command
config/generator-flags.json - Updated @asyncapi/html-template to version 3.0.0
- Added --use-new-generator flag
config/generator-templates.json - Updated HTML template entry to include @3.0.0 version suffix

Assessment against linked issues

Objective Addressed Explanation
Fix non-working generator command [#3522]
Resolve deprecated library issue [#3522]

Possibly related PRs

  • docs(generator): update latest generator documentation #3573: The changes in the main PR regarding the versioning of @asyncapi/html-template to 3.0.0 and the addition of the --use-new-generator flag are directly related to the updates in the generator documentation, which also reflects changes in the generator's functionality and usage.

Suggested labels

autoapproved, autoupdate

Suggested reviewers

  • derberg
  • asyncapi-bot-eve
  • quetzalliwrites
  • VaishnaviNandakumar
  • J0SAL

Poem

🐰 A rabbit's tale of version might,
Templates dancing in version's light,
@3.0.0 now takes the stage,
Generator's magic turns a new page!
Hop, hop, hooray for code so bright! 🚀


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25c02d6 and 1ac4161.

📒 Files selected for processing (2)
  • components/CaseStudyCard.tsx (1 hunks)
  • components/GeneratorInstallation.tsx (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • components/CaseStudyCard.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/GeneratorInstallation.tsx
⏰ Context from checks skipped due to timeout of 180000ms (3)
  • GitHub Check: Redirect rules - asyncapi-website
  • GitHub Check: Header rules - asyncapi-website
  • GitHub Check: Pages changed - asyncapi-website

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

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.

Copy link

netlify bot commented Jan 4, 2025

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 1ac4161
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/67863cd1bfd3510007b88df4
😎 Deploy Preview https://deploy-preview-3545--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.

Copy link

codecov bot commented Jan 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (78c6f2d) to head (1ac4161).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #3545   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        19           
  Lines          668       668           
=========================================
  Hits           668       668           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SahilDahekar SahilDahekar changed the title fix:updated commands for generator on website fix: updated commands for generator on website Jan 4, 2025
@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Jan 4, 2025

⚡️ Lighthouse report for the changes in this PR:

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

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
components/GeneratorInstallation.tsx (1)

65-65: Docker command updated with --network host.
Consider adding a note in the documentation about potential security or networking implications when using the host network.

config/generator-flags.json (1)

22-23: Java Spring Boot template pinned and flagged for the new generator.
Ensure relevant documentation is updated so users know that 3.0.0 is the default now.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb0a3bf and 0b9436e.

📒 Files selected for processing (3)
  • components/GeneratorInstallation.tsx (2 hunks)
  • config/generator-flags.json (1 hunks)
  • config/generator-templates.json (1 hunks)
🔇 Additional comments (9)
components/GeneratorInstallation.tsx (2)

24-24: Pinning the template to a specific version helps avoid unexpected breaking changes.
Great job specifying @asyncapi/[email protected]. This prevents users from accidentally pulling future major versions with potentially breaking changes.


26-26: Adding --use-new-generator ensures compatibility with the updated generator.
This aligns with the PR objective to maintain consistent usage with the new generator.

config/generator-templates.json (1)

2-8: Version pinning is consistent across all templates.
Explicitly referencing @asyncapi/…@3.0.0 helps ensure the correct version is used. This is aligned with best practices for stable deployments.

config/generator-flags.json (6)

2-3: Update to @asyncapi/[email protected] and appended --use-new-generator.
Pinning and adding the new generator flag aligns with the objective of ensuring compatibility with the latest generator changes.


6-7: Markdown template pinned and updated flags.
Looks good. Keep an eye on upstream updates to ensure ongoing compatibility.


10-11: Node.js production server flags integrated with the new generator.
Be sure to verify that the -p server=production parameter remains valid for all usage scenarios.


14-15: Node.js WebSockets template pinned to 3.0.0 with new generator flag.
This is consistent with the rest of the pinned templates.


18-19: Java Spring Cloud Stream template pinned & updated.
No issues found.


26-27: Python Paho template pinned & updated.
Everything looks consistent.

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.

lgtm, but there is one more thing, a nit pick from coderabbit, about --network host and security

we need to add some kind of info there about it, more importandly, we just need to make it clear to person that copies the command that --network host is there only because in the link we use URL link to AsyncAPI document, and if people use it differently, pointing to local resource, the flag would not be needed

@SahilDahekar
Copy link
Contributor Author

SahilDahekar commented Jan 13, 2025

lgtm, but there is one more thing, a nit pick from coderabbit, about --network host and security

we need to add some kind of info there about it, more importandly, we just need to make it clear to person that copies the command that --network host is there only because in the link we use URL link to AsyncAPI document, and if people use it differently, pointing to local resource, the flag would not be needed

Where should this doc change be ? Should it be added here https://www.asyncapi.com/tools/generator or https://www.asyncapi.com/docs/tools/generator/usage

Copy link
Member

derberg commented Jan 13, 2025

best above the docker command, as a code comment

@SahilDahekar
Copy link
Contributor Author

Done 👍

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4fcff19 and 25c02d6.

📒 Files selected for processing (1)
  • components/GeneratorInstallation.tsx (2 hunks)
🧰 Additional context used
🪛 eslint
components/GeneratorInstallation.tsx

[error] 66-66: Strings must use singlequote.

(quotes)


[error] 66-66: Operator '+' must be spaced.

(space-infix-ops)


[error] 66-66: Unexpected string concatenation of literals.

(no-useless-concat)


[error] 66-66: Insert ⏎······

(prettier/prettier)

🪛 GitHub Actions: PR testing - if Node project
components/GeneratorInstallation.tsx

[error] 66-66: Strings must use singlequote


[error] 66-66: Operator '+' must be spaced


[error] 66-66: Unexpected string concatenation of literals


[error] 66-66: Insert line break with proper indentation

🔇 Additional comments (2)
components/GeneratorInstallation.tsx (2)

65-68: Good addition of network flag documentation!

The comment clearly explains when the --network host flag is needed, which addresses the discussion in the PR comments.

🧰 Tools
🪛 eslint

[error] 66-66: Strings must use singlequote.

(quotes)


[error] 66-66: Operator '+' must be spaced.

(space-infix-ops)


[error] 66-66: Unexpected string concatenation of literals.

(no-useless-concat)


[error] 66-66: Insert ⏎······

(prettier/prettier)

🪛 GitHub Actions: PR testing - if Node project

[error] 66-66: Strings must use singlequote


[error] 66-66: Operator '+' must be spaced


[error] 66-66: Unexpected string concatenation of literals


[error] 66-66: Insert line break with proper indentation


24-24: LGTM! Version pinning and new generator flag added.

The changes correctly update the template version and add the required --use-new-generator flag.

Let's verify these changes align with the generator configuration:

Also applies to: 26-26

✅ Verification successful

Version and flag changes verified against configuration files

The template version @asyncapi/[email protected] and --use-new-generator flag are correctly aligned with the configuration in both generator-templates.json and generator-flags.json.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify template version and flags in config files
rg -l "3.0.0" config/
rg --json "use-new-generator" config/

Length of output: 1024


Script:

#!/bin/bash
# Check template configuration details
cat config/generator-templates.json
cat config/generator-flags.json

Length of output: 1577

components/GeneratorInstallation.tsx Outdated Show resolved Hide resolved
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.

tests are failing, something wrong with your change, look at coderabbit hint.

I recommend you build first locally to make sure it works on local, and then push

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

Successfully merging this pull request may close these issues.

The official website's command to try is not even working in the first place
3 participants