ci: add PR + push-to-main workflow (fmt/clippy/test/build) + ip-allowlist deny integration test - #5
Merged
Merged
Conversation
…owlist deny integration test Adds .github/workflows/ci.yml so pull requests and pushes to main are gated on fmt (nightly), clippy (-D warnings), test, and a release build — until now the only automation was release.yml (tags/dispatch), so modules could land with no build/lint/test. Runners are GitHub-hosted, matching release.yml's rule that these pure-Rust modules must not contend with the ephemerd fleet. Also extends the integration-test coverage: the existing ratelimit and maintenance-mode integration binaries only assert the fail-OPEN CONTINUE verdict. A new ip-allowlist tests/deny.rs drives the shipped shell crate's IpAllowlist through the host feature's RequestCtx/host_table and asserts the fail-CLOSED path — a real 403 RESPOND. No ephpm binary or KV store needed, so it is deterministic and not flaky.
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
Adds the missing PR + push-to-main CI gate for the middleware modules. Until now the only automation was
release.yml(tags /workflow_dispatch), so the 8 modules could land with no automated build, lint, or test. This closes that hole..github/workflows/ci.ymlTriggers on
pull_requestandpushtomain, with aconcurrencygroup that cancels superseded runs. All runners are GitHub-hostedubuntu-latest— mirroringrelease.yml, these pure-Rust modules must not contend with the self-hosted ephemerd fleet. Toolchains are pinned explicitly (the repo has no default rustup toolchain, and fmt needs nightly). Jobs:cargo +nightly fmt --all -- --check(nightly + rustfmt; the repo'srustfmt.tomluses unstable options).cargo clippy --workspace --all-targets -- -D warnings(stable).cargo test --workspace(stable).CARGO_NET_GIT_FETCH_WITH_CLI=trueset workflow-wide so the git-depephpm-middlewareABI crate fetches.cargo build --workspace --release, proving every cdylib links before a release tag would catch it.Integration coverage: ip-allowlist deny → 403
Deliverable 2 asked for an e2e/integration job that exercises a built module through the ABI. Option (a) — a Rust integration test driving a module via the
hostfeature — already exists forratelimitandmaintenance-mode, but both only assert the fail-OPEN CONTINUE verdict. I extended that pattern to the opposite, security-relevant path:crates/ephpm-middleware-ip-allowlist/tests/deny.rsdrives the shell crate'sIpAllowlist(the crate that becomes the shipped cdylib) through thehostfeature'sRequestCtx/host_table()and asserts the fail-CLOSED verdict — a real403RESPOND(action, status, and non-empty body), plus deny-beats-allow. It needs noephpmbinary and no KV store (the verdict is pure CIDR policy), so it is deterministic and never flaky — exactly the boundary the task preferred.Why not a true downloaded-binary e2e (option b): it would need a released
ephpmwhose ABI major matches this repo's pinned rev, a mounted cdylib, and a live curl — heavy and flaky (release availability + ABI-major skew) for no coverage the in-process ABI test doesn't already give. Thehost-feature integration test is the right boundary; a full e2e belongs to the release/host repos, not this PR gate.Verification
Ran the exact workflow commands locally (shared target cache,
CARGO_NET_GIT_FETCH_WITH_CLI=true), all green:cargo +nightly fmt --all -- --check— cleancargo clippy --workspace --all-targets -- -D warnings— clean (-D warningsnot weakened)cargo test --workspace— 80 unit +ratelimitfail_open (1) +maintenance-modefail_open (1) + newip-allowlistdeny (2) = 84 tests, 0 failurescargo build --workspace --release— all 8 cdylibs linkThis PR is the first to exercise the new workflow.