Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds "Copy as cURL" functionality to environment logs, allowing users to copy HTTP requests as executable cURL commands. The implementation includes a new CurlCommandBuilder class that constructs properly formatted cURL commands with support for compression detection via the --compressed flag.
Key changes:
- New
CurlCommandBuilderlibrary for constructing cURL commands with proper escaping and formatting - Added
bodyUnformattedfield to environment logs to preserve the original request body for cURL generation - Extended dropdown menu component to support dynamic labels and hidden items based on observables
- Comprehensive test coverage including compression handling scenarios
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
packages/app/src/renderer/app/libs/curl-command-builder.lib.ts |
New builder class for constructing cURL commands with compression detection and proper escaping |
packages/app/src/renderer/app/services/environments.service.ts |
Implements copyLogAsCurl method to generate and copy cURL commands to clipboard |
packages/app/src/renderer/app/models/environment-logs.model.ts |
Adds bodyUnformatted field to preserve original request body |
packages/app/src/renderer/app/services/data.service.ts |
Updates log creation to store unformatted request body |
packages/app/src/renderer/app/components/environment-logs/environment-logs.component.ts |
Adds dropdown menu items for copying as cURL (localhost and cloud versions) |
packages/app/src/renderer/app/components/dropdown-menu/dropdown-menu.component.ts |
Extends dropdown menu to support function-based labels and hidden$ observables |
packages/app/src/renderer/app/components/dropdown-menu/dropdown-menu.component.html |
Updates template to handle dynamic labels and hidden items |
packages/app/test/specs/environment-logs.spec.ts |
Adds comprehensive tests for cURL copy functionality including compression scenarios |
packages/app/test/libs/utils.ts |
Adds COPY_AS_CURL action to dropdown menu enum |
packages/app/test/libs/http.ts |
Improves body handling to avoid sending "{}" for empty bodies |
packages/app/test/libs/environments-logs.ts |
Adds helper method to click copy as cURL button in tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/app/src/renderer/app/components/environment-logs/environment-logs.component.ts
Show resolved
Hide resolved
f2eb953 to
6179e73
Compare
Remove test that makes the pipeline fail on GitHub Actions only (no idea why)
9427fda to
a6a98db
Compare
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.
Technical implementation details
Checklist
Closes #{issue_number}