Skip to content

chore: deduplicate harness config across forge sections #904

Description

@ggallen

Summary

PR #817 (retro multi-forge) established a clean pattern: define shared config at the top level and only put forge-specific overrides in forge.<platform> sections. The harness runtime's mergeForgeConfig confirms this is safe — scalars only override when non-empty, and env maps merge with forge keys winning on collision.

Three other harness files have redundant duplication that can be cleaned up the same way.

What to change

harness/code.yaml

Remove duplicate scalars (identical to top-level):

  • forge.github.pre_script (line 78) — duplicates top-level line 44
  • forge.github.post_script (line 79) — duplicates top-level line 45
  • forge.gitlab.pre_script (line 107) — duplicates top-level line 44
  • forge.gitlab.post_script (line 108) — duplicates top-level line 45

Hoist common env.runner keys to top-level env.runner:

  • PUSH_TOKEN: "${PUSH_TOKEN}" (github:88, gitlab:116)
  • PUSH_TOKEN_SOURCE: "${PUSH_TOKEN_SOURCE}" (github:89, gitlab:117)
  • REPO_FULL_NAME: "${REPO_FULL_NAME}" (github:90, gitlab:118)
  • ISSUE_NUMBER: "${ISSUE_NUMBER}" (github:91, gitlab:119)

Hoist common env.sandbox keys to top-level env.sandbox:

  • GIT_AUTHOR_NAME: "fullsend-code" (github:100, gitlab:128)
  • GIT_AUTHOR_EMAIL: "${GIT_BOT_EMAIL}" (github:101, gitlab:129)
  • GIT_COMMITTER_NAME: "fullsend-code" (github:102, gitlab:130)
  • GIT_COMMITTER_EMAIL: "${GIT_BOT_EMAIL}" (github:103, gitlab:131)

harness/triage.yaml

Remove duplicate scalars (identical to top-level):

  • forge.github.pre_script (line 48) — duplicates top-level line 26
  • forge.github.post_script (line 49) — duplicates top-level line 27
  • forge.gitlab.pre_script (line 68) — duplicates top-level line 26
  • forge.gitlab.post_script (line 69) — duplicates top-level line 27
  • forge.jira.pre_script (line 88) — duplicates top-level line 26
  • forge.jira.post_script (line 89) — duplicates top-level line 27

harness/review.yaml

Hoist pre/post scripts to top-level (identical in both forge sections, currently missing from top-level):

  • pre_script: scripts/pre-review.sh (github:64, gitlab:92)
  • post_script: scripts/post-review.sh (github:65, gitlab:93)

Hoist common env.runner keys to top-level env.runner:

  • REPO_FULL_NAME: "${REPO_FULL_NAME}" (github:78, gitlab:105)

Hoist common env.sandbox keys to top-level env.sandbox:

  • REPO_FULL_NAME: "${REPO_FULL_NAME}" (github:83, gitlab:111)
  • PRIOR_REVIEW_SHA: "${PRIOR_REVIEW_SHA}" (github:88, gitlab:116)
  • PRIOR_REVIEW_PROVENANCE: "${PRIOR_REVIEW_PROVENANCE}" (github:89, gitlab:117)

Not in scope

Why this is safe

mergeForgeConfig in internal/harness/forge.go (lines 162–218) merges forge sections into the top-level harness:

  • Scalars (pre_script, post_script, policy): forge overrides only if non-empty; top-level value is preserved otherwise
  • Env maps: top-level merged with forge; forge keys win on collision

All values listed above are identical across every forge section in their respective file. Moving them to the top level produces the same resolved config.

Line numbers

Based on commit 0a5599e (current main).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions