From 92fd3dbce6bf05ea94b78495ff41d322db5f3a9c Mon Sep 17 00:00:00 2001 From: Michael Blum Date: Wed, 3 Dec 2025 09:41:24 +0100 Subject: [PATCH 1/4] feat(API): add pr_branch param to repo-sync export #SCD-594 --- doc/compiled.json | 17 +++++++++++++++-- parameters.yaml | 8 ++++++++ paths/repo_syncs/export.yaml | 4 +++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/doc/compiled.json b/doc/compiled.json index 7b3dc8091..9891e3c93 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -4886,6 +4886,16 @@ }, "example": "my-feature-branch" }, + "pr_branch": { + "name": "pr_branch", + "in": "query", + "description": "Source branch to open a pull request from", + "required": false, + "schema": { + "type": "string" + }, + "example": "my-feature-branch" + }, "page": { "in": "query", "name": "page", @@ -22603,6 +22613,9 @@ }, { "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/pr_branch" } ], "responses": { @@ -22640,11 +22653,11 @@ "x-code-samples": [ { "lang": "Curl", - "source": "curl \"https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/export\"\\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -H 'Content-Type: application/json'" + "source": "curl \"https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/export?pr_branch=my-feature-branch\"\\\n -u USERNAME_OR_ACCESS_TOKEN \\\n -X POST \\\n -H 'Content-Type: application/json'" }, { "lang": "CLI v2", - "source": "phrase repo_syncs export \\\n--id \\\n--access_token " + "source": "phrase repo_syncs export \\\n--id \\\n--pr_branch my-feature-branch \\\n--access_token " } ], "x-cli-version": "2.24" diff --git a/parameters.yaml b/parameters.yaml index c9cf0eed6..2fd4dbb3e 100644 --- a/parameters.yaml +++ b/parameters.yaml @@ -214,6 +214,14 @@ branch: schema: type: string example: my-feature-branch +pr_branch: + name: pr_branch + in: query + description: Source branch to open a pull request from + required: false + schema: + type: string + example: my-feature-branch page: in: query name: page diff --git a/paths/repo_syncs/export.yaml b/paths/repo_syncs/export.yaml index 18be769c6..b9d6493b3 100644 --- a/paths/repo_syncs/export.yaml +++ b/paths/repo_syncs/export.yaml @@ -12,6 +12,7 @@ parameters: - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" - "$ref": "../../parameters.yaml#/account_id" - "$ref": "../../parameters.yaml#/id" +- "$ref": "../../parameters.yaml#/pr_branch" responses: '200': description: OK @@ -35,7 +36,7 @@ responses: x-code-samples: - lang: Curl source: |- - curl "https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/export"\ + curl "https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/45ef6789/export?pr_branch=my-feature-branch"\ -u USERNAME_OR_ACCESS_TOKEN \ -X POST \ -H 'Content-Type: application/json' @@ -43,5 +44,6 @@ x-code-samples: source: |- phrase repo_syncs export \ --id \ + --pr_branch my-feature-branch \ --access_token x-cli-version: '2.24' From 23afc7ee15b3dffa8e201f5365b38dab304d7f1a Mon Sep 17 00:00:00 2001 From: Sven Dunemann Date: Thu, 11 Dec 2025 13:42:20 +0100 Subject: [PATCH 2/4] Use more descriptive wording --- doc/compiled.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/compiled.json b/doc/compiled.json index 9891e3c93..725694ae3 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -4889,7 +4889,7 @@ "pr_branch": { "name": "pr_branch", "in": "query", - "description": "Source branch to open a pull request from", + "description": "Branch name for the pull request. If left empty, a branch will be created with the default value", "required": false, "schema": { "type": "string" From c3a535fe6e27badee9456848080a25aa6ba57165 Mon Sep 17 00:00:00 2001 From: Sven Dunemann Date: Thu, 11 Dec 2025 13:42:36 +0100 Subject: [PATCH 3/4] Use different description --- parameters.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parameters.yaml b/parameters.yaml index 2fd4dbb3e..a82f9cf93 100644 --- a/parameters.yaml +++ b/parameters.yaml @@ -217,7 +217,7 @@ branch: pr_branch: name: pr_branch in: query - description: Source branch to open a pull request from + description: Branch name for the pull request required: false schema: type: string From d3861e55af30cc4c189c8e19a6a9b1c56a638290 Mon Sep 17 00:00:00 2001 From: Sven Dunemann Date: Thu, 11 Dec 2025 13:51:24 +0100 Subject: [PATCH 4/4] apply changes --- clients/cli/go.sum | 4 ++-- doc/compiled.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clients/cli/go.sum b/clients/cli/go.sum index f41e9ed55..134300952 100644 --- a/clients/cli/go.sum +++ b/clients/cli/go.sum @@ -215,8 +215,8 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/phrase/phrase-go/v4 v4.9.0 h1:V+MWmNrxwrYNtmoY41dgrdWT902Er2hcohtQcpVvWmw= -github.com/phrase/phrase-go/v4 v4.9.0/go.mod h1:4XplKvrbHS2LDaXfFp9xrVDtO5xk2WHFm0htutwwd8c= +github.com/phrase/phrase-go/v4 v4.15.0 h1:wKgYcItOMSD4Z8UjnTz1IWlDhCDYQY2QbsQfW+c20v8= +github.com/phrase/phrase-go/v4 v4.15.0/go.mod h1:4XplKvrbHS2LDaXfFp9xrVDtO5xk2WHFm0htutwwd8c= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/doc/compiled.json b/doc/compiled.json index 725694ae3..6d116e341 100644 --- a/doc/compiled.json +++ b/doc/compiled.json @@ -4889,7 +4889,7 @@ "pr_branch": { "name": "pr_branch", "in": "query", - "description": "Branch name for the pull request. If left empty, a branch will be created with the default value", + "description": "Branch name for the pull request", "required": false, "schema": { "type": "string"