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: support to generate grpc payload as JSON #264

Merged
merged 1 commit into from
Nov 3, 2023

Conversation

LinuxSuRen
Copy link
Owner

No description provided.

@LinuxSuRen LinuxSuRen added the enhancement New feature or request label Nov 3, 2023
Copy link

github-actions bot commented Nov 3, 2023

There are 21 test cases:

API Average Max Min Count Error
gRPC 127.0.0.1:7070/server.Runner/FunctionsQueryStream 4.181848ms 7.298684ms 1.499618ms 3 0
gRPC 127.0.0.1:7070/server.Runner/GetVersion 3.910712ms 5.13416ms 2.397328ms 3 0
POST http://localhost:8080/server.Runner/FunctionsQuery 2.809333ms 2.809333ms 2.809333ms 1 0
POST http://localhost:8080/server.Runner/ConvertTestSuite 2.783932ms 2.783932ms 2.783932ms 1 0
POST http://localhost:8080/server.Runner/GenerateCode 2.464329ms 2.464329ms 2.464329ms 1 0
POST http://localhost:8080/server.Runner/CreateTestSuite 2.463528ms 2.463528ms 2.463528ms 1 0
gRPC 127.0.0.1:7070/server.Runner/FunctionsQuery 2.06049ms 2.53933ms 1.139213ms 3 0
POST http://localhost:8080/server.Runner/ListCodeGenerator 1.783021ms 1.783021ms 1.783021ms 1 0
POST http://localhost:8080/server.Runner/ListTestCase 1.613319ms 1.623319ms 1.603319ms 2 0
POST http://localhost:8080/server.Runner/GetTestCase 1.594618ms 1.594618ms 1.594618ms 1 0
POST http://localhost:8080/server.Runner/GetTestSuite 1.377916ms 1.377916ms 1.377916ms 1 0
POST http://localhost:8080/server.Runner/GetSuggestedAPIs 1.204114ms 1.204114ms 1.204114ms 1 0
POST http://localhost:8080/server.Runner/GetSuites 1.089213ms 1.089213ms 1.089213ms 1 0
POST http://localhost:8080/server.Runner/PopularHeaders 1.075812ms 1.075812ms 1.075812ms 1 0
POST http://localhost:8080/server.Runner/UpdateTestSuite 952.611µs 952.611µs 952.611µs 1 0
POST http://localhost:8080/server.Runner/DeleteTestSuite 935.211µs 1.127413ms 743.009µs 2 0
POST http://localhost:8080/server.Runner/GetVersion 862.01µs 862.01µs 862.01µs 1 0
POST http://localhost:8080/server.Runner/GetSecrets 811.31µs 811.31µs 811.31µs 1 0
POST http://localhost:8080/server.Runner/GetStores 794.909µs 794.909µs 794.909µs 1 0
POST http://localhost:8080/server.Runner/ListConverter 710.608µs 710.608µs 710.608µs 1 0
tRPC Hello 539.007µs 539.007µs 539.007µs 1 1

Comment on lines +113 to +137
for _, f := range archive.File {
if f.FileInfo().IsDir() {
continue
}

targetFilePath := filepath.Join(targetDir, f.Name)
if err = os.MkdirAll(filepath.Dir(targetFilePath), os.ModePerm); err != nil {
return
}

var targetFile *os.File
if targetFile, err = os.OpenFile(targetFilePath,
os.O_CREATE|os.O_RDWR, f.Mode()); err != nil {
continue
}

var fileInArchive io.ReadCloser
fileInArchive, err = f.Open()
if err != nil {
continue
}

_, err = io.Copy(targetFile, fileInArchive)
_ = targetFile.Close()
}

Check failure

Code scanning / CodeQL

Arbitrary file access during archive extraction ("Zip Slip")

Unsanitized archive entry, which may contain '..', is used in a [file system operation](1). Unsanitized archive entry, which may contain '..', is used in a [file system operation](2).
Copy link

sonarcloud bot commented Nov 3, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 6 Code Smells

No Coverage information No Coverage information
16.7% 16.7% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.91% 88.69%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (adb8e1f) 6132 5396 88.00%
Head commit (e04cf0d) 6349 (+217) 5529 (+133) 87.09% (-0.91%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#264) 221 196 88.69%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@LinuxSuRen LinuxSuRen merged commit 7ea16a6 into master Nov 3, 2023
9 of 10 checks passed
@LinuxSuRen LinuxSuRen deleted the feat/generate-grpc-payload branch November 3, 2023 06:13
LinuxSuRen pushed a commit that referenced this pull request Jun 17, 2024
* chore(deps): update adguard/adguardhome docker tag to v0.107.35

* Update app version

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-action update-app-version <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant