(CDPE-4754) Migrate create_git_branch to V1 endpoint#75
Merged
Conversation
c007ee1 to
2d6c76f
Compare
Ruby client now POSTs to /api/v1/deployments/{id}:create-git-branch with
workspaceId as a query param. Puppet function handles 204 No Content and
maps V1 error bodies (which carry message/traceId/uriPath rather than the
legacy {error: {message, code}} shape) into the function-result format
the Bolt plans already consume.
Also fixes a pre-existing missing comma in the Net::HTTPServerError raise.
The corresponding V1 endpoint in PipelinesInfra is added in CDPE-4754
PR (puppetlabs/PipelinesInfra). Until that lands, this client method
will return 404. Ship them together.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Stubs the new V1 path with workspaceId query param. Asserts the V1
return shape: 204 maps to {'result' => 'success'}, 4xx maps the V1
error body's message to the function-result error shape, and 5xx
raises Puppet::Error.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2d6c76f to
8c6bc9c
Compare
Contributor
Author
|
Manually tested this using the local checkout of |
eputnam
approved these changes
Jun 5, 2026
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.
Summary
cd4pe_deployments::create_git_branchto call the new V1 endpointPOST /v1/deployments/{id}:create-git-branchinstead of the legacy AJAXop=CreateGitBranch.BaseErrorV1shape:{message, traceId, uriPath}) into the existing function-result error format consumed by Bolt plans.Net::HTTPServerErrorraise.Dependency
This depends on the matching PipelinesInfra change that adds the V1 endpoint. Ship them together — until the PipelinesInfra side lands, this client will get 404s.
PipelinesInfra PR: https://github.com/puppetlabs/PipelinesInfra/pull/5155
Test plan
bundle exec rspec spec/functions/cd4pe/create_git_branch_spec.rb— 5 examples, 0 failures🤖 Generated with Claude Code