Skip to content

Commit cfc5720

Browse files
committed
ci: enforce the DGXC Go proxy, closing the fallthrough gap
Drops the `,direct` fallback so a module Artifactory does not serve is a hard failure rather than a silent fetch from the public internet. This also makes the workflow its own coverage measurement, which is why no separate reporting step is added. Under `routed` a green run proved only that nothing was rejected: a 404 fell through and the build still passed, so coverage was unknown. With the fallback gone, a green run means every module in the resolved graph came from Artifactory, because there is nowhere else it could have come from. A gap does not need to be reported — it fails the build and names the module. The graph resolved here is the real one: `go mod download` plus `go mod vendor` cover the build and test dependencies, which is the same set a non-vendored build would need. Enforced here first because nothing depends on this workflow — it verifies a property, it does not build or ship. If some module turns out not to be served, the blast radius is one red check on main. That safety margin exists only while the repo still vendors, which is why #2375 is sequenced ahead of #2374 rather than after it. Adds an assertion that GOPROXY carries no `,direct` entry. Without it a regression to `routed` would satisfy every existing assertion while quietly restoring the path this change closes. Closes #2375 Signed-off-by: Mark Chmarny <mark@chmarny.com>
1 parent 32f80f8 commit cfc5720

1 file changed

Lines changed: 22 additions & 8 deletions

File tree

.github/workflows/dgxc-goproxy-probe.yaml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,20 @@
2525
# `refs/pull/N/merge` instead and cannot validate the identity mapping the
2626
# exchange actually matches on.
2727
#
28-
# What a green run proves: the OIDC exchange mints a token, GOPROXY is ordered
29-
# with Artifactory first, GOSUMDB verification is intact, and a real module graph
30-
# resolves. What it does NOT prove: coverage. Under `routed` the resolver falls
31-
# through to `direct` on 404/410, so a module Artifactory does not carry is
32-
# fetched from the public internet and the build still goes green. Only
33-
# `enforced` closes that, and only once the graph is known to be served.
28+
# Runs in `enforced` mode: GOPROXY carries no `,direct` fallback, so a module
29+
# Artifactory does not serve is a hard failure rather than a silent fetch from
30+
# the public internet.
31+
#
32+
# That also makes this workflow its own coverage measurement. Under `routed` a
33+
# green run proved only that nothing was *rejected*; a 404 fell through and the
34+
# build still passed, so coverage was unknown. With the fallback gone, a green
35+
# run means every module in the resolved graph came from Artifactory — there is
36+
# nowhere else it could have come from. No separate reporting step is needed:
37+
# the failure mode names the unserved module directly.
38+
#
39+
# Safe to enforce here first because nothing depends on this workflow. It
40+
# verifies a property; it does not build or ship anything. If Artifactory turns
41+
# out not to serve some module, the blast radius is one red check on main.
3442
name: DGXC Go Proxy Probe
3543

3644
on:
@@ -94,7 +102,7 @@ jobs:
94102
- name: Configure the DGXC Go proxy
95103
uses: ./.github/actions/setup-dgxc-goproxy
96104
with:
97-
mode: routed
105+
mode: enforced
98106

99107
# Non-optional. GOPROXY is an ordered list and Go consults later entries
100108
# only on 404/410, so `proxy.golang.org,<artifactory>,direct` looks routed,
@@ -114,7 +122,13 @@ jobs:
114122
*) echo "first GOPROXY entry is '${proxy%%,*}', not Artifactory"; exit 1 ;;
115123
esac
116124
[ "$(go env GOSUMDB)" != off ] || { echo "GOSUMDB=off"; exit 1; }
117-
echo "OK: Artifactory is first in GOPROXY and GOSUMDB is intact"
125+
# Enforced means no fallback at all. Without this, a regression to
126+
# `routed` would still satisfy every assertion above while quietly
127+
# restoring the public-internet path this workflow exists to close.
128+
case "${proxy}" in
129+
*,direct|*,direct,*) echo "GOPROXY still carries a ',direct' fallback; this is not enforced"; exit 1 ;;
130+
esac
131+
echo "OK: Artifactory is the only GOPROXY entry and GOSUMDB is intact"
118132
119133
# The real work. `go mod download` resolves from go.mod/go.sum rather
120134
# than reading vendor/, so it is a genuine application-dependency fetch

0 commit comments

Comments
 (0)