Skip to content

Automate cross-forge harness passthrough variable parity test #6275

Description

@fullsend-ai-retro

What happened

Issue #6273 reported that the GitLab code agent failed because CODE_ALLOWED_TARGET_BRANCHES was declared in reusable-code.yml (GitHub) but missing from the GitLab CI template. The issue author documented a broader pattern: fix.yaml and scribe.yaml have similar ${VAR} passthroughs that will break when multi-forged.

The triage agent (run 31988031730) proposed a comprehensive test shape that would parse harness YAMLs for ${VAR} patterns and verify both forge templates declare them. The code agent (run 31988273425) implemented a simpler approach: a manually-maintained passthroughVars list in TestGitLabAgentTemplateHarnessPassthroughVars with a comment instructing future developers to update it.

Related issue #5799 covers ${VAR} substitution semantics for unset vars but does not address cross-forge parity detection.

What could go better

The manually-maintained passthroughVars list in TestGitLabAgentTemplateHarnessPassthroughVars requires a developer to remember to add new entries when passthrough variables are introduced. This is the same class of error that caused #6273 — a variable was added to the GitHub workflow but the GitLab template was missed. A comment telling developers to update a list is helpful but not a structural guarantee.

The GitHub reusable workflows (reusable-code.yml, reusable-dispatch.yml, etc.) and the GitLab agent template both live in this repo. Passthrough variables in the GitHub workflows follow a recognizable pattern: they are set to an empty string '' in the env: block specifically so the harness engine's os.Expand succeeds. The test could parse these workflows to extract such variables automatically and verify the GitLab template declares them too.

Confidence: High. The issue author explicitly documented that fix.yaml and scribe.yaml will hit the same bug when multi-forged. An automated parity check would catch those before they surface as runtime failures.

Proposed change

Enhance TestGitLabAgentTemplateHarnessPassthroughVars in internal/scaffold/scaffold_gitlab_test.go to replace the manually-maintained passthroughVars list with automated extraction:

  1. Parse each reusable-*.yml workflow file under .github/workflows/ for env: blocks.
  2. Extract variable names that are set to empty string ('' or ""), which is the passthrough convention.
  3. For each extracted variable, verify it is declared in the GitLab agent template's variables: section (read via GitLabPerRepoFile).
  4. Fail with a descriptive message naming the workflow file, variable, and the GitLab template path when a declaration is missing.

This keeps the test entirely within this repo (no external dependencies on fullsend-ai/agents) and catches mismatches at go test time rather than at runtime on a real GitLab pipeline.

Validation criteria

  1. The enhanced test passes with the current set of passthrough variables.
  2. Adding a new empty-string env var to any reusable-*.yml workflow without a corresponding GitLab template declaration causes the test to fail with a clear error message.
  3. The manually-maintained passthroughVars slice is removed or reduced to an override/exclusion list rather than the primary source of truth.

Generated by retro agent from #6274

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/harnessAgent harness, config, and skills loadingfeatureFeature-category issue awaiting human prioritizationpriority/mediumNormal priority, plan for next cycleready-for-triageRetro-filed issue awaiting triage agenttriagedTriaged but awaiting human prioritization

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions