Repository navigation
feat(#7771): add GitLab webhook dispatcher CI scaffold - #8021
Conversation
Add a trigger-only dispatcher job to the GitLab .fullsend scaffold so a pipeline-trigger webhook can launch the gitlab-webhook input driver on the control project. - fullsend-dispatcher.yml: "fullsend webhook dispatcher" job in the dispatch stage on __CONTROL_RUNNER_TAGS__. It denies CI_DEBUG_TRACE first, then admits only trigger pipelines on the protected default branch. - run-dispatcher-job.sh: re-checks debug trace, pins project, pipeline, source=trigger, host and protected default branch via pin-ci-job-identity.sh before any credential use. It then requires the native TRIGGER_PAYLOAD file, selects the Developer-level poller role token, clears sibling secrets, and runs `fullsend poll --input-driver gitlab-webhook`. Agent launches still go through CreatePipelineWithInputs (source=api); no pipeline variables. - fullsend-pipeline.yml: trigger-gated dispatcher include and stages dispatch, poll, agent so trigger pipelines run only the dispatcher. Root .gitlab-ci.yml admits trigger pipelines on the protected default branch after the debug-trace deny; the 20-input ADR 0131 contract is unchanged. - internal/repos: register the new template and script for install, converge probe and uninstall. "dispatch" is a current stage again and the trigger workflow rule is merged on install/converge and removed on uninstall. Tests cover source separation, debug-trace denial, payload handoff, input-contract preservation, registration and cleanup. Closes #7771 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Finished Review · ✅ Success · Started 2:03 AM UTC · Completed 2:22 AM UTC Commit: Runtime: pi · Model: openai/gpt-6.1-sol → gpt-6.1-sol · Effort: high · Cost: $4.02 |
Site previewPreview: https://06cd307a-site.fullsend-ai.workers.dev Commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Risk Assessment: moderate (2/5) DetailsAdditive GitLab webhook dispatcher scaffold authored by a bot with no protected path or dependency changes, aligning with linked issue scope despite moderate churn in touched GitLab CI files. Previous runRisk Assessment: moderate (2/5) DetailsAdditive GitLab webhook dispatcher scaffold authored by a bot with no protected path or dependency changes, aligning with linked issue scope despite moderate churn in touched GitLab CI files. |
|
Looks good to me Previous runReviewFindingsMedium
Labels: The PR adds GitLab webhook dispatch CI scaffolding and its managed installation lifecycle. Next steps:
|
|
🤖 Finished Fix · ✅ Success · Started 2:24 AM UTC · Completed 2:35 AM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.37 |
Deliver the GitLab dispatcher template and make dispatcher requirements follow the selected scaffold version: - probe fullsend-dispatcher.yml (with its script) as managed components when the installed pipeline wrapper includes it, and report expected but missing dispatcher files as content drift so an unchanged-ref rollout delivers the YAML along with the rewritten wrapper - fetch the dispatcher files from a pinned ref only when its wrapper references them, so pre-dispatcher pins still install and converge - add template-only deletion, unchanged-ref rollout, probe, and older-pin regression tests Note: pre-commit could not fetch hook repositories (TLS failure in the sandbox); gofmt, go vet, whitespace checks and scan-secrets were run directly. internal/cli has sandbox-dependent test failures unrelated to this change. Addresses #8021 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔧 Fix agent — iteration 1 (bot-triggered)Addressed both review findings. Dispatcher template and script are now probed as managed components when the wrapper references them, and missing dispatcher files are reported as drift so unchanged-ref rollouts deliver them. The remote GitLab scaffold fetch requires the dispatcher files only when the fetched wrapper references them, so older pins keep working. internal/repos and internal/scaffold tests pass. internal/cli has sandbox-dependent failures (fetch service and post-script env tests) in code this change does not touch. pre-commit could not fetch its hook repositories in the sandbox, so gofmt, go vet, whitespace checks and the secret scan were run directly. Fixed (2):
Tests: passed CI inspections (4):
Conflict update: skipped; strategy
|
|
🤖 Finished Review · ✅ Success · Started 2:37 AM UTC · Completed 2:48 AM UTC Commit: Runtime: pi · Model: openai/gpt-6.1-sol → gpt-6.1-sol · Effort: high · Cost: $1.27 |
Superseded by updated review
…test TestConverge_GitLab_PreservesReinstatedDispatchStage fails on main with "no inference authentication selected for acme/api". This is a semantic merge conflict: fullsend-ai#8021 added the test with a Manifest that sets no inference.auth, and fullsend-ai#8015 (merged afterwards) made converge require an explicit inference-auth selection via RequireInferenceAuth. Set Defaults: testInferenceDefaults() on the test's Manifest, the same helper fullsend-ai#8015 applied to the other converge tests. It selects vertex-wif, which matches the GCP secrets the test already seeds. The test's assertions about preserving and backfilling the dispatch stage are unchanged. Verified with go test ./internal/repos/... (all pass), gofmt, and go vet. golangci-lint on internal/repos reports only existing findings in files this change does not touch. Note: pre-commit could not fetch remote hook repos (TLS failure in the sandbox); the applicable hooks (gofmt, go vet, lint-broken-symlinks, pre-commit-hooks file checks) were run directly and passed, and gitleaks coverage came from scan-secrets. Closes fullsend-ai#8042 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ions The webhook-dispatch rollout is complete (the dispatcher scaffold landed in #8021, the last active-scaffold change in #8548), so the converge-time compatibility paths for retired GitLab forms are no longer needed. Removed: - StripObsoleteGitLabWorkflowRules and StripObsoleteGitLabStages, their converge steps, the empty obsoleteGitLabStages list, and the stage-reference scanner (stageReferencedByJob, nodeResolvesToStage, collectJobKeys, mergeTargetResolvesToStage) only they used. - Converge deletion of a leftover fullsend-dispatch.yml (gitlabRetiredScaffoldPaths) and the wrapper-include checks guarding it. A leftover stub is now reported as an ordinary orphan. - The status/probe/upgrade fallback that read the version marker from a leftover fullsend-dispatch.yml. - Tests and docs that covered only those retired forms. Preserved: install, the CI_DEBUG_TRACE rule backfill, the typed pipeline-input root migration, status for current installs, and uninstall. Uninstall still deletes a leftover fullsend-dispatch.yml and still removes the obsolete merge_request_event rule from a fullsend-owned workflow block. User-owned CI configuration is never rewritten. Not changed: dropLegacyRunnerTags. It backs the still-supported gitlab.runner_tags manifest alias, which refills agent_runner_tags on load. It is not a scaffold/stage/rule migration path, and removing the alias would be a separate user-config change. Pre-commit could not fetch its hook repositories in the sandbox (TLS verification failure); the applicable hooks (check-yaml, end-of-file-fixer, trailing-whitespace, detect-private-key, check-merge-conflict, mixed-line-ending, gofmt, go vet, gitleaks, lychee, docs-link, symlink and ADR lints) were run directly and pass. BREAKING CHANGE: converge no longer migrates GitLab repos last converged before #7707: it does not strip the obsolete merge_request_event workflow rule, does not delete a leftover .gitlab/ci/fullsend-dispatch.yml (reported as an orphan instead), and status no longer reads that file's version marker. Converge such repos with an earlier release first, or remove those leftovers manually (or via uninstall). Closes #8031 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fold migrations The webhook-dispatch rollout is complete (the dispatcher scaffold landed in fullsend-ai#8021, the last active-scaffold change in fullsend-ai#8548), so the converge-time compatibility paths for retired GitLab forms are no longer needed. Removed: - StripObsoleteGitLabWorkflowRules and StripObsoleteGitLabStages, their converge steps, the empty obsoleteGitLabStages list, and the stage-reference scanner (stageReferencedByJob, nodeResolvesToStage, collectJobKeys, mergeTargetResolvesToStage) only they used. - Converge deletion of a leftover fullsend-dispatch.yml (gitlabRetiredScaffoldPaths) and the wrapper-include checks guarding it. A leftover stub is now reported as an ordinary orphan. - The status/probe/upgrade fallback that read the version marker from a leftover fullsend-dispatch.yml. - Tests and docs that covered only those retired forms. Preserved: install, the CI_DEBUG_TRACE rule backfill, the typed pipeline-input root migration, status for current installs, and uninstall. Uninstall still deletes a leftover fullsend-dispatch.yml and still removes the obsolete merge_request_event rule from a fullsend-owned workflow block. User-owned CI configuration is never rewritten. Not changed: dropLegacyRunnerTags. It backs the still-supported gitlab.runner_tags manifest alias, which refills agent_runner_tags on load. It is not a scaffold/stage/rule migration path, and removing the alias would be a separate user-config change. Pre-commit could not fetch its hook repositories in the sandbox (TLS verification failure); the applicable hooks (check-yaml, end-of-file-fixer, trailing-whitespace, detect-private-key, check-merge-conflict, mixed-line-ending, gofmt, go vet, gitleaks, lychee, docs-link, symlink and ADR lints) were run directly and pass. BREAKING CHANGE: converge no longer migrates GitLab repos last converged before fullsend-ai#7707: it does not strip the obsolete merge_request_event workflow rule, does not delete a leftover .gitlab/ci/fullsend-dispatch.yml (reported as an orphan instead), and status no longer reads that file's version marker. Converge such repos with an earlier release first, or remove those leftovers manually (or via uninstall). Closes fullsend-ai#8031 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Adds a webhook dispatcher job to the GitLab
.fullsendscaffold. The job runs only for trigger pipelines. It pins identity (source=trigger) before using any credential, then hands GitLab's nativeTRIGGER_PAYLOADfile tofullsend poll --input-driver gitlab-webhook. Agent launches still go through CreatePipelineWithInputs (source=api). The ADR 0131 20-input contract,no_one_allowed, and the Developer-level poller credential are unchanged.Related Issue
GitLab webhook: dispatcher CI scaffold for signed pipeline-input dispatch.
Changes
.gitlab/ci/fullsend-dispatcher.ymlfullsend webhook dispatcherjob in thedispatchstage, withtags: __CONTROL_RUNNER_TAGS__.CI_DEBUG_TRACEdeny comes first. After that, onlytriggerpipelines on the protected default branch are admitted..gitlab/ci/scripts/run-dispatcher-job.sh, in order:pin-ci-job-identity.shwithFULLSEND_ADMIT_SOURCE=trigger, which pins project, pipeline, source, host, and protected default branch. It fails closed if the pinned values are empty.TRIGGER_PAYLOADto be a readable regular file. The path is passed through unchanged and the script never reads the payload.fullsend poll --input-driver gitlab-webhookwith the pinned project, URL, and ref. The script uses novariables[...],/trigger/pipeline, or curl.fullsend-pipeline.yml$CI_PIPELINE_SOURCE == "trigger", behind the debug deny.dispatch, poll, agent..gitlab-ci.yml: adds a trigger workflow rule on the protected default branch, after the debug-trace deny. Inputs are unchanged (still exactly 20).internal/reposfullsendStagesisdispatch, poll, agent. GitLab rejects a config whose job stage is missing, sodispatchis a current stage again and the obsolete-stage list is now empty. The obsolete-stage strip code is kept, and its tests now run with a historical override.Notes for reviewers
dispatchstage from the root CI file, including one the user defined themselves. The previous obsolete-stage cleanup did the same.Testing
internal/scaffold/gitlab_dispatcher_test.go:internal/repostests:hasFullsendEntriesrequires both.go test ./internal/repos/... ./internal/scaffold/...passes.go veton the same packages passes.internal/cli(TestStartFetchService_*,TestPostScriptEnv_NoSchema*) also fail on a clean tree and are unrelated.pre-commititself could not run in the sandbox: fetching hook repos from GitHub failed TLS verification. I ran the hook equivalents directly on the changed files and all passed:-x -e SC1091,SC2001,SC2016), YAML parsehack/lint-docs-links,hack/lint-broken-symlinks, lychee (offline), gitleaks viascan-secrets, gitlintmake lintpasses (could not run in sandbox; see above)Process disclosure: one edit, adding paths to
internal/repos/remote_scaffold.go, was made with a Python heredoc rather than the editor tool. The resulting content was checked and is covered by tests.Checklist
!for breaking changes)🤖 Generated with Claude Code
Closes #7771
Post-script verification
agent/7771-gitlab-dispatcher-scaffold)6a4e4908accd03beca00236cf70818dbddd3dbe8..HEAD)