fix(#6615): auto-add GitLab forge host to sandbox egress allowlist and proxy profile - #6616
Conversation
|
🤖 Finished Review · ✅ Success · Started 1:08 AM UTC · Completed 1:29 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $8.04 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Risk Assessment: moderate (2/5) DetailsModerate risk: bot-authored, well-scoped GitLab sandbox networking fix with solid test coverage (36%). File and line counts are elevated (14 files, 496 lines) but most additions are tests and new gitlab_profile.go/env.go modules. run.go remains an extreme churn hotspot (84 commits/30d, 17 authors) warranting careful review. Security-adjacent but additive and gated on forgePlatform==gitlab. Change is platform-gated and easily revertible. Prior score of 2 confirmed — signals unchanged. Previous runRisk Assessment: moderate (2/5) DetailsModerate risk: bot-authored, well-scoped GitLab sandbox networking fix with solid test coverage (38%). File and line counts are elevated (13 files, 470 lines) but most additions are tests and a new gitlab/env.go module. run.go remains an extreme churn hotspot (84 commits/30d, 14 authors) warranting careful review. Security-adjacent (sandbox egress/proxy) but additive and gated on forgePlatform==gitlab with no impact to the GitHub path. Issue scope aligns well with PR changes. Prior score of 2 confirmed — no new signals warrant adjustment. Previous run (2)Risk Assessment: moderate (2/5) DetailsModerate risk: bot-authored, well-scoped GitLab sandbox networking fix with solid test coverage (38%). File and line counts are elevated (13 files, 474 lines) but most additions are tests and a new gitlab/env.go module. run.go remains an extreme churn hotspot warranting careful review. Security-adjacent (sandbox egress/proxy) but additive and gated on forgePlatform==gitlab with no impact to the GitHub path. Previous run (3)Risk Assessment: moderate (2/5) DetailsModerate risk: well-scoped bot-authored bug fix with good test coverage (31%), but run.go is an extremely high-churn file (323 commits, 84 in last 30 days) warranting careful review. The change is security-adjacent (sandbox egress allowlist) but narrowly scoped to adding GitLab forge hosts. Previous run (4)Risk Assessment: moderate (2/5) DetailsModerate risk: well-scoped bot-authored bug fix with good test coverage (36%), but run.go is an extremely high-churn file warranting careful review. Previous run (5)Risk Assessment: moderate (2/5) DetailsModerate risk: 8 files with 430 lines changed (mostly additive), good test coverage ratio (0.38), bot author, no protected paths or CI workflow changes. The security label and high priority on the linked issue elevate concern, but the change is narrowly scoped to sandbox egress networking for GitLab. Previous run (6)Risk Assessment: moderate (2/5) DetailsMedium-sized bot-authored bug fix (417 lines, 8 files) with good test coverage (38% test files). Two production files (run.go, customizing-agents.md) are high-churn hotspots, but the change is well-scoped, additive, and aligns precisely with the linked issue. Previous run (7)Risk Assessment: moderate (2/5) DetailsWell-scoped bot PR with strong test coverage (50% test files) and low security/CI impact, but touches an extremely high-churn file (run.go) which elevates git-history risk. |
ReviewFindingsLow
Previous runReviewFindingsLow
Previous run (2)ReviewFindingsLow
Previous run (3)ReviewFindingsLow
Info
Previous run (4)ReviewFindingsLow
Previous run (5)ReviewFindingsMedium
Low
Previous run (6)ReviewFindingsLow
Previous run (7)ReviewFindingsMedium
Low
Next steps:
|
1be2315 to
a3e9966
Compare
|
🤖 Review · ❌ Terminated · Started 2:06 AM UTC · Ended 2:25 AM UTC Commit: |
Site previewPreview: https://db26af5e-site.fullsend-ai.workers.dev Commit: |
Superseded by updated review
|
🤖 Finished Review · ✅ Success · Started 2:06 AM UTC · Completed 2:25 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $7.91 |
|
/fs-fix - rebase and fix all the review issues. Respond to and resolve the conversations. |
|
🤖 Finished Fix · ✅ Success · Started 2:32 AM UTC · Completed 2:45 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.14 |
🔧 Fix agent — iteration 1 (human-triggered)Fixed validation failure: the original PR commits contained Signed-off-by trailers which violate the agent commit policy. Squashed both commits (a3e9966 and f4a8ca7) into a single clean commit with only a Co-Authored-By trailer. All prior review fixes (URLEnvVars rename, yaml.v3 marshaling, hostname validation removal, test updates) are preserved in the squashed commit. Fixed (5):
Tests: passedNext steps:
|
a3e9966 to
760f245
Compare
|
🤖 Finished Review · ✅ Success · Started 2:47 AM UTC · Completed 3:08 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $8.31 |
…d proxy profile When fullsend runs on a self-hosted GitLab instance the sandbox cannot reach the GitLab API because (1) the SSRF pre-tool hook fails DNS pre-resolution for internal hosts and falls closed, and (2) no provider profile configures the L7 proxy for the forge host. Layer 1 — egress allowlist: appendHookEnv now auto-appends the GitLab forge host:port to FULLSEND_EGRESS_ALLOWLIST when GITLAB_CI=true, so the SSRF hook defers to the L7 proxy instead of failing closed. Layer 2 — provider profile: generateGitLabForgeProfile auto-generates a fullsend-gitlab-forge provider profile (analogous to the scaffold's fullsend-github.yaml) that opens the L7 proxy for the forge host. Both layers share a new ResolveForgeHostPort() in internal/forge/gitlab/env.go, eliminating the duplicated env-var lookup that previously lived in both internal/cli and internal/runtime. Addresses review feedback: - Rename GitLabURLEnvVars to URLEnvVars to avoid stutter - Replace fmt.Sprintf YAML template with yaml.v3 struct marshaling - Remove manual hostname character validation - Update tests to match yaml.v3 output format - Extract GitLab profile types to internal/cli/gitlab_profile.go Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Greg Allen <gallen@redhat.com>
bec7453 to
da1827d
Compare
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 4:25 PM UTC · Completed 5:08 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high |
Pull request was closed
|
🤖 Finished Retro · ✅ Success · Started 6:49 PM UTC · Completed 7:02 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.57 |
Retro: PR #6616 — auto-add GitLab forge host to sandbox egress allowlistTimeline
Totals: 1 triage + 1 code + 8 review + 5 fix (3 success, 2 failed) = 15 agent runs. What went well
Evidence for existing issues
|
|
🤖 Finished Retro · ✅ Success · Started 8:09 PM UTC · Completed 8:36 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $7.87 |
Retro: PR #6616 — GitLab forge egress fixWorkflow: 8 review cycles, 5 fix attempts (2 failed), ~$88 across 15+ agent runs for a moderate 14-file GitLab forge egress fix (run timeline). Issue created at 00:41 UTC, PR merged at 20:08 UTC (~19 hours). The first retro (pre-merge) identified the key improvement areas and referenced existing issues. This post-merge retro confirms those findings and adds specific root-cause detail. Evidence for existing issues
No new proposalsAll improvement areas identified in this retro are already tracked by open issues. The most impactful fix would be #5419 (scan-range alignment), which would have prevented the 2 fix failures (~$8 wasted, ~30 min delay) and eliminated the need for escalating human warnings. |
Summary
Auto-configures both sandbox network layers for self-hosted GitLab forge hosts, fixing the 403/DNS-failure loop that blocks all agent runs on self-hosted GitLab instances.
Related Issue
Closes #6615
Changes
appendHookEnvininternal/runtime/sandbox_hooks_bootstrap.gonow auto-resolves the GitLab forge hostname fromFULLSEND_GITLAB_URL/GITLAB_API_URL/CI_SERVER_URLwhenGITLAB_CI=trueand merges it ashost:443intoFULLSEND_EGRESS_ALLOWLIST. This is a tactical bridge until SSRF hook: move DNS resolution to the host API server #6586 moves DNS resolution to the host API server.run.goauto-generates afullsend-gitlab-forgeprovider profile YAML (modeled after the scaffold'sfullsend-github.yaml) with the forge host:443 endpoint and imports it viasandbox.ImportProfile()during the provider/profile setup phase. This is the durable fix — the proxy needs the endpoint regardless of DNS evolution.forge_client.go. User-configuredssrf_egress_allowlistentries are preserved (comma-separated merge, deduplication viaParseEgressAllowlist).Testing
resolveGitLabForgeHost/resolveGitLabForgeHostFromEnv: table-driven tests covering all URL precedence combinations, non-GitLab no-op, and missing env varsappendHookEnv: tests for auto-add on GitLab, merge with user allowlist, no-op when not on GitLab, URL precedencegenerateGitLabForgeProfile: tests for success (validates YAML content), no-host returns empty, URL precedenceinternal/runtime/andinternal/cli/continue to pass (2 pre-existing failures inTestPostScriptEnv_NoSchema*unrelated to this change)Closes #6615
Post-script verification
agent/6615-gitlab-forge-egress)bfa5a2afa6f0e1ae46c6d7d7d142aded36372663..HEAD)