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

Feature/grpc #2369

Open
wants to merge 173 commits into
base: main
Choose a base branch
from
Open

Feature/grpc #2369

wants to merge 173 commits into from

Conversation

Krishanx92
Copy link
Contributor

Purpose

Describe the problems, issues, or needs driving this feature/fix and include links to related issues in the following format: Resolves issue1, issue2, etc.

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

@Krishanx92 Krishanx92 added the trigger-action When this includes apk actions getting trigger for pr label May 10, 2024
@github-actions github-actions bot removed the trigger-action When this includes apk actions getting trigger for pr label May 10, 2024
@O-sura O-sura added the trigger-action When this includes apk actions getting trigger for pr label May 13, 2024
@github-actions github-actions bot removed the trigger-action When this includes apk actions getting trigger for pr label May 14, 2024
@AmaliMatharaarachchi AmaliMatharaarachchi added the trigger-action When this includes apk actions getting trigger for pr label May 14, 2024

private static final Logger logger = LogManager.getLogger(GRPCAPI.class);
private final List<Filter> filters = new ArrayList<>();
private APIConfig apiConfig;
Copy link

Choose a reason for hiding this comment

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

Suggested change
private APIConfig apiConfig;
private APIConfig apiConfig;

Comment on lines +108 to +109


Copy link

Choose a reason for hiding this comment

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

You could remove the extra spaces here and there

@@ -280,6 +280,14 @@ public class APIClient {
return fullBasePath;
}

isolated function returnFullGRPCBasePath(string basePath, string 'version) returns string {
string fullBasePath = basePath;
if (!string:endsWith(basePath, 'version)) {

Choose a reason for hiding this comment

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

Suggested change
if (!string:endsWith(basePath, 'version)) {
if !string:endsWith(basePath, 'version) {

@@ -448,6 +456,19 @@ public class APIClient {
sandboxRoutes.push(gqlRoute.metadata.name);
}
}
} else if apkConf.'type == API_TYPE_GRPC{

Choose a reason for hiding this comment

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

Suggested change
} else if apkConf.'type == API_TYPE_GRPC{
} else if apkConf.'type == API_TYPE_GRPC {

Comment on lines +893 to +895
} else {
return e909022("Provided Type currently not supported for GRPC APIs.", error("Provided Type currently not supported for GRPC APIs."));
}
Copy link

Choose a reason for hiding this comment

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

since the if has a return we don't need the else here

}
}
if operation.operationPolicies != () {
model:APIPolicy? apiPolicyCR = check self.generateAPIPolicyAndBackendCR(apiArtifact, apkConf, operation, operation.operationPolicies, organization, apiArtifact.uniqueId);

Choose a reason for hiding this comment

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

Break the long statements into few lines if possible

@@ -1564,6 +1696,11 @@ public class APIClient {
return hashedValue.toBase16();
}

public isolated function getUniqueNameForGrpcApi(string concatanatedServices) returns string {

Choose a reason for hiding this comment

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

Let's have doc comments for public functions

log:printError("Error occured while deleting GrpcRoute", grpcRouteDeletionResponse);
}
}
return;

Choose a reason for hiding this comment

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

Is this return required?

Comment on lines +129 to +132
public List<String> getMethods(Service Service){
return Service.methods;
}
public List<Service> getServices(){
Copy link

Choose a reason for hiding this comment

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

Let's doc comments to these public methods

'}';
}
}
}
Copy link

Choose a reason for hiding this comment

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

add a new line here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
trigger-action When this includes apk actions getting trigger for pr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants