Skip to content

Commit e7a877c

Browse files
committed
Harden release dependency policy gates
1 parent 3ba8f06 commit e7a877c

6 files changed

Lines changed: 103 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ behavior when the change improves security or project direction.
5757
- Refresh `ROADMAP.md` so `1.6.x` is consistently documented as the
5858
Pingora-exit line, shared Wasm extensibility is moved to `1.7`, and HTTP/3
5959
remains after the runtime boundary is stable.
60+
- Harden `scripts/validate-pingora-dependency-policy.sh` so documented
61+
Pingora removal targets are enforced against the current Fluxheim version
62+
instead of acting as a set-membership inventory only.
63+
- Tighten release-gate scripts by requiring modularity exceptions to be listed
64+
as structured table rows and by giving the UDP smoke negative assertion a
65+
longer observation window.
6066

6167
## 1.5.23 - 2026-06-14
6268

docs/runtime-baseline.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ by:
5050
scripts/validate-pingora-dependency-policy.sh check
5151
```
5252

53+
That gate fails when a Pingora crate is present without an exception, when an
54+
exception is stale, or when the current Fluxheim version has reached the
55+
exception's `removal_target`. Maintainers can test an upcoming release bump
56+
before editing `Cargo.toml` with:
57+
58+
```bash
59+
FLUXHEIM_PINGORA_POLICY_VERSION=1.6.1 scripts/validate-pingora-dependency-policy.sh check
60+
```
61+
5362
Release mode invokes the performance baseline automatically. To skip it for a
5463
local emergency run, set:
5564

@@ -87,4 +96,6 @@ and macOS developer builds.
8796
Temporary compatibility shims are acceptable only while an old and new runtime
8897
path are being compared. New internal APIs should not introduce fresh Pingora
8998
types unless the same release documents the exception and target removal
90-
release.
99+
release. If a removal slips, the exception file must be updated explicitly with
100+
a new target and release-note rationale; the gate must not stay green by
101+
accident.

release-notes/RELEASE_NOTES_1.6.0.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ remove Pingora safely in later 1.6.x releases.
5454
- Refreshed `ROADMAP.md` so `1.6.x` is consistently documented as the
5555
Pingora-exit line, shared Wasm extensibility is moved to `1.7`, and HTTP/3
5656
remains after the runtime boundary is stable.
57+
- Hardened `scripts/validate-pingora-dependency-policy.sh` so documented
58+
Pingora removal targets are enforced against the current Fluxheim version
59+
instead of acting as a set-membership inventory only.
60+
- Tightened release-gate scripts by requiring modularity exceptions to be
61+
listed as structured table rows and by giving the UDP smoke negative
62+
assertion a longer observation window.
5763

5864
## Notes
5965

scripts/smoke_udp_proxy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ import time
214214
215215
path = pathlib.Path(sys.argv[1])
216216
forbidden = sys.argv[2].encode("ascii")
217-
deadline = time.monotonic() + 1.0
217+
deadline = time.monotonic() + 3.0
218218
219219
while time.monotonic() < deadline:
220220
if path.exists() and forbidden in path.read_bytes():

scripts/validate-modularity-policy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ git ls-files '*.rs' | while IFS= read -r path; do
3535
continue
3636
fi
3737
printf 'modularity policy: %s lines %s\n' "$lines" "$path"
38-
if [ "$mode" = "check" ] && ! grep -Fq "\`$path\`" "$exceptions"; then
38+
if [ "$mode" = "check" ] && ! grep -Fq "| \`$path\` |" "$exceptions"; then
3939
echo "modularity policy: $path exceeds $limit lines and is not listed in $exceptions" >&2
4040
printf '%s\n' "$path" >> "$tmp"
4141
fi

scripts/validate-pingora-dependency-policy.sh

Lines changed: 77 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ esac
1414

1515
exceptions="docs/pingora-dependency-exceptions.tsv"
1616
out_dir="${FLUXHEIM_PINGORA_POLICY_DIR:-target/release-evidence/pingora-dependency-policy}"
17+
current_version="${FLUXHEIM_PINGORA_POLICY_VERSION:-$(sed -n 's/^version = "\([^"]*\)"/\1/p' Cargo.toml | sed -n '1p')}"
1718

1819
if [ ! -f "$exceptions" ]; then
1920
echo "pingora dependency policy: missing $exceptions" >&2
@@ -55,24 +56,40 @@ capture_tree() {
5556
esac
5657
}
5758

59+
extract_pingora_crates() {
60+
profile="$1"
61+
tree_file="$out_dir/cargo-tree/$profile.txt"
62+
matches_file="$out_dir/cargo-tree/$profile.pingora-matches.txt"
63+
64+
if grep -Eo 'pingora[-_a-z]* v[0-9][^ )]*' "$tree_file" >"$matches_file"; then
65+
sed 's/ v/\t/' "$matches_file" \
66+
| sort -u \
67+
| while IFS="$(printf '\t')" read -r crate version; do
68+
printf '%s\t%s\t%s\n' "$profile" "$crate" "$version"
69+
done
70+
else
71+
status="$?"
72+
if [ "$status" -ne 1 ]; then
73+
echo "pingora dependency policy: failed to inspect $tree_file" >&2
74+
exit "$status"
75+
fi
76+
fi
77+
}
78+
5879
profiles="default full cache-edge proxy-edge load-balancer-edge php privacy"
5980
current_tsv="$out_dir/current.tsv"
6081
current_keys="$out_dir/current.keys"
6182
exception_keys="$out_dir/exceptions.keys"
6283
unexpected="$out_dir/unexpected.keys"
6384
stale="$out_dir/stale-exceptions.keys"
85+
expired="$out_dir/expired-exceptions.tsv"
6486

6587
{
6688
printf 'profile\tcrate\tversion\n'
6789
for profile in $profiles; do
6890
echo "pingora dependency policy: cargo tree $profile" >&2
6991
capture_tree "$profile"
70-
grep -Eo 'pingora[-_a-z]* v[0-9][^ )]*' "$out_dir/cargo-tree/$profile.txt" \
71-
| sed 's/ v/\t/' \
72-
| sort -u \
73-
| while IFS="$(printf '\t')" read -r crate version; do
74-
printf '%s\t%s\t%s\n' "$profile" "$crate" "$version"
75-
done || true
92+
extract_pingora_crates "$profile"
7693
done
7794
} >"$current_tsv"
7895

@@ -93,6 +110,54 @@ awk -F '\t' '
93110
comm -23 "$current_keys" "$exception_keys" >"$unexpected"
94111
comm -13 "$current_keys" "$exception_keys" >"$stale"
95112

113+
awk -F '\t' -v current_version="$current_version" -v current_keys="$current_keys" '
114+
function compare_version(left, right, left_parts, right_parts, i) {
115+
sub(/^v/, "", left)
116+
sub(/^v/, "", right)
117+
split(left, left_parts, /[^0-9]+/)
118+
split(right, right_parts, /[^0-9]+/)
119+
for (i = 1; i <= 3; i++) {
120+
if (left_parts[i] !~ /^[0-9]+$/ || right_parts[i] !~ /^[0-9]+$/) {
121+
return "invalid"
122+
}
123+
if ((left_parts[i] + 0) < (right_parts[i] + 0)) {
124+
return -1
125+
}
126+
if ((left_parts[i] + 0) > (right_parts[i] + 0)) {
127+
return 1
128+
}
129+
}
130+
return 0
131+
}
132+
BEGIN {
133+
while ((getline key < current_keys) > 0) {
134+
current[key] = 1
135+
}
136+
close(current_keys)
137+
if (compare_version(current_version, "0.0.0") == "invalid") {
138+
print "pingora dependency policy: invalid current version " current_version > "/dev/stderr"
139+
exit 2
140+
}
141+
}
142+
/^[[:space:]]*#/ { next }
143+
NF == 0 { next }
144+
$1 == "profile" { next }
145+
NF < 4 { next }
146+
{
147+
key = $1 "\t" $2
148+
if (key in current) {
149+
comparison = compare_version(current_version, $3)
150+
if (comparison == "invalid") {
151+
print "pingora dependency policy: invalid removal_target " $3 " for " key > "/dev/stderr"
152+
exit 2
153+
}
154+
if (comparison >= 0) {
155+
print $1 "\t" $2 "\t" $3
156+
}
157+
}
158+
}
159+
' "$exceptions" | sort -u >"$expired"
160+
96161
if [ -s "$unexpected" ]; then
97162
echo "pingora dependency policy: unexpected Pingora crates:" >&2
98163
cat "$unexpected" >&2
@@ -103,7 +168,12 @@ if [ -s "$stale" ]; then
103168
cat "$stale" >&2
104169
fi
105170

106-
if [ "$mode" = "check" ] && { [ -s "$unexpected" ] || [ -s "$stale" ]; }; then
171+
if [ -s "$expired" ]; then
172+
echo "pingora dependency policy: expired Pingora exceptions still present for Fluxheim $current_version:" >&2
173+
cat "$expired" >&2
174+
fi
175+
176+
if [ "$mode" = "check" ] && { [ -s "$unexpected" ] || [ -s "$stale" ] || [ -s "$expired" ]; }; then
107177
exit 1
108178
fi
109179

0 commit comments

Comments
 (0)