|
| 1 | +<!doctype html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <title>Implementation Plan: Issue #170 Stop Vendoring Go Modules</title> |
| 6 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 7 | + <style> |
| 8 | + body { margin: 0; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #f6f7f9; color: #1f2937; line-height: 1.5; } |
| 9 | + main { max-width: 1100px; margin: 0 auto; padding: 32px; } |
| 10 | + section { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 20px; margin: 16px 0; } |
| 11 | + h1, h2 { line-height: 1.2; margin-top: 0; } |
| 12 | + code { background: #f3f4f6; padding: 2px 5px; border-radius: 4px; } |
| 13 | + .badge { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #dcfce7; color: #166534; font-size: 12px; font-weight: 700; } |
| 14 | + .risk { border-left: 4px solid #dc2626; } |
| 15 | + .approval { border-left: 4px solid #d97706; } |
| 16 | + </style> |
| 17 | +</head> |
| 18 | +<body> |
| 19 | +<main> |
| 20 | + <h1>Implementation Plan: Issue #170 Stop Vendoring Go Modules</h1> |
| 21 | + <p class="badge">Approved and implemented</p> |
| 22 | + |
| 23 | + <section> |
| 24 | + <h2>Task Summary</h2> |
| 25 | + <p>Decide and implement the dependency workflow change from committed <code>vendor/</code> plus <code>-mod=vendor</code> to normal Go module resolution, if approved.</p> |
| 26 | + </section> |
| 27 | + |
| 28 | + <section> |
| 29 | + <h2>Current Behavior</h2> |
| 30 | + <ul> |
| 31 | + <li>The repository contains a committed <code>vendor/</code> tree and <code>vendor/modules.txt</code>.</li> |
| 32 | + <li><code>.github/workflows/ci.yml</code> runs <code>go build -mod=vendor ./...</code>, <code>go vet -mod=vendor ./...</code>, and <code>go test -mod=vendor ./...</code>.</li> |
| 33 | + <li><code>actions/setup-go</code> has <code>cache: false</code>.</li> |
| 34 | + <li><code>Dockerfile</code> copies the full repository before building and runs <code>go build -mod=vendor</code>.</li> |
| 35 | + <li><code>go.mod</code> uses Go 1.25.0 and current dependencies are represented in <code>go.sum</code>.</li> |
| 36 | + </ul> |
| 37 | + </section> |
| 38 | + |
| 39 | + <section> |
| 40 | + <h2>Desired Behavior</h2> |
| 41 | + <ul> |
| 42 | + <li><code>go.mod</code> and <code>go.sum</code> are the reviewable dependency boundary.</li> |
| 43 | + <li>CI builds, vets, and tests without <code>-mod=vendor</code>, with Go module caching enabled.</li> |
| 44 | + <li>Docker build has a stable module download layer: copy <code>go.mod</code>/<code>go.sum</code>, run <code>go mod download</code>, then copy source and build.</li> |
| 45 | + <li>Contributor docs describe normal Go module workflow.</li> |
| 46 | + <li>Implementation does not upgrade dependencies unless required by no-vendor build validation.</li> |
| 47 | + </ul> |
| 48 | + </section> |
| 49 | + |
| 50 | + <section> |
| 51 | + <h2>Assumptions And Unknowns</h2> |
| 52 | + <ul> |
| 53 | + <li>Assumption: smaller PR diffs and OSS readability are more important than hermetic offline builds for this repository.</li> |
| 54 | + <li>Assumption: GitHub Actions and Docker builders may access the public Go module proxy.</li> |
| 55 | + <li>Unknown: whether any deployment environment requires offline Docker builds from a checked-in vendor tree.</li> |
| 56 | + <li>Unknown: whether branch protection currently requires the existing check name exactly; this can be handled in issue #152.</li> |
| 57 | + </ul> |
| 58 | + </section> |
| 59 | + |
| 60 | + <section> |
| 61 | + <h2>Files Likely To Change</h2> |
| 62 | + <ul> |
| 63 | + <li><code>vendor/</code> - remove committed vendored dependencies if the decision is no-vendor.</li> |
| 64 | + <li><code>.github/workflows/ci.yml</code> - remove <code>-mod=vendor</code>, enable Go cache, and update comments.</li> |
| 65 | + <li><code>Dockerfile</code> - add module download layer and build without vendor mode.</li> |
| 66 | + <li><code>README.md</code>, <code>CONTRIBUTING.md</code>, <code>AGENTS.md</code>, <code>CLAUDE.md</code> - update build/dependency notes where relevant.</li> |
| 67 | + <li><code>.dockerignore</code> - add only if needed to keep Docker context clean after vendor removal.</li> |
| 68 | + </ul> |
| 69 | + </section> |
| 70 | + |
| 71 | + <section> |
| 72 | + <h2>Implementation Steps</h2> |
| 73 | + <ol> |
| 74 | + <li>Confirm no explicit offline-build requirement exists in docs or deployment notes.</li> |
| 75 | + <li>Run <code>go mod tidy</code> and inspect whether <code>go.mod</code>/<code>go.sum</code> change.</li> |
| 76 | + <li>Update CI commands to remove <code>-mod=vendor</code> and enable setup-go cache.</li> |
| 77 | + <li>Restructure Dockerfile around <code>go mod download</code> and normal <code>go build</code>.</li> |
| 78 | + <li>Remove <code>vendor/</code> in one commit so dependency deletion is easy to review separately from logic changes.</li> |
| 79 | + <li>Update contributor docs and project agent docs to remove vendor assumptions.</li> |
| 80 | + <li>Validate local Go commands and Docker build; then rely on GitHub CI for clean checkout verification.</li> |
| 81 | + </ol> |
| 82 | + </section> |
| 83 | + |
| 84 | + <section> |
| 85 | + <h2>Impact</h2> |
| 86 | + <ul> |
| 87 | + <li><strong>Build:</strong> CI and Docker become network-dependent during module download.</li> |
| 88 | + <li><strong>Runtime:</strong> no intended runtime image behavior change except build-stage dependency resolution.</li> |
| 89 | + <li><strong>Security/review:</strong> dependency review moves to <code>go.mod</code>/<code>go.sum</code> instead of large vendor diffs.</li> |
| 90 | + <li><strong>Deployment:</strong> normal GHCR build path should continue, but needs CI and Docker validation.</li> |
| 91 | + </ul> |
| 92 | + </section> |
| 93 | + |
| 94 | + <section> |
| 95 | + <h2>Test Plan</h2> |
| 96 | + <ul> |
| 97 | + <li><code>go mod tidy</code></li> |
| 98 | + <li><code>go test ./...</code></li> |
| 99 | + <li><code>go vet ./...</code></li> |
| 100 | + <li><code>go build ./...</code></li> |
| 101 | + <li><code>docker build .</code></li> |
| 102 | + <li>After PR: verify GitHub Actions <code>Build, Vet & Test</code> and Docker build jobs pass from a clean checkout.</li> |
| 103 | + </ul> |
| 104 | + </section> |
| 105 | + |
| 106 | + <section class="risk"> |
| 107 | + <h2>Risks And Edge Cases</h2> |
| 108 | + <ul> |
| 109 | + <li>Network or Go proxy outage can break builds that previously used the committed vendor tree.</li> |
| 110 | + <li>Large vendor deletion can obscure other changes; keep the PR focused.</li> |
| 111 | + <li>Docker layer caching must be structured correctly or builds get slower.</li> |
| 112 | + <li>If existing branch protection keys off exact check names, preserve names or coordinate via issue #152.</li> |
| 113 | + </ul> |
| 114 | + </section> |
| 115 | + |
| 116 | + <section> |
| 117 | + <h2>Rollback Plan</h2> |
| 118 | + <p>Restore <code>vendor/</code>, restore <code>-mod=vendor</code> in CI and Dockerfile, run <code>go mod vendor</code>, and revert docs to vendored dependency workflow.</p> |
| 119 | + </section> |
| 120 | + |
| 121 | + <section> |
| 122 | + <h2>Open Questions</h2> |
| 123 | + <ul> |
| 124 | + <li>Do we accept network-dependent CI/Docker builds for this repository?</li> |
| 125 | + <li>Should Docker use default Go proxy or an explicitly configured <code>GOPROXY</code>?</li> |
| 126 | + <li>Should this PR be split into two commits: config/docs first, vendor deletion second?</li> |
| 127 | + </ul> |
| 128 | + </section> |
| 129 | + |
| 130 | + <section class="approval"> |
| 131 | + <h2>Approval Gate</h2> |
| 132 | + <p>Approved by the user on 2026-06-06.</p> |
| 133 | + </section> |
| 134 | + |
| 135 | + <section> |
| 136 | + <h2>Implementation Result</h2> |
| 137 | + <ul> |
| 138 | + <li>Removed the committed <code>vendor/</code> tree and <code>vendor/modules.txt</code>.</li> |
| 139 | + <li>Updated CI to use normal Go module resolution with setup-go caching enabled.</li> |
| 140 | + <li>Updated Dockerfile to copy <code>go.mod</code>/<code>go.sum</code>, run <code>go mod download</code>, then copy source and build without <code>-mod=vendor</code>.</li> |
| 141 | + <li>Added <code>.dockerignore</code> so Docker context excludes <code>.git</code>, local caches, docs plans, build outputs, and any accidental <code>vendor</code> directory.</li> |
| 142 | + <li>Updated README, CONTRIBUTING, AGENTS, and CLAUDE dependency workflow notes.</li> |
| 143 | + <li><code>go mod tidy</code> produced no semantic <code>go.mod</code>/<code>go.sum</code> changes.</li> |
| 144 | + </ul> |
| 145 | + </section> |
| 146 | + |
| 147 | + <section> |
| 148 | + <h2>Verification Run</h2> |
| 149 | + <ul> |
| 150 | + <li><code>go mod tidy</code> with workspace-independent temporary <code>GOCACHE</code>.</li> |
| 151 | + <li><code>go test ./...</code></li> |
| 152 | + <li><code>go vet ./...</code></li> |
| 153 | + <li><code>go build ./...</code></li> |
| 154 | + <li><code>docker build -t health-receiver:no-vendor-smoke .</code></li> |
| 155 | + <li>Docker build context dropped from about 362 MB before <code>.dockerignore</code> to about 420 KB after it.</li> |
| 156 | + </ul> |
| 157 | + </section> |
| 158 | + |
| 159 | + <section> |
| 160 | + <h2>Known Limitations</h2> |
| 161 | + <ul> |
| 162 | + <li>CI and Docker builds now require network access to the Go module proxy or configured module source.</li> |
| 163 | + <li>Clean-checkout verification is still delegated to GitHub Actions after PR creation.</li> |
| 164 | + </ul> |
| 165 | + </section> |
| 166 | +</main> |
| 167 | +</body> |
| 168 | +</html> |
0 commit comments