feat: support pipeline_branch param to load pipeline YAML from a specific git branch#200
Merged
thisrohangupta merged 4 commits intoMay 15, 2026
Conversation
Passing pipelineBranchName to harness_execute was silently ignored because it wasn't in the queryParams map — it landed in the YAML body where Harness ignores it. Adding pipeline_branch: "pipelineBranchName" to the execute action's queryParams ensures it is sent as ?pipelineBranchName= on the API URL, which is the only way the Harness pipeline execute endpoint respects it. Also updates actionDescription and bodySchema.fields to document the new param so agents and users can discover it via harness_describe. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…am mapping Verifies that passing pipeline_branch to dispatchExecute sends ?pipelineBranchName= on the API URL, and that omitting it leaves the param absent (Harness falls back to the pipeline's default branch). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
… tool handler
The registry-level test (dispatchExecute directly) already covered the
queryParams mapping. This test covers the full tool handler path:
params={pipeline_branch} → Object.assign into input → dispatchExecute
→ ?pipelineBranchName= on the POST request.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…-param cases Adds two registry-level tests: - empty string pipeline_branch is correctly omitted from query params (guards the value !== "" filter in registry/index.ts:646) - pipeline_branch + inputs.branch coexist: pipelineBranchName lands in the URL query string while inputs.branch expands into the body build structure independently Adds one tool-handler-level test: - pipeline_branch coexists with module param without either being dropped (tests the multi-key Object.assign path through the execute handler) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
thisrohangupta
approved these changes
May 15, 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.
Description
Adds support for specifying which git branch to load the pipeline YAML from when executing a pipeline via MCP.
Problem
Passing
pipelineBranchNametoharness_executewas silently ignored. ThequeryParamsmap for the pipelinerunaction had no entry for it, so the value was placed in the YAML request body where Harness ignores it. Harness only readspipelineBranchNameas a URL query parameter.Fix
Added
pipeline_branch: "pipelineBranchName"to thequeryParamsmapping insrc/registry/toolsets/pipelines.ts. UpdatedactionDescriptionandbodySchema.fieldsso the param is discoverable viaharness_describe.Usage
When
pipeline_branchis omitted,?pipelineBranchName=is not sent and Harness falls back to the pipeline's configured default branch.Tests
6 new tests covering the fix:
pipeline execute sends pipeline_branch as ?pipelineBranchName= query paramtests/registry/registry.test.tspipeline execute omits pipelineBranchName when pipeline_branch not providedtests/registry/registry.test.tspipeline execute omits pipelineBranchName when pipeline_branch is empty stringtests/registry/registry.test.tsvalue !== ""filter)pipeline execute sends both pipeline_branch and inputs.branch independentlytests/registry/registry.test.tspipelineBranchNamegoes to URL query string;inputs.branchexpands into body build structure — no interferencepasses pipeline_branch from params as ?pipelineBranchName= query paramtests/tools/tool-handlers.test.tspipeline_branch coexists with other params without clobberingtests/tools/tool-handlers.test.tspipeline_branch+moduleboth arrive on the POSTType of Change
Checklist