feat: enhance curl command handling with file uploads#1358
Merged
Conversation
Contributor
BenchmarkManyRunbooks-4
Metadata
BenchmarkOpenAPI3-4
Metadata
BenchmarkSingleRunbook-4
Metadata
Reported by octocov |
Contributor
Code Metrics Report
Details | | main (a089a23) | #1358 (45f8cb5) | +/- |
|---------------------|----------------|-----------------|-------|
- | Coverage | 60.3% | 60.1% | -0.2% |
| Files | 80 | 80 | 0 |
| Lines | 9243 | 9207 | -36 |
- | Covered | 5576 | 5541 | -35 |
- | Code to Test Ratio | 1:0.8 | 1:0.8 | -0.1 |
| Code | 17267 | 17211 | -56 |
- | Test | 14393 | 14281 | -112 |
+ | Test Execution Time | 7m47s | 6m59s | -48s |Code coverage of files in pull request scope (80.4% → 78.6%)
Reported by octocov |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates how
curlcommand parsing is handled in therunbookpackage, specifically improving support for file uploads in curl data arguments. The main change is the removal of custom logic for expanding curl data files in favor of a new approach provided by an updated dependency. Additionally, the code now supports specifying a working directory for curl file uploads, and related tests and test data have been updated accordingly.Curl command parsing and file upload improvements:
expandCurlDataFilesfunction with the newcurlreq.Parser(from the updatedgithub.com/k1LoW/curlreqv0.4.0), which now handles file expansion for curl data arguments. This simplifies the code and leverages upstream improvements. (runbook.go,go.mod) [1] [2] [3]wd(working directory) field to therunbookstruct and set its default to"."to support specifying the working directory for curl file uploads, which is now passed to the parser. (runbook.go) [1] [2]Testing updates:
runbook_test.go,testdata/curl_command_with_file.append_step.golden,testdata/test.json) [1] [2] [3]TestExpandCurlDataFilesand its supporting code, since file expansion is handled by the updated dependency. (runbook_test.go)Minor cleanup:
slicesimport fromrunbook.go.