Skip to content

test: cover remote input set git context edge cases (PR #579)#580

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/missing-test-coverage-17a1
Draft

test: cover remote input set git context edge cases (PR #579)#580
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/missing-test-coverage-17a1

Conversation

@cursor

@cursor cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Description

Adds regression tests for the git-context forwarding fix in #579 (fix/execute-input-set-remote-git-context). The original PR covered the happy path; this PR closes gaps where silent wrong-branch resolution could still regress.

Risky behavior now covered

  • Registry input_set GETbranch, repo_name, connector_ref, and store_type query params reach the Harness API (previously omitted from pipelines.ts get spec)
  • pipeline_branch precedence — when both pipeline_branch and branch are set on a remote run, input set materialization uses pipeline_branch (the git branch the set YAML lives on), not the CI codebase checkout branch
  • Merge path with full pipeline YAML — git context still forwards on the input set GET when input_set_ids are merged alongside a full pipeline document in inputs
  • Multiple input sets — every materialization GET receives the same git context, not just the first

Test files added/updated

File Change
tests/registry/input-set-git-context.test.ts New — registry dispatch tests for input_set get with/without git params
tests/tools/tool-handlers.test.ts pipeline_branch precedence + git context on merge-with-full-YAML path
tests/utils/materialize-input-sets.test.ts git context on each GET when multiple inputSetIds

Why these tests materially reduce regression risk

Remote/git-backed input sets fail silently — Harness resolves from the repo default branch with no error when branch params are missing. These tests pin the three integration surfaces (harness_get registry dispatch, harness_execute materialization, and the materialize-input-sets utility) so a dropped query param or wrong branch field cannot re-ship unnoticed.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other — test coverage

Checklist

  • pnpm test passes (targeted: 158 tests in 3 files)
  • pnpm typecheck passes
  • pnpm build passes
  • pnpm standards:check passes
  • pnpm docs:check passes (N/A — no registry/tool count changes)
Open in Web View Automation 

thisrohangupta and others added 2 commits July 7, 2026 15:11
Running a v0 pipeline via harness_execute with input_set_ids for a
remote / Git-stored input set silently applied the wrong values (or none):
the input-set GET forwarded only org/project/pipeline identifiers and no
git context, so the Harness API resolved the set from the repo's DEFAULT
branch. When the input set lived on another branch, the run proceeded with
default-branch content and no error — matching the reported "pipeline runs
but the input set isn't applied."

Verified against the live Harness API: GET /pipeline/api/inputSets/{id}
honors branch/repoName/connectorRef/storeType query params, and omitting
branch silently falls back to the default branch (returns SUCCESS with the
wrong YAML). The response field names (inputSetYaml, inputSet.pipeline)
were already correct.

Changes:
- materializeInputSetsToRuntimeYaml accepts an optional gitContext and
  forwards branch/repoName/connectorRef/storeType on each input-set GET.
- harness_execute builds gitContext from the run's already-normalized
  remote params (pipeline_branch/branch, repo_name, connector_ref,
  store_type) and passes it through. Inline sets are unaffected — empty
  values are dropped by the client's query serializer.
- The standalone input_set get action gains the same git query params,
  fixing the parallel silent-default on harness_get(resource_type=input_set).

Adds tests: git-context forwarding in materialize, and end-to-end
forwarding from a remote pipeline run into the input-set GET.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

AI-Session-Id: b8e26a07-057c-406c-bfde-245eb0c917ae
AI-Tool: claude-code
AI-Model: unknown
Add regression tests for PR #579 gaps:
- Registry input_set GET maps branch/repo/connector/store_type query params
- pipeline_branch takes precedence over branch for input set materialization
- Git context forwarded when merging input_set_ids with full pipeline YAML
- Git context applied on every GET when multiple input sets are materialized

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants