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: gsoc project - add autofix feature #236

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

Conversation

FelicixAwe
Copy link

Description
This PR includes the implementation of autofix feature of the GSoC 24' project.
Project idea link click here
High-level overview:
Create asyncapi-ruleset and fixers for the rule. Diagnostic info is provided by Spectral.

Fixers and corresponding asyncapi-rule

  • addDescription: asyncapi-operation-description
  • addField: asyncapi-info-contact-properties, asyncapi-info-contact, asyncapi-info-description, asyncapi-info-license
  • deleteEndingSlash: asyncapi-channel-no-trailing-slash, asyncapi-server-no-trailing-slash
  • deleteEmptyParam: asyncapi-channel-no-empty-parameter
  • deleteID: asyncapi-message-messageId-uniqueness
  • deleteRepeatedTags: asyncapi-tags-uniqueness
  • deleteRepeatedTags: asyncapi-tags-uniqueness
  • deleteEmptyVariables: asyncapi-server-no-empty-variable
  • updateURL: asyncapi-server-no-empty-variable
  • latestVersionUpdate: asyncapi-latest-version

Unit Test
Unit tests is included in /src/functions/test, to run unit testing:
npm test

Related issue(s)

None

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@FelicixAwe FelicixAwe changed the title GSoC Project - Add Autofix Feature feat: GSoC Project - Add Autofix Feature Aug 22, 2024
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
6 Security Hotspots
39.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@FelicixAwe FelicixAwe changed the title feat: GSoC Project - Add Autofix Feature feat: gsoc project - add autofix feature Aug 22, 2024
@Pakisan
Copy link
Member

Pakisan commented Nov 13, 2024

@ivangsa @derberg hi!

Any concerns about implementation?

Copy link
Member

derberg commented Nov 18, 2024

@Pakisan sorry but I'm not a real maintainer here, just helping @ivangsa if there are some automation related topics, or extension publish pipeline. I have zero opinion to share. It's the same if it comes to my support for jasyncapi 😃 and I'm definitely happy to step down if anyone can take up my work and @ivangsa is happy about it

@ivangsa
Copy link
Collaborator

ivangsa commented Nov 19, 2024

hi @Pakisan, sorry I didn't saw this in time..

I will find some time this week to review..

@ivangsa
Copy link
Collaborator

ivangsa commented Nov 19, 2024

@FelicixAwe How can I test this? do you have a project with asyncapi.yml that can be autofixed

I have a vscode workspace with a .spectral.yml with the following content:

extends: ["spectral:oas", "spectral:asyncapi", "spectral:arazzo"]

I couldn't manage to trigger any of the autofix rule contained in src/ruleset/asyncapi-rules.ts

Does this support only asyncapi v2 ?

How do you match the spectral "problem code" here? is it matched by the content of the description?

image

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
6 Security Hotspots
39.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@FelicixAwe
Copy link
Author

FelicixAwe commented Nov 22, 2024

Hi.

Yes it supports v2.

@FelicixAwe How can I test this? do you have a project with asyncapi.yml that can be autofixed

I have a vscode workspace with a .spectral.yml with the following content:

extends: ["spectral:oas", "spectral:asyncapi", "spectral:arazzo"]

I couldn't manage to trigger any of the autofix rule contained in src/ruleset/asyncapi-rules.ts

Does this support only asyncapi v2 ?

How do you match the spectral "problem code" here? is it matched by the content of the description?

image

@FelicixAwe FelicixAwe closed this Nov 22, 2024
@FelicixAwe FelicixAwe reopened this Nov 26, 2024
@ivangsa
Copy link
Collaborator

ivangsa commented Nov 28, 2024

@FelicixAwe How can I test this? do you have a project with asyncapi.yml that can be autofixed

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.

5 participants