Skip to content

refactor(ci): consolidate the CI-env scrubber into a shared testing module#1442

Open
jd wants to merge 1 commit into
devs/jd/worktree-rust-port/introduce-commandcontext-queue-freeze-prelude--1b272570from
devs/jd/worktree-rust-port/consolidate-ci-env-scrubber-shared-testing-module--cd8c8441
Open

refactor(ci): consolidate the CI-env scrubber into a shared testing module#1442
jd wants to merge 1 commit into
devs/jd/worktree-rust-port/introduce-commandcontext-queue-freeze-prelude--1b272570from
devs/jd/worktree-rust-port/consolidate-ci-env-scrubber-shared-testing-module--cd8c8441

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented May 19, 2026

with_ci_env (clear every CI-provider env var before applying
test overrides) lived in two copies — one inside the tests
sub-module of detector.rs, one inside scopes_send.rs (which
also had a with_ci_env_async counterpart). Both spelled the same
10-var list inline; both were drifting candidates.

Extract to a new crate::testing (#[cfg(test)] mod testing) with
the env-var list named as a const, sync + async variants behind one
helper that builds the override list. Each test module now does a
plain use crate::testing::with_ci_env;.

Net -71 / +51. No behavior change; the existing 49 mergify-ci
tests still pass.

Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com

Depends-On: #1441

@jd
Copy link
Copy Markdown
Member Author

jd commented May 19, 2026

This pull request is part of a Mergify stack:

# Pull Request Link
1 fix(cli): accept --debug on the Rust binary and actually toggle it in Python #1464
2 refactor(rust): share test scaffolding via mergify-test-support crate #1439
3 refactor(core): introduce CommandContext for the queue+freeze prelude #1441
4 refactor(ci): consolidate the CI-env scrubber into a shared testing module #1442 👈
5 refactor: drop stale Phase X.Y doc markers and one inline color branch #1443
6 refactor(tui): share StyledGlyph across queue show/status renderers #1444
7 refactor(queue): drop indexmap, group_by_scope returns a Vec<(K, V)> #1445
8 refactor(ci): swap uuid for getrandom in the GHA heredoc delimiter #1446
9 refactor(config): standardize the workspace on serde_yaml_ng for YAML parsing #1447
10 test(ci): add live smoke test for ci scopes select-all path #1460
11 feat(rust): port ci scopes to native Rust #1461
12 feat(ci): parse JUnit XML reports in native Rust #1465
13 feat(ci): encode JUnit cases as OTLP and upload to Mergify CI Insights #1466
14 feat(ci): promote ci junit-process from shim to native Rust #1467
15 feat(ci): promote ci junit-upload from shim to native as a deprecated alias #1468
16 fix(ci): prefer GitHub Actions PR-event head SHA over GITHUB_SHA #1469

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 19, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 ⛓️ Depends-On Requirements

Waiting for

This rule is failing.

Requirement based on the presence of Depends-On in the body of the pull request

🔴 👀 Review Requirements

Waiting for

  • #approved-reviews-by>=2
This rule is failing.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🔴 🔎 Reviews

Waiting for

  • #review-requested = 0
This rule is failing.
  • #review-requested = 0
  • #changes-requested-reviews-by = 0
  • #review-threads-unresolved = 0

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?:

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

@jd jd force-pushed the devs/jd/worktree-rust-port/introduce-commandcontext-queue-freeze-prelude--1b272570 branch from 32cbcd9 to c542b1f Compare May 19, 2026 13:04
@jd jd force-pushed the devs/jd/worktree-rust-port/consolidate-ci-env-scrubber-shared-testing-module--cd8c8441 branch from 9484593 to 3e6ba1c Compare May 19, 2026 13:04
@jd jd temporarily deployed to func-tests-live May 19, 2026 13:04 — with GitHub Actions Inactive
@jd
Copy link
Copy Markdown
Member Author

jd commented May 19, 2026

Revision history

# Type Changes Reason Date
1 initial 9484593 2026-05-19 13:04 UTC
2 rebase 9484593 → 3e6ba1c (rebase only) 2026-05-19 13:04 UTC
3 rebase 3e6ba1c → 6d57a9c (rebase only) 2026-05-19 14:15 UTC
4 rebase 6d57a9c → a946696 (rebase only) 2026-05-20 08:42 UTC
5 rebase a946696 → fcfd504 (rebase only) 2026-05-20 09:05 UTC
6 rebase fcfd504 → 2b55249 (rebase only) 2026-05-21 07:25 UTC
7 rebase 2b55249 → b12bb5c (rebase only) 2026-05-21 07:56 UTC
8 rebase b12bb5c → 8b64b4d (rebase only) 2026-05-21 12:39 UTC
9 content 8b64b4d → ab88212 2026-05-22 07:10 UTC
10 rebase ab88212 → 3f12d27 (rebase only) 2026-05-22 14:40 UTC
11 rebase 3f12d27 → 3d06f0f (rebase only) 2026-05-27 07:53 UTC
12 rebase 3d06f0f → d7c68e9 (rebase only) 2026-05-27 08:27 UTC
13 content d7c68e9 → 5b8ad61 (raw) Scrub GITHUB_OUTPUT in the canonical CI_ENV_VARS list — moved here from the Phase B expansion so PRs lower in the stack (#1465 parse JUnit XML) inherit the fix and stop hitting GHA's 'Matching delimi… 2026-05-27 10:04 UTC

@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 19, 2026 13:04 Failure
@mergify mergify Bot requested a review from a team May 19, 2026 13:19
@jd jd force-pushed the devs/jd/worktree-rust-port/consolidate-ci-env-scrubber-shared-testing-module--cd8c8441 branch from 3e6ba1c to 6d57a9c Compare May 19, 2026 14:14
@jd jd force-pushed the devs/jd/worktree-rust-port/introduce-commandcontext-queue-freeze-prelude--1b272570 branch from c542b1f to 141fec6 Compare May 19, 2026 14:14
@jd jd temporarily deployed to func-tests-live May 19, 2026 14:15 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 19, 2026 14:15 Failure
@jd jd temporarily deployed to func-tests-live May 19, 2026 14:18 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 19, 2026 14:18 — with GitHub Actions Inactive
@jd jd marked this pull request as ready for review May 19, 2026 14:57
@jd jd temporarily deployed to func-tests-live May 21, 2026 07:56 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 21, 2026 07:56 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/consolidate-ci-env-scrubber-shared-testing-module--cd8c8441 branch from b12bb5c to 8b64b4d Compare May 21, 2026 12:39
@jd jd temporarily deployed to func-tests-live May 21, 2026 12:39 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 21, 2026 12:40 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/consolidate-ci-env-scrubber-shared-testing-module--cd8c8441 branch from 8b64b4d to ab88212 Compare May 22, 2026 07:09
@jd jd temporarily deployed to func-tests-live May 22, 2026 07:10 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 22, 2026 07:10 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/consolidate-ci-env-scrubber-shared-testing-module--cd8c8441 branch from ab88212 to 3f12d27 Compare May 22, 2026 14:40
@jd jd temporarily deployed to func-tests-live May 22, 2026 14:40 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 22, 2026 14:40 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/consolidate-ci-env-scrubber-shared-testing-module--cd8c8441 branch from 3f12d27 to 3d06f0f Compare May 27, 2026 07:53
@jd jd temporarily deployed to func-tests-live May 27, 2026 07:53 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 27, 2026 07:53 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/consolidate-ci-env-scrubber-shared-testing-module--cd8c8441 branch from 3d06f0f to d7c68e9 Compare May 27, 2026 08:27
@jd jd temporarily deployed to func-tests-live May 27, 2026 08:27 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 27, 2026 08:27 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 27, 2026 08:28 Failure
…odule

`with_ci_env` (clear every CI-provider env var before applying
test overrides) lived in two copies — one inside the `tests`
sub-module of `detector.rs`, one inside `scopes_send.rs` (which
also had a `with_ci_env_async` counterpart). Both spelled the same
10-var list inline; both were drifting candidates.

Extract to a new `crate::testing` (`#[cfg(test)] mod testing`) with
the env-var list named as a const, sync + async variants behind one
helper that builds the override list. Each test module now does a
plain `use crate::testing::with_ci_env;`.

Net `-71 / +51`. No behavior change; the existing 49 `mergify-ci`
tests still pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Change-Id: Icd8c84417ad51b242cc8d9664d1cd40fff744497
@jd jd force-pushed the devs/jd/worktree-rust-port/consolidate-ci-env-scrubber-shared-testing-module--cd8c8441 branch from d7c68e9 to 5b8ad61 Compare May 27, 2026 10:04
@jd jd temporarily deployed to func-tests-live May 27, 2026 10:04 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 27, 2026 10:06 Failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant