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

Madhur/w 17619393 #6017

Merged
merged 6 commits into from
Jan 24, 2025
Merged

Madhur/w 17619393 #6017

merged 6 commits into from
Jan 24, 2025

Conversation

madhur310
Copy link
Collaborator

feat: adding spectral library and validation based on OAS3 spec

What does this PR do?

adding spectral library and validation based on OAS3 spec, note currently this just logs the validation errors. We still need a way to display it to user.

What issues does this PR fix or reference?

@W-17619393@

Functionality Before

No OAS specific validation existed.

Functionality After

Validations are happening on OAS docs generated by LLM.

@madhur310 madhur310 requested a review from a team as a code owner January 22, 2025 01:15
@madhur310 madhur310 changed the base branch from develop to feat/apex-oas January 22, 2025 01:16
package.json Show resolved Hide resolved
packages/salesforcedx-vscode-apex/package.json Outdated Show resolved Hide resolved
@@ -114,6 +120,18 @@ export class ApexActionController {
telemetryService.sendException(telemetryEvent, errorMessage);
};

private async validateOpenApiDocument(openapiDocument: string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private async validateOpenApiDocument(openapiDocument: string) {
private async validateOpenApiDocument(openapiDocument: string): Promise<void> {

Copy link
Member

@mingxuanzhangsfdx mingxuanzhangsfdx left a comment

Choose a reason for hiding this comment

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

There is also something wrong with CI due to incompatibility of dependencies and node version.

package.json Outdated
@@ -23,6 +23,9 @@
"@octokit/core": "4.2.4",
"@octokit/webhooks-definitions": "^3.67.3",
"@salesforce/dev-config": "^3.1.0",
"@stoplight/spectral-core": "1.19.4",
"@stoplight/spectral-functions": "1.9.3",
Copy link
Member

Choose a reason for hiding this comment

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

where are the two dependencies used? @stoplight/spectral-functions and @stoplight/spectral-ruleset-bundler?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah my miss, I don't need these any more.

package.json Outdated
@@ -23,6 +23,9 @@
"@octokit/core": "4.2.4",
"@octokit/webhooks-definitions": "^3.67.3",
"@salesforce/dev-config": "^3.1.0",
"@stoplight/spectral-core": "1.19.4",
Copy link
Member

Choose a reason for hiding this comment

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

If the dependency is only used in apex, I think we just include it in its package.json. The package.json in root is mostly for the whole monorepo

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added it in rev2 per Peter's recommendation, to keep pin the dependency to specific version so 1. package size doesn't get bloated 2. no odd behavior.

Copy link
Member

Choose a reason for hiding this comment

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

Is this file still needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no I thought I have deleted it, will remove it.

Base automatically changed from feat/apex-oas to feat/generation-strategy January 24, 2025 16:16
@mingxuanzhangsfdx mingxuanzhangsfdx self-requested a review January 24, 2025 19:13
@madhur310 madhur310 changed the base branch from feat/generation-strategy to feat/apex-oas January 24, 2025 21:14
@peternhale peternhale merged commit c0be593 into feat/apex-oas Jan 24, 2025
6 checks passed
@peternhale peternhale deleted the madhur/W-17619393 branch January 24, 2025 22:03
CristiCanizales added a commit that referenced this pull request Jan 27, 2025
* feat: update jar with changes in lsp to add comments in context (#6025)

* feat: update jar with changes in lsp to add comments in context

* feat: update jar with changes in lsp to add comments in context

* fix: add comment property to context (#6026)

@W-17645605@
moved comments from ApexClassOASGatherContextResponse and added comment proeprty to class/method/property

* chore: remove deploy and retrieve commands for oas and hide create oas from method command (#6029)

* Madhur/w 17619393 (#6017)

* feat: adding spectral library and validation based on OAS3 spec

* feat: adding spectral library and validation based on OAS3 spec

* feat: adding spectral library and validation based on OAS3 spec

* feat: adding spectral library and validation based on OAS3 spec

* fix: increase minimum supported node version to v20.17.0

* feat: adding spectral library and validation based on OAS3 spec

---------

Co-authored-by: Daphne Yang <daphne.yang@salesforce.com>

---------

Co-authored-by: Cristina Cañizales <113132642+CristiCanizales@users.noreply.github.com>
Co-authored-by: peternhale <peternhale@users.noreply.github.com>
Co-authored-by: madhur310 <madhur.shrivastava@salesforce.com>
Co-authored-by: Daphne Yang <daphne.yang@salesforce.com>
CristiCanizales added a commit that referenced this pull request Jan 27, 2025
* Mz/apply generation strategy (#6018)

* feat: integrate apex action controller with prompt generation orchestrator

* chore: update framework

* chore: add error entries

* feat: whole class gen strategy (#6024)

* feat: integrate apex action controller with prompt generation orchestrator

* feat: whole class gen strategy

* chore: sort imports

* chore: asdfghj

---------

Co-authored-by: mingxuanzhang <mingxuanzhang@salesforce.com>

* feat: update jar with changes in lsp to add comments in context (#6028)

* feat: update jar with changes in lsp to add comments in context (#6025)

* feat: update jar with changes in lsp to add comments in context

* feat: update jar with changes in lsp to add comments in context

* fix: add comment property to context (#6026)

@W-17645605@
moved comments from ApexClassOASGatherContextResponse and added comment proeprty to class/method/property

---------

Co-authored-by: peternhale <peternhale@users.noreply.github.com>

* feat: method-by-method OAS doc generation strategy (#6023)

* feat: create open api doc method by method

* chore: update for generating ESR

* chore: refine

* chore: refine prompt structure

* feat: enable comments for prompt generation

* chore: sync jorje jar

* chore: sync generation strategy with latest change (#6031)

* feat: update jar with changes in lsp to add comments in context (#6025)

* feat: update jar with changes in lsp to add comments in context

* feat: update jar with changes in lsp to add comments in context

* fix: add comment property to context (#6026)

@W-17645605@
moved comments from ApexClassOASGatherContextResponse and added comment proeprty to class/method/property

* chore: remove deploy and retrieve commands for oas and hide create oas from method command (#6029)

* Madhur/w 17619393 (#6017)

* feat: adding spectral library and validation based on OAS3 spec

* feat: adding spectral library and validation based on OAS3 spec

* feat: adding spectral library and validation based on OAS3 spec

* feat: adding spectral library and validation based on OAS3 spec

* fix: increase minimum supported node version to v20.17.0

* feat: adding spectral library and validation based on OAS3 spec

---------

Co-authored-by: Daphne Yang <daphne.yang@salesforce.com>

---------

Co-authored-by: Cristina Cañizales <113132642+CristiCanizales@users.noreply.github.com>
Co-authored-by: peternhale <peternhale@users.noreply.github.com>
Co-authored-by: madhur310 <madhur.shrivastava@salesforce.com>
Co-authored-by: Daphne Yang <daphne.yang@salesforce.com>

* chore: remove eslint disable

* chore: move schemas to oas folder

* chore: sort imports

---------

Co-authored-by: Mingxuan Zhang <132491513+mingxuanzhangsfdx@users.noreply.github.com>
Co-authored-by: mingxuanzhang <mingxuanzhang@salesforce.com>
Co-authored-by: peternhale <peternhale@users.noreply.github.com>
Co-authored-by: madhur310 <madhur.shrivastava@salesforce.com>
Co-authored-by: Daphne Yang <daphne.yang@salesforce.com>
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.

4 participants