Skip to content

fix(#6430): pass RETRO_COMMENT in GitLab dispatch variables - #6431

Closed
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/6430-gitlab-retro-comment-env
Closed

fix(#6430): pass RETRO_COMMENT in GitLab dispatch variables#6431
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/6430-gitlab-retro-comment-env

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

Pass RETRO_COMMENT as a GitLab dispatch pipeline variable so the retro harness env validation succeeds without requiring scaffold re-enrollment.

The retro harness references RETRO_COMMENT via "${RETRO_COMMENT}" in env.sandbox, but the GitLab dispatch did not include it as a pipeline variable. The fullsend CLI's env validation treats any ${VAR} reference as required, causing programmatic retro runs to fail immediately on repos that haven't re-enrolled to pick up the scaffold extraction from #6419.

Changes

  • Add RETRO_COMMENT (sourced from event.NoteBody) to the dispatch variables map in dispatch.go
  • Add RETRO_COMMENT to signedDispatchKeys for HMAC integrity
  • Update the shell HMAC verifier in fullsend-agent.yml to include RETRO_COMMENT
  • Add tests verifying RETRO_COMMENT is set for note events and empty for non-note events

Testing

  • TestDispatch_IncludesRetroComment — verifies note body is passed as RETRO_COMMENT
  • TestDispatch_RetroCommentEmptyForNonNoteEvent — verifies empty for non-note events
  • TestSignedDispatchKeys_MatchShellTemplate — verifies Go and shell HMAC key lists match
  • TestComputeDispatchHMAC_MatchesPython3 — verifies cross-language HMAC consistency with RETRO_COMMENT
  • All existing dispatch tests pass
  • Coverage: dispatch.go functions 86-100%, package overall 89.8%

Closes #6430

Post-script verification

  • Branch is not main/master (agent/6430-gitlab-retro-comment-env)
  • Secret scan passed (gitleaks — ff93b07b4c2c41df143a95c3ca61088a210738fd..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

The GitLab dispatch pipeline did not pass RETRO_COMMENT as a pipeline
variable. The retro harness references it via "${RETRO_COMMENT}" in
env.sandbox, and the fullsend CLI's env validation treats any ${VAR}
reference as required — causing programmatic retro runs to fail
immediately on repos that haven't re-enrolled to pick up the scaffold
extraction added in #6419.

Pass RETRO_COMMENT unconditionally in the dispatch variables map,
sourced from event.NoteBody. For note-triggered retro runs this
provides the comment text directly; for programmatic dispatches and
non-note events it is empty. Add RETRO_COMMENT to signedDispatchKeys
and the shell HMAC verifier so dispatch integrity is maintained.

Note: pre-commit could not run (sandbox network policy blocks git
fetch for hook environment setup). The post-script runs an
authoritative pre-commit check on the CI runner.

Closes #6430
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner August 20, 2026 18:37
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Agent PR ready for human review label Aug 20, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 20, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 6:39 PM UTC · Completed 6:54 PM UTC

Commit: f0b68a8 · View workflow run →

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ggallen ggallen added the fullsend-no-fix Skip bot-triggered fix agent runs label Aug 20, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

Low

  • [logic-error] internal/poll/dispatch.go:66RETRO_COMMENT is set unconditionally to event.NoteBody for all dispatch types, including non-retro events. No functional bug (consumers only read it in the retro stage), but semantically misleading for non-retro pipelines. Consider gating on stage == "retro".
  • [injection] internal/poll/dispatch.go:66RETRO_COMMENT is populated from user-controlled NoteBody without sanitizing newlines. Since the HMAC message uses \n as field delimiters, embedded newlines create structural ambiguity. Not exploitable (both signer and verifier produce the same message), but weakens the integrity guarantee.

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the review comment for full details.

Comment thread internal/poll/dispatch.go
"ORIGINATING_URL",
"REPO_FULL_NAME",
"RESOURCE_KEY",
"RETRO_COMMENT",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[medium] backward-compatibility

Adding RETRO_COMMENT to signedDispatchKeys changes the HMAC signature produced by the Go poller. During a rolling update where the poller is deployed before customer repos re-sync their scaffold template, the 12-key HMAC will not match the old 11-key shell verifier, causing fail-closed dispatch rejection. This follows the same pattern as the ORIGINATING_URL addition (#6418/#6419).

Suggested fix: If the transition breakage is unacceptable, consider a two-phase rollout: deploy the scaffold template change first so repos can pick it up, then add the key to signedDispatchKeys. If the team has accepted fail-closed transition breakage as policy (as with ORIGINATING_URL), no code change is needed — ensure scaffold re-sync is communicated.

Comment thread internal/poll/dispatch.go
"IS_FORK": strconv.FormatBool(isFork),
"ORIGINATING_URL": entityURL(p.gitlabURL, p.projectPath, event.Type, event.IID),
"REPO_FULL_NAME": p.projectPath,
"RETRO_COMMENT": event.NoteBody,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] logic-error

RETRO_COMMENT is set unconditionally to event.NoteBody for all dispatch types, including non-retro events. No functional bug since consumers only read RETRO_COMMENT in the retro stage, but semantically misleading for non-retro pipelines.

Suggested fix: Consider gating the assignment: only set RETRO_COMMENT when stage == "retro". The HMAC computation handles missing keys by using the zero string value.

Comment thread internal/poll/dispatch.go
"IS_FORK": strconv.FormatBool(isFork),
"ORIGINATING_URL": entityURL(p.gitlabURL, p.projectPath, event.Type, event.IID),
"REPO_FULL_NAME": p.projectPath,
"RETRO_COMMENT": event.NoteBody,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] injection

RETRO_COMMENT is populated from user-controlled NoteBody without sanitizing newlines. Since the HMAC message uses newline as field delimiters, embedded newlines create structural ambiguity. Not exploitable because both signer and verifier construct the same message, but weakens the integrity guarantee.

Suggested fix: Consider sanitizing newlines in NoteBody before placing it in the variables map, or base64-encode the value in the HMAC message while keeping the raw value in the pipeline variable.

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Aug 20, 2026
@ggallen

ggallen commented Aug 20, 2026

Copy link
Copy Markdown
Member

Closing — the scaffold's fullsend-agent.yml already extracts RETRO_COMMENT from EVENT_PAYLOAD_B64 for the retro stage (lines 296-299). The failing pipeline was due to the test repo running a stale CI config; after re-enrollment the extraction block handles this without needing a dispatch variable or HMAC changes.

@ggallen ggallen closed this Aug 20, 2026
@fullsend-ai-retro

fullsend-ai-retro Bot commented Aug 20, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 7:19 PM UTC · Completed 7:32 PM UTC

Commit: f0b68a8 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #6431 — unnecessary code change closed without merge

PR #6431 was a code agent PR to fix #6430 (GitLab dispatch missing RETRO_COMMENT env var). The PR added RETRO_COMMENT as a dispatch variable and updated HMAC signing keys. Human reviewer ggallen closed it without merging — the scaffold's fullsend-agent.yml already extracts RETRO_COMMENT from EVENT_PAYLOAD_B64 (added in PR #6419). The test repo just needed re-enrollment to pick up the scaffold change.

Timeline

  1. 18:16 UTC — Issue #6430 opened by ggallen, referencing #6418 as the "same class of issue" and noting PR fix(#6418): pass ORIGINATING_URL and REPO_FULL_NAME in GitLab dispatch #6419 already added scaffold extraction.
  2. 18:18–18:24 UTC — Triage agent (run 32402265126) acknowledged the prior fix but recommended new dispatch-level code to "decouple the fix from scaffold deployment timing." Labeled ready-to-code.
  3. 18:26–18:37 UTC — Code agent (run 32403029198) built the PR with 3 files changed: dispatch variable, HMAC key, shell template.
  4. 18:39–18:54 UTC — Review agent (run 32404187486) provided tactical feedback: medium-severity HMAC backward-compatibility concern, two low-severity logic/injection findings.
  5. 18:41 UTC — Codecov confirmed 100% patch coverage.
  6. 19:17 UTC — ggallen closed the PR: the scaffold already handles it; test repo needed re-enrollment.

Review quality

The review agent's findings were high quality and relevant to the proposed changes. The HMAC rolling-update backward-compatibility finding (medium) was a genuine concern for the approach taken. The review correctly identified that adding a 12th key to signedDispatchKeys would break verification against repos still running the 11-key shell template — the same transition issue that occurred with ORIGINATING_URL (#6418/#6419). The two low-severity findings (unconditional variable assignment, newline injection in HMAC delimiters) were technically sound observations. The review did not question whether the change was necessary — that is a triage-layer concern, not a review-layer one.

Evidence for existing issues

Proposals filed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fullsend-no-fix Skip bot-triggered fix agent runs ready-for-review Agent PR ready for human review requires-manual-review Review requires human judgment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitLab dispatch missing RETRO_COMMENT env var

1 participant