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

Enhancing Performance and Reliability of AsyncAPI CLI #1657

Open
AceTheCreator opened this issue Feb 10, 2025 · 1 comment
Open

Enhancing Performance and Reliability of AsyncAPI CLI #1657

AceTheCreator opened this issue Feb 10, 2025 · 1 comment
Labels
gsoc This label shoudl be used for issues or discussions related to ideas for Google Summer of Code

Comments

@AceTheCreator
Copy link
Member

AceTheCreator commented Feb 10, 2025

Overview

The AsyncAPI CLI is nearly feature-complete, but its performance, testing reliability, and usability need significant improvements. This project focuses on optimizing command execution speed, enhancing test reliability, and introducing much-requested features such as publishing and syncing AsyncAPI files with remote repositories.

Why This is Needed

Performance Issues: Some CLI commands, such as generate, take too long to execute.
Flaky Testing & Outdated Dependencies: Running test cases locally is challenging due to outdated dependencies, leading to debugging issues.
Long-Standing Feature Gaps: The community has requested a way to publish and sync AsyncAPI files with repositories.
Slow Installation: The CLI installation process is inefficient; migrating to Bun or pnpm could speed this up.
Lack of Custom Validation Rules: Users cannot currently validate AsyncAPI files against their own Spectral rules.

Project Goals

Performance Optimization:

  • Profile and optimize slow CLI commands, particularly generate.
  • Investigate migrating to Bun or pnpm to speed up installation.

Test & Debugging Improvements:

  • Update outdated dependencies to improve test reliability
  • Refactor test cases to reduce flakiness and make debugging easier.

New Features:

  • Publish & Sync: Implement functionality to allow users to sync and publish AsyncAPI files with remote repositories (related issue)
  • Custom Validation Rules: Enable users to validate AsyncAPI files against custom Spectral rules for better enforcement of API standards.

✅ Logging & Documentation Improvements:

  • Improve logging to provide clearer feedback and debugging information.
  • Update documentation to reflect performance improvements and new features.

Expected Outcome

By the end of GSoC 2025, the AsyncAPI CLI should be significantly faster, more reliable, and equipped with features that improve usability and debugging. The improvements will make contributing to the project easier while also enhancing the developer experience for end users.

Skills Required

JavaScript/TypeScript
Node.js
Performance Optimization (e.g., profiling, dependency management)
Testing Libraries
APIs

Difficulty Level

🟡 Medium to High

Resources

AsyncAPI CLI Repository
AsyncAPI Generator Issue #538
Bun.sh
pnpm
Spectral Rules for API Validation

@github-project-automation github-project-automation bot moved this to To Triage in CLI - Kanban Feb 10, 2025
@AayushSaini101 AayushSaini101 added the gsoc This label shoudl be used for issues or discussions related to ideas for Google Summer of Code label Feb 10, 2025
@Adi-204
Copy link
Contributor

Adi-204 commented Feb 13, 2025

Hi @AceTheCreator , @AayushSaini101 and team
The project idea presents a fantastic opportunity to gain hands-on experience while contributing meaningfully to an open-source initiative that benefits a large developer community. I have been an active contributor to open-source projects, and I look forward to collaborating with the mentors and the community to bring these improvements to the AsyncAPI CLI.

Research and Findings regarding testing of interactive mode in some commands -
The AsyncAPI CLI provides an interactive mode for certain commands, which is implemented using different libraries across the codebase. Specifically:

  1. inquirer is used for commands like asyncapi file.
  2. @clack/prompts is used for commands like asyncapi generate fromTemplate.

However, the current codebase lacks proper testing for this interactive mode, making it difficult to ensure reliability and consistency.

After research, a method was identified to test multiple calls to ux.prompt without requiring any additional external libraries, apart from the default @oclif/core. The ux.prompt method can be effectively stubbed using Sinon.JS , which is integrated within @oclif/test. Sinon.JS stubs can be used to mock responses for multiple prompts.
Resource - oclif/oclif#286 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsoc This label shoudl be used for issues or discussions related to ideas for Google Summer of Code
Projects
Status: To Triage
Development

No branches or pull requests

3 participants