-
Notifications
You must be signed in to change notification settings - Fork 0
init #4
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
base: FortiShield-patch-1
Are you sure you want to change the base?
init #4
Conversation
Reviewer's Guide by SourceryThis PR updates the package to Hoppscotch, fixes URL encoding issues, removes the security reporting process, and adds a GitHub Actions workflow for automated NPM publishing. No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
WalkthroughThe changes update various configurations and code behaviors. The global whitespace settings in Changes
Sequence Diagram(s)sequenceDiagram
participant R as Release Event
participant G as GitHub Runner
participant C as Checkout Step
participant N as Node Setup
participant I as Install & Build
participant P as Publish
R->>G: Trigger workflow on release
G->>C: Checkout repository
C-->>G: Source code
G->>N: Setup Node.js environment
N-->>G: Environment ready
G->>I: Run npm install and build
I-->>G: Build completed
G->>P: Publish package to npm
P-->>G: Confirmation of publication
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @FortiShield - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider updating the package version in a separate commit to keep the core changes focused.
- The changes to the fixtures seem to be just URL encoding; it would be good to confirm that this is the only change.
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
package.json
Outdated
| { | ||
| "version": "3.0.9", | ||
| "name": "httpsnippet", | ||
| "version": "3.0.7", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question (bug_risk): Version number downgrade — verify if this version is intentional.
The version was changed from 3.0.9 to 3.0.7. Please confirm that this revision aligns with your intended release strategy.
| - Potential impact | ||
| - Any relevant logs or screenshots | ||
|
|
||
| ## What to Expect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider adding back guidance on how to report vulnerabilities.
While the contact email is provided, the removed section "How to Report" contained valuable information about what details to include in a report. This could help users submit more effective reports. Perhaps a condensed version of the old section could be included.
| ## What to Expect | |
| ## How to Report | |
| When reporting vulnerabilities, please include: | |
| - A clear description of the issue and the steps required to reproduce it. | |
| - Any relevant logs, screenshots, or sample code that illustrate the vulnerability. | |
| - An assessment of the potential impact. | |
| - Your contact information for follow-up questions. | |
| You can reach our security team at [security@example.com](mailto:security@example.com). | |
| ## What to Expect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🧹 Nitpick comments (3)
src/targets/shell/curl/fixtures/dont-deglob.sh (1)
1-1: Modification of URL encoding patternThe change updates the URL from using percent-encoded characters to using literal characters (
%5B→[,%5D→],%2C→,). This affects how the URL is interpreted.While this may improve readability, be aware that:
- Unencoded square brackets may cause issues with some shells due to glob expansion (though the filename suggests this is intentional)
- Different servers may handle unencoded special characters differently
Consider adding a shebang to address the shellcheck warning:
+#!/bin/sh curl --request GET --url 'http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value'🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
src/targets/shell/httpie/fixtures/nested.sh (1)
1-1: URL encoding pattern changed to use literal charactersThe change replaces percent-encoded characters with their literal equivalents (
%5B→[,%5D→],%2C→,).This is consistent with similar changes across other fixture files and makes the examples more readable, though it has implications for how the query parameters are processed by the server.
Consider adding a shebang to address the shellcheck warning:
+#!/bin/sh http GET 'http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value'🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
.github/workflows/hopp-publish.yml (1)
1-28: Consider adding a workflow to test the package.While this workflow handles publishing, adding a separate workflow to run tests on pull requests and pushes to main branches would improve code quality assurance.
Here's a simple example:
name: Test on: push: branches: [main, master] pull_request: branches: [main, master] jobs: test: runs-on: ubuntu-latest strategy: matrix: node-version: [14.x, 16.x, 18.x] steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: 'npm' - run: npm ci - run: npm run build - run: npm test🧰 Tools
🪛 actionlint (1.7.4)
13-13: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (30)
.editorconfig(1 hunks).github/workflows/hopp-publish.yml(1 hunks)SECURITY.md(0 hunks)package.json(3 hunks)src/httpsnippet.ts(1 hunks)src/targets/c/libcurl/fixtures/nested.c(1 hunks)src/targets/csharp/httpclient/fixtures/nested.cs(1 hunks)src/targets/csharp/restsharp/fixtures/nested.cs(1 hunks)src/targets/go/native/fixtures/nested.go(1 hunks)src/targets/java/asynchttp/fixtures/nested.java(1 hunks)src/targets/java/nethttp/fixtures/nested.java(1 hunks)src/targets/java/okhttp/fixtures/nested.java(1 hunks)src/targets/java/unirest/fixtures/nested.java(1 hunks)src/targets/javascript/fetch/fixtures/nested.js(1 hunks)src/targets/javascript/jquery/fixtures/nested.js(1 hunks)src/targets/javascript/xhr/fixtures/nested.js(1 hunks)src/targets/kotlin/okhttp/fixtures/nested.kt(1 hunks)src/targets/node/fetch/fixtures/nested.js(1 hunks)src/targets/objc/nsurlsession/fixtures/nested.m(1 hunks)src/targets/ocaml/cohttp/fixtures/nested.ml(1 hunks)src/targets/php/curl/fixtures/nested.php(1 hunks)src/targets/php/guzzle/fixtures/nested.php(1 hunks)src/targets/powershell/restmethod/fixtures/nested.ps1(1 hunks)src/targets/powershell/webrequest/fixtures/nested.ps1(1 hunks)src/targets/ruby/native/fixtures/nested.rb(1 hunks)src/targets/shell/curl/fixtures/dont-deglob.sh(1 hunks)src/targets/shell/curl/fixtures/nested.sh(1 hunks)src/targets/shell/httpie/fixtures/nested.sh(1 hunks)src/targets/shell/wget/fixtures/nested.sh(1 hunks)src/targets/swift/nsurlsession/fixtures/nested.swift(1 hunks)
💤 Files with no reviewable changes (1)
- SECURITY.md
🧰 Additional context used
🪛 Shellcheck (0.10.0)
src/targets/shell/curl/fixtures/dont-deglob.sh
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
src/targets/shell/httpie/fixtures/nested.sh
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
🪛 actionlint (1.7.4)
.github/workflows/hopp-publish.yml
13-13: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🔇 Additional comments (28)
src/targets/powershell/restmethod/fixtures/nested.ps1 (1)
1-1: URL encoding changed from percent-encoded to literal charactersThe URL in the Invoke-RestMethod call has been changed to use literal square brackets and commas instead of their percent-encoded equivalents.
This change is consistent with modifications in other fixture files across the repository.
src/targets/javascript/jquery/fixtures/nested.js (1)
4-4: URL encoding pattern updated to use literal charactersThe URL has been modified to use literal square brackets and commas instead of their percent-encoded equivalents (
%5B→[,%5D→],%2C→,).This change aligns with the consistent pattern applied across all fixture files in this PR.
src/targets/php/curl/fixtures/nested.php (1)
6-6: URL encoding changed to use literal charactersThe URL in CURLOPT_URL has been modified to use literal square brackets and commas instead of their percent-encoded equivalents.
This is part of a consistent pattern applied across all fixture files, making the examples more readable. In PHP's context, this works correctly as the square brackets in the URL will be properly handled by curl.
src/targets/shell/curl/fixtures/nested.sh (1)
1-2: Ensure URL Consistency Across Shell FixturesThe updated URL now uses literal square brackets (
[,]) and an unencoded comma, which aligns with the standardized approach across targets. Please verify that the target server correctly interprets these characters.🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
src/targets/ocaml/cohttp/fixtures/nested.ml (1)
5-5: Consistent URI Handling in OCamlThe change to use an unencoded URL string with literal square brackets and commas in the
Uri.of_stringcall is consistent with the other modifications in this PR. Confirm that the OCamlCohttplibrary processes such URIs properly.src/targets/go/native/fixtures/nested.go (1)
11-12: Standardized URL Formatting in GoThe updated URL in the Go fixture now uses literal square brackets and commas instead of percent-encoded values. This change improves consistency across the codebase. Please ensure that the Go HTTP client parses the URL as expected.
src/targets/java/nethttp/fixtures/nested.java (1)
1-2: Unified URL Representation in JavaThe updated URI in the Java HTTP request now directly uses literal square brackets and commas. This adjustment is in harmony with the project's overall URL formatting goals. Verify that
URI.create()and the Java HTTP client correctly interpret the unencoded query parameters.src/targets/javascript/fetch/fixtures/nested.js (1)
1-1: Modernized URL Construction in Fetch RequestThe URL constant now uses literal square brackets and a comma in line with the revised formatting standards across the PR. Ensure that the environment using
fetchsupports this URL format without issues.src/targets/csharp/restsharp/fixtures/nested.cs (1)
1-1: URL encoding change looks goodChanged from percent-encoded to literal square brackets in the query parameter. This makes the URL more readable while maintaining the same functionality.
src/targets/php/guzzle/fixtures/nested.php (1)
5-5: URL encoding standardization approvedThe URL now uses literal square brackets (
[]) and comma instead of percent-encoded characters (%5B,%5D,%2C). This change is consistent with the updates made across other language fixtures.src/targets/java/okhttp/fixtures/nested.java (1)
4-4: URL character encoding simplifiedChanged from percent-encoded characters to literal characters in the URL query parameters. This improves code readability while maintaining the same request functionality.
src/targets/java/unirest/fixtures/nested.java (1)
1-1: URL encoding standardization across fixturesUpdated the URL to use literal square brackets and comma instead of their percent-encoded equivalents. This change aligns with similar updates in other language fixtures in this PR.
src/targets/kotlin/okhttp/fixtures/nested.kt (1)
4-4: URL encoding has been modified.The URL now uses unencoded square brackets
[]and comma,in the query parameters instead of their percent-encoded equivalents (%5B,%5D,%2C). This change is part of a larger pattern across the codebase to standardize URL representation.While this change is consistent with the modifications in other files, be aware that:
- Some servers or frameworks may interpret unencoded square brackets differently (especially in nested parameter structures)
- Technically, square brackets are reserved characters that should be percent-encoded according to RFC 3986
Has this change been tested with the target server to ensure it handles the unencoded characters correctly?
src/targets/java/asynchttp/fixtures/nested.java (1)
2-2: URL encoding has been modified.The URL now uses unencoded square brackets
[]and comma,in the query parameters instead of their percent-encoded equivalents. This change is part of a consistent pattern across the codebase's fixtures.While the change streamlines the URL representation, be mindful that:
- Different server-side frameworks may parse unencoded square brackets differently (especially PHP, Rails, etc.)
- Per RFC 3986, square brackets are reserved characters that should be percent-encoded
Ensure this representation works correctly with the target server and confirm if this is an intentional standardization approach.
src/targets/javascript/xhr/fixtures/nested.js (1)
12-12: URL encoding has been modified.The URL now uses unencoded square brackets
[]and comma,in the query parameters instead of their percent-encoded equivalents. This change follows the same pattern seen in other fixture files.Consider the following:
- Browser XHR implementations may handle the encoding differently than expected
- Some frameworks automatically encode URLs again before sending
- Modern browsers typically handle unencoded brackets in query parameters well, but older ones might not
Verify this works across the browser targets this code is expected to support.
src/targets/ruby/native/fixtures/nested.rb (1)
4-4:Details
❓ Verification inconclusive
URL encoding has been modified.
The URL now uses unencoded square brackets
[]and comma,in the query parameters rather than percent-encoded equivalents. This change is consistent with similar modifications across the codebase.In Ruby, this change has additional implications:
- Ruby's
URIclass may behave differently with unencoded square brackets- Ruby web frameworks like Rails have special parsing for parameters with square brackets, interpreting them as nested parameters
🏁 Script executed:
#!/bin/bash # Check how Ruby's URI class handles unencoded square brackets ruby -ruri -e 'url = URI("http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value"); puts "Original: #{url}"; puts "Escaped: #{URI.escape(url.to_s)}"'Length of output: 560
Attention: Verify URL Encoding Behavior in Ruby
The changes in
src/targets/ruby/native/fixtures/nested.rbare intentional and consistent with similar modifications across the codebase—the URL now includes unencoded square brackets ([]) and commas (,) in its query parameters. Note that:
- The URL is defined as:
url = URI("http://mockbin.com/har?foo[bar]=baz,zap&fiz=buz&key=value")- When processed by Ruby’s
URIclass, the input URL remains unchanged. Our verification script shows the original URL prints without any encoding.- An attempted use of
URI.escaperesulted in a NoMethodError because that method has been removed in recent Ruby versions.- Additionally, be aware that frameworks like Rails interpret query parameters with square brackets as nested parameters, which could affect parameter parsing downstream.
Please manually verify that this behavior aligns with the expected functionality in your specific Ruby/Rails environment.
src/targets/shell/wget/fixtures/nested.sh (1)
4-4: URL encoding changed to use literal characters instead of percent-encoded values.The URL now uses literal square brackets
[and]and a comma instead of their percent-encoded equivalents (%5B,%5D, and%2C). While this makes the URL more readable, be aware that according to RFC 3986, square brackets are reserved characters in URLs and should typically be percent-encoded.This change appears to be part of a consistent pattern across multiple files, suggesting an intentional modification to how URLs are represented. Please ensure this aligns with your server's expectations, as some servers might interpret unencoded square brackets differently than their encoded equivalents.
src/targets/csharp/httpclient/fixtures/nested.cs (1)
6-6: URL encoding changed to use literal characters instead of percent-encoded values.The URI now uses literal square brackets
[and]and a comma instead of their percent-encoded equivalents (%5B,%5D, and%2C). Note that theUriclass in C# might re-encode these characters when the request is sent, depending on which characters it considers reserved.This change is consistent with modifications in other files. Verify that the HttpClient properly handles these characters as intended when making the request.
src/targets/c/libcurl/fixtures/nested.c (1)
4-4: URL encoding changed to use literal characters instead of percent-encoded values.The URL passed to
curl_easy_setoptnow uses literal square brackets[and]and a comma instead of their percent-encoded equivalents (%5B,%5D, and%2C). libcurl's behavior with these unencoded characters will depend on its configuration.This change is consistent with modifications in other files. Verify that the libcurl properly handles these characters when making the request and that the server interprets them as expected.
src/targets/powershell/webrequest/fixtures/nested.ps1 (1)
1-1: URL encoding changed to use literal characters instead of percent-encoded values.The URI now uses literal square brackets
[and]and a comma instead of their percent-encoded equivalents (%5B,%5D, and%2C). PowerShell'sInvoke-WebRequestcmdlet may handle these characters differently depending on the PowerShell version.This change is consistent with modifications in other files. Ensure that PowerShell properly sends the request with these characters as intended and that the server interprets them correctly.
src/targets/objc/nsurlsession/fixtures/nested.m (1)
3-3: URL Decoding Update in Objective-C FixtureThe URL string has been updated to use literal square brackets in the query parameter instead of percent-encoded values. This change is consistent with similar modifications elsewhere in the repository. Please verify that the target server accepts these literal characters and that no unintended side effects occur with URL parsing.
src/targets/node/fetch/fixtures/nested.js (1)
3-3: URL Decoding Update in Node.js FixtureThe URL now directly includes literal square brackets for the query parameter, aligning it with changes implemented across other language targets. Ensure that the node-fetch library and the backend correctly interpret these unencoded characters in your GET request processing.
src/targets/swift/nsurlsession/fixtures/nested.swift (1)
3-3: Literal Square Brackets in Swift Fixture URLThe URL in this Swift fixture now contains literal square brackets in the query parameter rather than their percent-encoded counterparts. This update is in line with the overall approach seen in similar files. Additionally, consider whether force-unwrapping via
!is acceptable in this context (fixture code) or if safer unwrapping should be adopted in production code..editorconfig (1)
9-10: Consider maintaining standard whitespace practices.The changes to turn off
trim_trailing_whitespaceandinsert_final_newlinedeviate from common development practices. Not having a final newline can cause issues with certain tools, and preserving trailing whitespace may lead to unnecessary diff changes during collaboration.Would you like to know more about the benefits of these standard practices?
package.json (2)
64-65: LGTM: Development script improvements.The addition of
devandtest:watchscripts improves the development workflow by enabling continuous compilation and testing.
2-2:Details
❓ Verification inconclusive
Version downgrade from 3.0.9 to 3.0.7.
Downgrading the version number is unusual and may cause issues for users who were already using version 3.0.9. Consider maintaining semantic versioning best practices.
🌐 Web query:
What are the implications of downgrading an NPM package version number?💡 Result:
Downgrading an NPM package version can have significant technical and operational implications, particularly in dependency management, security, and compatibility. Below are the key considerations:
1. Compatibility Risks
- Dependency Conflicts: Downgrading a package may create incompatibilities with other dependencies that rely on newer versions of the same package[3][12]. For example, if Package A depends on
lodash@^4.0.0and is downgraded tolodash@3.0.0, downstream packages expecting modern methods may fail[6][9].- Peer Dependencies: Downgrades of peer dependencies (e.g., React) often require dependent packages to adjust their own versions, potentially cascading into breaking changes[4][12].
- Toolchain Issues: Older package versions may lack support for newer Node.js or npm features, causing build failures or runtime errors[1][8].
2. Security Vulnerabilities
- Exposure to Known Risks: Older versions may reintroduce security flaws patched in later releases. For example, downgrading
expressfrom5.xto4.xcould expose the project to vulnerabilities resolved in v5[1][7].- Audit Failures: Tools like
npm auditflag outdated packages, potentially blocking CI/CD pipelines or requiring overrides[7].
3. Loss of Features and Bug Fixes
- Regression of Fixes: Downgrading forfeits bug fixes introduced in newer versions. For instance, reverting
webpackfrom5.75.0to5.74.0might reintroduce a critical bundling bug resolved in the later version[3][10].- Feature Unavailability: Functionality added in minor/patch updates (e.g., performance improvements or API expansions) becomes inaccessible[4].
4. Impact on Semantic Versioning
- Version Locking: Downgrades often lead to stricter version pinning (e.g., replacing
^2.1.0with2.0.0), reducing flexibility for future updates[3][12].- Semver Violations: If a downgrade crosses a major version boundary (e.g.,
3.0.0→2.1.0), it may violate semantic versioning rules, requiring major version increments in dependent packages[4][12].
5. Dependency Resolution Challenges
- npm Update Behavior: npm prioritizes satisfying version ranges across dependencies. Downgrades may force npm to install older sub-dependencies, creating complex resolution trees[6][9].
- Global Installs: Downgrading global packages (e.g.,
npm install -g npm@6) can delete unrelated global modules if not handled carefully[13].
When to Downgrade
- Reactive Scenarios: Address critical bugs or incompatibilities introduced by a new version[3][8].
- Preventive Measures: Avoid anticipated issues in upcoming releases (e.g., unstable beta features)[3].
Best Practices
- Test Downgrades Locally: Use tools like
nvmto isolate Node.js environments[2][8].- Audit Dependencies: Run
npm auditand check release notes for downgrade impacts[7][10].- Pin Versions Conservatively: Specify exact versions (e.g.,
1.2.3) or narrow ranges (e.g.,~1.2.0) inpackage.json[9][12].- Document Rationale: Track downgrade reasons in commit messages or project docs to aid future maintenance[3].
Dowgrading should be a deliberate decision, balancing immediate stability needs against long-term technical debt. Always validate downgrades in a staging environment and monitor for unintended side effects.
Citations:
- 1: https://www.squash.io/how-to-downgrade-npm-to-a-specific-version/
- 2: https://visionx.io/blog/check-and-change-node-version/
- 3: https://sail.cs.queensu.ca/data/pdfs/TSE2019_AnEmpiricalStudyOfDependencyDowngradesInTheNpmEcosystem.pdf
- 4: https://8hob.io/posts/semantic-versioning-npm-packages-after-dependency-update/
- 5: https://hackernoon.com/best-way-to-install-node-and-keep-it-up-to-date
- 6: https://docs.npmjs.com/cli/v8/commands/npm-update
- 7: https://docs.npmjs.com/cli/v9/commands/npm-audit/
- 8: https://refine.dev/blog/change-node-version/
- 9: https://dev.to/typescripttv/understanding-npm-versioning-3hn4
- 10: https://www.mend.io/blog/npm-how-to-install-a-specific-version-of-node-js-package/
- 11: https://www.casaflora.ca/Trending/downgrade-node-version
- 12: https://docs.npmjs.com/about-semantic-versioning/
- 13: npm/cli#3671
Attention: Confirm Version Downgrade Intent
The change in
package.json(Line 2) downgrades the version from 3.0.9 to 3.0.7. Downgrading may introduce several risks:
- Dependency Issues: Users or dependent packages expecting fixes or features from 3.0.9 might face compatibility conflicts.
- Security Vulnerabilities: Older versions could reintroduce bugs or security flaws patched in later releases.
- Loss of Improvements: Any bug fixes or enhancements in 3.0.9 will be lost.
Please ensure this downgrade is intentional and that its rationale is clearly documented. Verify its impact on dependency management and user experience before finalizing.
src/httpsnippet.ts (1)
315-321:Details
✅ Verification successful
Improved URL handling with decoding.
Decoding the URL before returning it improves readability by converting percent-encoded characters (like %20) to their literal forms (like spaces), which is likely a better user experience.
However, verify this change doesn't introduce issues with URL handling in downstream components that might expect URLs in their encoded form.
🏁 Script executed:
#!/bin/bash # Check if there are any dependencies on fullUrl being in encoded format rg -A 3 -B 3 "fullUrl" --glob="!src/httpsnippet.ts" --glob="*.ts" --glob="*.js"Length of output: 26672
URL Decoding Implementation Verified
The investigation confirms that decoding the URL in
src/httpsnippet.ts(lines 315–321) improves readability without breaking downstream usage. A grep search revealed that downstream components and tests (e.g., insrc/httpsnippet.test.tsand various client converters) expect the URL to be in its decoded form or are properly quoting it for command generation. No dependency was found that requires the URL to remain percent-encoded.
- The test in
src/httpsnippet.test.tsexpects the decoded URL.- Various target conversion modules simply pass
fullUrlto helper functions (such asquote) that handle the string correctly.- No conflicting usages were identified in other parts of the repository.
.github/workflows/hopp-publish.yml (1)
26-28: Ensure NPM_PUBLISH_ACCESS_TOKEN secret is configured.The workflow uses
NPM_PUBLISH_ACCESS_TOKENfor npm authentication. Verify this secret is configured in the repository settings before creating a release.
| ], | ||
| "engines": { | ||
| "node": "^14.19.1 || ^16.14.2 || ^18.0.0 || ^20.0.0" | ||
| "node": "^14.19.1 || ^16.14.2 || ^18.0.0 " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent Node.js version requirements.
The package.json removes support for Node.js 20, but the new GitHub workflow uses Node 20 for publishing. This inconsistency could lead to build issues.
- "node": "^14.19.1 || ^16.14.2 || ^18.0.0 "
+ "node": "^14.19.1 || ^16.14.2 || ^18.0.0 || ^20.0.0"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "node": "^14.19.1 || ^16.14.2 || ^18.0.0 " | |
| "node": "^14.19.1 || ^16.14.2 || ^18.0.0 || ^20.0.0" |
| "name": "@hoppscotch/httpsnippet", | ||
| "description": "HTTP Request snippet generator for *most* languages", | ||
| "author": "Kong <office@konghq.com>", | ||
| "homepage": "https://github.com/Kong/httpsnippet", | ||
| "author": "Hoppscotch Team <support@hoppscotch.io>", | ||
| "homepage": "https://github.com/Hoppscotch/httpsnippet", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Package rebranding from Kong to Hoppscotch.
The package has been rebranded from Kong to Hoppscotch, including package name, author, homepage, repository, and bugs URL. Ensure that all other references to Kong throughout the codebase are also updated for consistency.
Also applies to: 46-48
🏁 Script executed:
#!/bin/bash
# Search for any remaining references to Kong in the codebase
rg -i "kong" --glob="!.git/*" --glob="!node_modules/*" --glob="!package.json"Length of output: 2384
Action Required: Update remaining "Kong" references to "Hoppscotch" across the codebase.
The rebranding in package.json is correctly updated, but several files still contain "Kong." In particular:
-
src/httpsnippet.test.ts
- Update string literals such as
"Kong-Admin-Token"to reflect the new naming (e.g.,"Hoppscotch-Admin-Token") if applicable.
- Update string literals such as
-
SECURITY.md
- Revise vulnerability contact details and links that reference Kong.
-
README.md and CONTRIBUTING.MD
- Replace references in badges, repository URLs, and guidelines.
-
LICENSE
- Confirm that company attribution is updated if required by the rebranding.
Also, ensure similar changes for any lines (like the noted 46-48) that refer to Kong. Please review and update these occurrences for consistency.
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update GitHub Actions checkout version.
The checkout action version is outdated. GitHub recommends using the latest versions of actions for better compatibility and security.
- uses: actions/checkout@v3
+ uses: actions/checkout@v4📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| uses: actions/checkout@v3 | |
| uses: actions/checkout@v4 |
🧰 Tools
🪛 actionlint (1.7.4)
13-13: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
| node-version: 20 | ||
| cache: 'npm' | ||
| registry-url: "https://registry.npmjs.org" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify Node.js compatibility with package requirements.
The workflow uses Node.js 20, but the package.json's engines field excludes Node.js 20. Ensure these are aligned to avoid build issues.
Either update the package.json engines field to include Node.js 20 (as mentioned in my previous comment) or update this workflow to use a supported Node.js version.
Below is a shell script you can run to inspect the Node.js version (the "engines" field) specified in your package.json file. This will help verify whether there’s a mismatch with the workflow’s usage of Node.js 20:
Action Required: Align Node.js Versions
- The workflow file (.github/workflows/hopp-publish.yml, lines 18–20) sets
node-version: 20. - According to the review comment, the package.json’s engines field does not include Node.js 20.
- Please verify the output of the above script. Then either update package.json’s engines field to include Node.js 20 or adjust the workflow to use a Node.js version that is supported by your package.
🏁 Script executed:
#!/bin/bash
# Check if package.json exists and display its "engines" field.
if [ -f package.json ]; then
echo "package.json found. Current Node.js engine specification:"
jq '.engines' package.json || echo "Unable to parse the engines field."
else
echo "package.json not found in the repository root."
fiLength of output: 226
Action Required: Align Node.js Versions
The workflow at .github/workflows/hopp-publish.yml (lines 18–20) currently specifies node-version: 20, but your package.json’s engines field supports only Node.js versions ^14.19.1 || ^16.14.2 || ^18.0.0. This version mismatch could lead to build issues.
- Option 1: Update the package.json engines field to include Node.js 20 if you intend to use it.
- Option 2: Modify the workflow to use a Node.js version supported by your package.json.
…ed (#5) * fix : invalid query string when duplicate query param keys are provided * added relevant test cases
User description
Notes for Reviewers
This PR fixes #
Signed commits
PR Type
Enhancement, Bug fix, Documentation, Tests
Description
Added decoding of full URLs in
HTTPSnippetclass.Updated test fixtures to use decoded URLs across multiple languages.
Introduced CI pipeline for publishing to npm on release.
Enhanced contributing guidelines and updated project metadata.
Changes walkthrough 📝
2 files
Decode full URLs in HTTPSnippet classAdd CI pipeline for npm publishing25 files
Update test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URLUpdate test fixture with decoded URL1 files
Update editorconfig settings for trailing whitespace2 files
Expand contributing guidelinesRemove redundant security reporting instructions2 files
Update package metadata and dependenciesUpdate package metadata and scriptsSummary by CodeRabbit
Documentation
Refactor
Chores