Refactor egress allowlist experiment names to dash-case - #252
Merged
AbhishekBhaskar merged 1 commit intoSep 16, 2026
Merged
AbhishekBhaskar merged 1 commit into
AbhishekBhaskar merged 1 commit into
Conversation
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The regression test can pass while the handler remains fail-open; it should assert an observe-only side effect.
Review tier: Lite (auto)
Findings: None
Note
Copilot is running an experiment and ran this review at Lite.
What changed in this PR
Fixes egress allowlist experiment matching by aligning proxy constants with the API’s dash-case keys.
Changes:
- Renamed observe/enforce experiment constants.
- Updated integration tests.
- Added dash-case regression coverage.
| File | Summary |
|---|---|
proxy_test.go |
Uses dash-case experiment keys. |
internal/handlers/egress_allowlist.go |
Updates experiment constants and documentation. |
internal/handlers/egress_allowlist_test.go |
Adds dash-case contract testing. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
AbhishekBhaskar
force-pushed
the
abhishekbhaskar/refactor-egress-allowlist-experiment-key-names
branch
from
September 16, 2026 16:04
7d60bc5 to
eb14852
Compare
AbhishekBhaskar
deleted the
abhishekbhaskar/refactor-egress-allowlist-experiment-key-names
branch
September 16, 2026 16:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are you trying to accomplish?
Fix a dash/underscore key mismatch between the proxy and the API for the egress-allowlist experiment flags.
The proxy read the observe/enforce experiments as
proxy_egress_observe/proxy_egress_enforce(underscores). But the API serializes job experiments through the JSON:API adapter, whose default key transform is dash — so in the job-details payload the keys actually arrive asproxy-egress-observe/proxy-egress-enforce, like every other forwarded experiment. With the underscore keys,Experiments.Enabled(...)never matched, so the egress allowlist would silently stay in fail-open mode no matter how the experiment was configured.This renames the constants to dash-case so the flags actually activate when the experiment is enabled.
Anything you want to highlight for special attention from reviewers?
TestProxyEgressAllowlistEnforceBlocks/TestProxyEgressAllowlistObserveAllows) that hard-coded the old underscore keys — otherwise they'd have silently stopped exercising enforce/observe.Enabled("proxy-egress-observe")is true on a dash-keyed experiments map, that the underscore form does not match, and that a handler built from the dash-keyed payload enters observe mode.How will you know you've accomplished your goal?
TestEgressAllowlist_DashCasedExperimentKeyslocks in the dash-key behavior.gofmt/go vetpass locally (go test ./...).Checklist