Skip to content

Commit

Permalink
Merge pull request #701 from postmanlabs/release/v1.7.2
Browse files Browse the repository at this point in the history
Release version v1.7.2
  • Loading branch information
VShingala authored May 4, 2023
2 parents 2e8e260 + 6168e6e commit b92309f
Show file tree
Hide file tree
Showing 31 changed files with 774 additions and 121 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/draft-new-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Draft new release

on:
workflow_dispatch:
inputs:
version:
description: The version you want to release. Must be a valid semver version.
required: true
type: string

jobs:
draft-new-release:
if: startsWith(github.event.inputs.version, 'v')
name: Draft a new release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Create release branch
run: git checkout -b release/${{ github.event.inputs.version }}

- name: Update changelog
uses: thomaseizinger/[email protected]
with:
version: ${{ github.event.inputs.version }}

- name: Initialize mandatory git config
run: |
git config user.name "GitHub Actions"
git config user.email [email protected]
- name: Bump version
run: npm version ${{ github.event.inputs.version }} --git-tag-version false

- name: Commit changelog and manifest files
id: make-commit
run: |
git add CHANGELOG.md package.json package-lock.json
git commit --message "Prepare release ${{ github.event.inputs.version }}"
echo "::set-output name=commit::$(git rev-parse HEAD)"
- name: Push new branch
run: git push origin release/${{ github.event.inputs.version }}

- name: Create pull request for master
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
head: release/${{ github.event.inputs.version }}
base: master
title: "Release version ${{ github.event.inputs.version }}"
reviewers: ${{ github.actor }}
body: |
Hi @${{ github.actor }}!
This PR was created in response to a manual trigger of the release workflow here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}.
I've updated the changelog and bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }}.
- name: Create pull request for develop
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
head: release/${{ github.event.inputs.version }}
base: develop
title: "Release version ${{ github.event.inputs.version }}"
reviewers: ${{ github.actor }}
body: |
Hi @${{ github.actor }}!
This PR was created in response to a manual trigger of the release workflow here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}.
I've updated the changelog and bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }}.
46 changes: 46 additions & 0 deletions .github/workflows/publish-new-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Publish new release"

on:
pull_request:
branches:
- master
types:
- closed

jobs:
release:
name: Publish new release
runs-on: ubuntu-latest
# only merged pull requests that begin with 'release/' or 'hotfix/' must trigger this job
if: github.event.pull_request.merged == true &&
(contains(github.event.pull_request.head.ref, 'release/') || contains(github.event.pull_request.head.ref, 'hotfix/'))
permissions:
contents: write

steps:
- name: Extract version from branch name (for release branches)
if: contains(github.event.pull_request.head.ref, 'release/')
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#release/}
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
- name: Extract version from branch name (for hotfix branches)
if: contains(github.event.pull_request.head.ref, 'hotfix/')
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#hotfix/}
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
- name: Create Release
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
target_commitish: ${{ github.event.pull_request.merge_commit_sha }}
tag_name: ${{ env.RELEASE_VERSION }}
name: ${{ env.RELEASE_VERSION }}
draft: false
prerelease: false
File renamed without changes.
170 changes: 105 additions & 65 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,103 +1,143 @@
v1.7.1 (March 29, 2023)
* Minor fix - Add language labels for Rust and Kotlin
# Postman Code Generators Changelog

## [Unreleased]

## [v1.7.2] - 2023-05-04

### Fixed

- Fix for - [#11934](https://github.com/postmanlabs/postman-app-support/issues/11934) Prevent `%` double encoding in query params

## [v1.7.1] - 2023-03-29

- Minor fix - Add language labels for Rust and Kotlin

## Previous Releases

Newer releases follow the [Keep a Changelog](https://keepachangelog.com) format.

v1.7.0 (March 28, 2023)
* Fix for - [#192](https://github.com/postmanlabs/postman-code-generators/issues/192) Added support for Rust reqwest code snippets.

- Fix for - [#192](https://github.com/postmanlabs/postman-code-generators/issues/192) Added support for Rust reqwest code snippets.

v1.6.1 (March 27, 2023)
* Fix backlashes being unescaped unnecessarily in cURL codegen

- Fix backlashes being unescaped unnecessarily in cURL codegen

v1.6.0 (March 17, 2023)
* PEP8 improvements in python-requests code
* Fix for - [#491](https://github.com/postmanlabs/postman-code-generators/issues/491) Added support for kotlin okhttp code snippets.
* Refactored code for nodejs-axios util.js.

- PEP8 improvements in python-requests code
- Fix for - [#491](https://github.com/postmanlabs/postman-code-generators/issues/491) Added support for kotlin okhttp code snippets.
- Refactored code for nodejs-axios util.js.

v1.5.1 (March 28, 2023)
* Fix backlashes being escaped unnecessarily in cURL codegen

- Fix backlashes being escaped unnecessarily in cURL codegen

v1.5.0 (March 2, 2023)
* Change minimum supported NodeJS version to 12
* Fix for - [#11049](https://github.com/postmanlabs/postman-app-support/issues/11049) Escape backslash character in raw bodies for curl codegen
* Fix for - [#302](https://github.com/postmanlabs/postman-code-generators/issues/302) Add option to use async/await in NodeJS Axios codegen
* Fix for - [#322](https://github.com/postmanlabs/postman-code-generators/issues/322) Use multiline quotes in Powershell to simplify generated code
* Add long form option for -g flag in curl codegen
* Minor Swift codegen improvements

- Change minimum supported NodeJS version to 12
- Fix for - [#11049](https://github.com/postmanlabs/postman-app-support/issues/11049) Escape backslash character in raw bodies for curl codegen
- Fix for - [#302](https://github.com/postmanlabs/postman-code-generators/issues/302) Add option to use async/await in NodeJS Axios codegen
- Fix for - [#322](https://github.com/postmanlabs/postman-code-generators/issues/322) Use multiline quotes in Powershell to simplify generated code
- Add long form option for -g flag in curl codegen
- Minor Swift codegen improvements

v1.4.1 (February 22, 2023)
* cURL codegen should work when request has a protocolProfileBehavior with null value

- cURL codegen should work when request has a protocolProfileBehavior with null value

v1.4.0 (February 6, 2023)
* Add support for C# HttpClient Codegen
* Fix for - [#9511](https://github.com/postmanlabs/postman-app-support/issues/9511) - Use short options in CURL as long as possible
* Fix for - [#10581](https://github.com/postmanlabs/postman-app-support/issues/10581) - Do not add HTTP method explicitly in CURL when not required
* Fix for - [#10053](https://github.com/postmanlabs/postman-app-support/issues/10053) - Remove usage of semaphore from Swift Codegen

- Add support for C# HttpClient Codegen
- Fix for - [#9511](https://github.com/postmanlabs/postman-app-support/issues/9511) - Use short options in CURL as long as possible
- Fix for - [#10581](https://github.com/postmanlabs/postman-app-support/issues/10581) - Do not add HTTP method explicitly in CURL when not required
- Fix for - [#10053](https://github.com/postmanlabs/postman-app-support/issues/10053) - Remove usage of semaphore from Swift Codegen

v1.3.0 (December 16, 2022)
* Update C# restsharp codegen to support [107](https://restsharp.dev/v107/)
* Fix for - [#11084](https://github.com/postmanlabs/postman-app-support/issues/11084) Fixes an issue where HTTP code snippet was generating wrong boundaries
* Fixes an issue with Axios code snippets not including maxBodyLength param

- Update C# restsharp codegen to support [107](https://restsharp.dev/v107/)
- Fix for - [#11084](https://github.com/postmanlabs/postman-app-support/issues/11084) Fixes an issue where HTTP code snippet was generating wrong boundaries
- Fixes an issue with Axios code snippets not including maxBodyLength param

v1.2.1 (April 26, 2022)
* Add label for 'R' language

- Add label for 'R' language

v1.2.0 (April 22, 2022)
* Add new codegens - php-guzzle, R-httr, R-rcurl
* Fix issue with pipeline failing due to updated version of RestSharp
* Fix for - [#502](https://github.com/postmanlabs/postman-code-generators/issues/502) Allow GET method to have a body in java-okhttp if present in input request
* Fix for - [#476](https://github.com/postmanlabs/postman-code-generators/pull/476) Properly escape already escaped double quotes in curl body

- Add new codegens - php-guzzle, R-httr, R-rcurl
- Fix issue with pipeline failing due to updated version of RestSharp
- Fix for - [#502](https://github.com/postmanlabs/postman-code-generators/issues/502) Allow GET method to have a body in java-okhttp if present in input request
- Fix for - [#476](https://github.com/postmanlabs/postman-code-generators/pull/476) Properly escape already escaped double quotes in curl body

v1.1.5 (May 10, 2021)
* Fixed an issue with how JSON bodies are shown in code snippets for Ruby, C#, and Dart.

- Fixed an issue with how JSON bodies are shown in code snippets for Ruby, C#, and Dart.

v1.1.4 (May 6, 2021)
* Fix an issue with empty GraphQL body

- Fix an issue with empty GraphQL body

v1.1.3 (Mar 2, 2021)
* Use proper indentation for JSON bodies in Javascript and Nodejs codegens
* Fix for - [#445](https://github.com/postmanlabs/postman-code-generators/issues/445) Add proper indentation in nodejs-axios when bodytype is urlencoded
* Fix for - [#248](https://github.com/postmanlabs/postman-code-generators/issues/248) Use quoteType everywhere in curl, not just in the url
* Fix for - [#454](https://github.com/postmanlabs/postman-code-generators/issues/454) Fix encoding when generating HTTP code snippets
* Fix for - [#426](https://github.com/postmanlabs/postman-code-generators/issues/426) Use json.dumps in Python codegens if Content-Type is JSON

- Use proper indentation for JSON bodies in Javascript and Nodejs codegens
- Fix for - [#445](https://github.com/postmanlabs/postman-code-generators/issues/445) Add proper indentation in nodejs-axios when bodytype is urlencoded
- Fix for - [#248](https://github.com/postmanlabs/postman-code-generators/issues/248) Use quoteType everywhere in curl, not just in the url
- Fix for - [#454](https://github.com/postmanlabs/postman-code-generators/issues/454) Fix encoding when generating HTTP code snippets
- Fix for - [#426](https://github.com/postmanlabs/postman-code-generators/issues/426) Use json.dumps in Python codegens if Content-Type is JSON

v1.1.2 (Dec 15, 2020)
* Fix for - [#8736](https://github.com/postmanlabs/postman-app-support/issues/8736) Add content type support for individual form-data fields
* Fix for - [#8635](https://github.com/postmanlabs/postman-app-support/issues/8635) Use Json.parse for all json like application types
* Fix for - [#9212](https://github.com/postmanlabs/postman-app-support/issues/9212) Add semicolon after header key in curl codegen if the value is empty string.
* Add Newman test for powershell

- Fix for - [#8736](https://github.com/postmanlabs/postman-app-support/issues/8736) Add content type support for individual form-data fields
- Fix for - [#8635](https://github.com/postmanlabs/postman-app-support/issues/8635) Use Json.parse for all json like application types
- Fix for - [#9212](https://github.com/postmanlabs/postman-app-support/issues/9212) Add semicolon after header key in curl codegen if the value is empty string.
- Add Newman test for powershell

v1.1.1 (Nov 10, 2020)
* Change string to enum in cURL quoteType option.
* Fix new line issue in dart-http and HTTP codegen
* Fix an issue where deepinstall was failing when folder name had spaces.

- Change string to enum in cURL quoteType option.
- Fix new line issue in dart-http and HTTP codegen
- Fix an issue where deepinstall was failing when folder name had spaces.

v1.1.0 (Nov 2, 2020)
* Added support for Dart http
* Fix for - [#315](https://github.com/postmanlabs/postman-code-generators/issues/315): Manually parse url provided in the request.
* Fix for - [#253](https://github.com/postmanlabs/postman-code-generators/issues/253): Add -g flag to curl if braces ({}) or brackets ([#]) are present in the url.
* Fix for - [#257](https://github.com/postmanlabs/postman-code-generators/issues/257): Use double quotes to escape semicolon in curl requests
* Fix for - [#247](https://github.com/postmanlabs/postman-code-generators/issues/247): Add ContentType to python snippets for multipart/formdata
* Fix for - [#186](https://github.com/postmanlabs/postman-code-generators/issues/186): Add ` as line continuation delimiter for curl codegen
* Fix for - [#248](https://github.com/postmanlabs/postman-code-generators/issues/248): Add quoteType as an additional option in curl codegen
* Fix deadlock in error case in Swift and Objective-C codegens.
* Fix for - [#325](https://github.com/postmanlabs/postman-code-generators/issues/325): Use encodeURIComponent instead of escape for urlencoded request body.
* Fix for - [#350](https://github.com/postmanlabs/postman-code-generators/issues/350): Sanitize \r in request body.
* Fix for - [#366](https://github.com/postmanlabs/postman-code-generators/issues/366): Add support for uploading binary files for multipart/form-data bodies in python-http.client.
* Fix for - [#353](https://github.com/postmanlabs/postman-code-generators/issues/353): Add optional import of FoundationNetworking in swift codegen
* Fix for - [#284](https://github.com/postmanlabs/postman-code-generators/issues/284): Replace double-quotes by single-quotes in codegen/php-curl
* Fix for - [#330](https://github.com/postmanlabs/postman-code-generators/issues/330): Use url.toString method for converting url in shell-httpie codegen

- Added support for Dart http
- Fix for - [#315](https://github.com/postmanlabs/postman-code-generators/issues/315): Manually parse url provided in the request.
- Fix for - [#253](https://github.com/postmanlabs/postman-code-generators/issues/253): Add -g flag to curl if braces ({}) or brackets ([#]) are present in the url.
- Fix for - [#257](https://github.com/postmanlabs/postman-code-generators/issues/257): Use double quotes to escape semicolon in curl requests
- Fix for - [#247](https://github.com/postmanlabs/postman-code-generators/issues/247): Add ContentType to python snippets for multipart/formdata
- Fix for - [#186](https://github.com/postmanlabs/postman-code-generators/issues/186): Add \` as line continuation delimiter for curl codegen
- Fix for - [#248](https://github.com/postmanlabs/postman-code-generators/issues/248): Add quoteType as an additional option in curl codegen
- Fix deadlock in error case in Swift and Objective-C codegens.
- Fix for - [#325](https://github.com/postmanlabs/postman-code-generators/issues/325): Use encodeURIComponent instead of escape for urlencoded request body.
- Fix for - [#350](https://github.com/postmanlabs/postman-code-generators/issues/350): Sanitize \\r in request body.
- Fix for - [#366](https://github.com/postmanlabs/postman-code-generators/issues/366): Add support for uploading binary files for multipart/form-data bodies in python-http.client.
- Fix for - [#353](https://github.com/postmanlabs/postman-code-generators/issues/353): Add optional import of FoundationNetworking in swift codegen
- Fix for - [#284](https://github.com/postmanlabs/postman-code-generators/issues/284): Replace double-quotes by single-quotes in codegen/php-curl
- Fix for - [#330](https://github.com/postmanlabs/postman-code-generators/issues/330): Use url.toString method for converting url in shell-httpie codegen

v1.0.2 (Oct 15, 2020)
* Fixed spaces around variables and arguments in Python codgen to comply with PEP 8.
* Added Content-Length header to generated HTTP snippets.
* Switched to multiline strings for Raw bodies in Go.
* Stopped manually encoding response bodes in `utf8` for Python-requests.
* Removed unnecessary semicolons at the end of statements in Ruby.
* Fixed wrong name of HTTP codegen in README

- Fixed spaces around variables and arguments in Python codgen to comply with PEP 8.
- Added Content-Length header to generated HTTP snippets.
- Switched to multiline strings for Raw bodies in Go.
- Stopped manually encoding response bodes in `utf8` for Python-requests.
- Removed unnecessary semicolons at the end of statements in Ruby.
- Fixed wrong name of HTTP codegen in README

v1.0.1 (Jun 29, 2020)
- Fix for - [#8674](https://github.com/postmanlabs/postman-app-support/issues/8674): Add URL sanitization for quotes in cURL, Java Unirest, NodeJS Native, Python http.client, and Swift.

- Fix for - [#8674](https://github.com/postmanlabs/postman-app-support/issues/8674): Add URL sanitization for quotes in cURL, Java Unirest, NodeJS Native, Python http.client, and Swift.

v1.0.0 (May 29, 2020)
- Add axios framework support
- Add ES6 syntax support for NodeJS Request, NodeJS Native and NodeJS Unirest
- Fix snippet generation for powershell and jquery, where form data params had no type field

- Add axios framework support
- Add ES6 syntax support for NodeJS Request, NodeJS Native and NodeJS Unirest
- Fix snippet generation for powershell and jquery, where form data params had no type field

[Unreleased]: https://github.com/postmanlabs/postman-code-generators/compare/v1.7.2...HEAD

[v1.7.2]: https://github.com/postmanlabs/postman-code-generators/compare/v1.7.1...v1.7.2

[v1.7.1]: https://github.com/postmanlabs/postman-code-generators/compare/v1.7.0...v1.7.1
3 changes: 2 additions & 1 deletion codegens/curl/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ var self = module.exports = {
},

/**
* Encode param except the following characters- [,{,},]
* Encode param except the following characters- [,{,},],%
*
* @param {String} param
* @returns {String}
Expand All @@ -218,6 +218,7 @@ var self = module.exports = {
.replace(/%7B/g, '{')
.replace(/%5D/g, ']')
.replace(/%7D/g, '}')
.replace(/%25/g, '%')
.replace(/'/g, '%27');
},

Expand Down
7 changes: 7 additions & 0 deletions codegens/curl/test/unit/convert.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,13 @@ describe('curl convert function', function () {
expect(outputUrlString).to.equal('https://postman-echo.com/get?key1={{value}}&key2=%27a%20b%20c%27');
});

it('should not encode query params that are already encoded', function () {
rawUrl = 'https://postman-echo.com/get?query=urn%3Ali%3Afoo%3A62324';
urlObject = new sdk.Url(rawUrl);
outputUrlString = getUrlStringfromUrlObject(urlObject);
expect(outputUrlString).to.equal('https://postman-echo.com/get?query=urn%3Ali%3Afoo%3A62324');
});

it('should discard disabled query params', function () {
urlObject = new sdk.Url({
protocol: 'https',
Expand Down
Loading

0 comments on commit b92309f

Please sign in to comment.