Skip to content

test(git_seed): the registry-token secret test runs on APFS (macOS base red) - #32091

Merged
lawrencecchen merged 2 commits into
feat-cmux-nextfrom
fix-gitseed-apfs
Nov 2, 2026
Merged

lawrencecchen merged 2 commits into
feat-cmux-nextfrom
fix-gitseed-apfs

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Base red on macOS: cmux-tui-core git_seed::secrets::tests::registry_files_with_tokens_are_secrets panics on every macOS run before it checks anything. Its fixture makes a folder named b"bad-\xff" to prove that a path that is not UTF-8 is read by its raw bytes. APFS refuses a name that is not UTF-8 (EILSEQ, os error 92, "Illegal byte sequence").

The fix is test-only. It keeps the test's intent, a secret file found by its content:

  • A subfolder case with a valid name runs on every filesystem: pkg/.npmrc with a token, pkg/.pypirc without, and the root .pypirc rewritten with a password. Reading the wrong file gives a different answer.
  • Each .npmrc case now expects the exact reason "package registry credentials file with a token", so an unreadable or lossy-path read (which gets "could not be read") fails.
  • The non-UTF-8 case runs where the filesystem takes raw bytes. It is skipped only on macOS and only for EILSEQ, because no APFS seed can hold such a name. Every other error still fails. The Linux runs of the cmux-tui tests (scripts/ci/cmux-tui-rust-check.sh test --os linux, cmux-tui.yml test (linux)) still run that case.

No product code changes.

Testing

Command (fleet): cmux-ci run --class isolated --os macos --script scripts/ci/cmux-tui-rust-check.sh --ref SHA --arg test --arg git_seed::secrets

  • Red on macOS at the base, feat-cmux-next b143deb: step 5fb7dd8d93ace8e2d40b4c1d (aws-m4pro-3), panic "Illegal byte sequence". The same failure is at ba78061 (step c92c3254b609eeacf5ca6df1).
  • Green on macOS at ea1e0d2, 5 of 5: 05fd3ba626a21e5d5c63ae9f, 864a5fc61fdb49f4e859b2b3, 48afcae0dcb1a57bf1ea78a5, 171f66400643bc0ebaabcfbf, 46b6acc54be151851e10c15f.
  • Green on Linux at the head (the non-UTF-8 case runs there): 50815d3bdf2d381cb8309f24.

Observed / Not run

  • Observed: the fleet steps above.
  • Not run: the full cmux-tui suite. Only this module's tests ran.

Changelog

none

Proof

No capture: test-only change.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes the git_seed registry-token secret test so it runs on macOS (APFS), where creating the fixture's non-UTF-8 directory name (bad-\xff) fails with EILSEQ and panicked before any assertion.

  • Adds a subfolder case with valid UTF-8 names (pkg/.npmrc with a token, pkg/.pypirc without) that runs on every filesystem.
  • Skips the non-UTF-8 fixture only on macOS and only for EILSEQ; all other errors still fail, and the Linux test lane still covers that case.
  • Each .npmrc case now asserts the exact reason "package registry credentials file with a token", so reading an unreadable or wrong-path file fails instead of passing.
  • Test-only change; no product code.

Written for commit ea1e0d2. Summary will update on new commits.

View guided diff Turn on auto-fix

… on macOS)

registry_files_with_tokens_are_secrets made a folder named b"bad-\xff" to
prove a non-UTF-8 path is read by its raw bytes. APFS refuses a name that
is not UTF-8 (EILSEQ, "Illegal byte sequence"), so the test panicked on
every macOS run before it checked anything.

- A subfolder case with a valid name (pkg/.npmrc with a token, pkg/.pypirc
  without) keeps the intent, a secret file found by its content, on every
  filesystem.
- The non-UTF-8 case runs where the filesystem takes raw bytes; on macOS,
  and only for EILSEQ, it is skipped: no APFS seed can hold such a name,
  and the Linux cmux-tui lane runs the case.
…y or wrong-path read fails

Review follow-up: an unreadable registry file also counts as a secret, so
is_some() passed when the wrong path was read. Each .npmrc case now expects
'with a token', and the root .pypirc holds a password while pkg/.pypirc
does not, so reading one for the other gives another answer.
@lawrencecchen lawrencecchen added the risk:low Risk tier (docs/ci/risk-tiers.md) label Nov 2, 2026
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Review (subagent, correctness first): SHIP at ea1e0d2

Independent review subagent (read only), in two passes. The skip is narrow: cfg!(target_os = "macos") && raw_os_error() == Some(libc::EILSEQ), and every other result unwraps and asserts. libc is an unconditional dependency, and the module is #[cfg(unix)]. Pass 1 found weak is_some() asserts, which also pass on an unreadable file; pass 2 at the head confirmed the exact-reason asserts and distinct root and pkg/ contents now catch a wrong-path or lossy read. The test order is right, and the in-fn const trips no enabled clippy lint. Note: the per-push fast-tier-cargo job does not run this test; the Linux fleet step and cmux-tui.yml test (linux) do.

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review ea1e0d2: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr32091 -f ref=fix-gitseed-apfs -f platform=macos -f backend_mode=local

Shipped in:

@lawrencecchen lawrencecchen added the ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds label Nov 2, 2026
@github-actions github-actions Bot added risk:normal Risk tier (docs/ci/risk-tiers.md) and removed risk:low Risk tier (docs/ci/risk-tiers.md) labels Nov 2, 2026
@lawrencecchen
lawrencecchen merged commit 1f28075 into feat-cmux-next Nov 2, 2026
215 of 235 checks passed
@lawrencecchen
lawrencecchen deleted the fix-gitseed-apfs branch November 2, 2026 10:14
cmux-bot Bot pushed a commit that referenced this pull request Nov 4, 2026
… APFS (macOS base red) (#35889)

a_secret_with_a_non_utf8_name_is_left_out (#30923) and a_secret_with_a_non_utf8_name_never_goes
(#30633) create a file named b".env-\xff". APFS refuses a name that is not UTF-8 (EILSEQ,
'Illegal byte sequence'), so both panicked at setup on every macOS run since they landed; no
folder on macOS can hold such a secret, so the product path they check cannot meet one there.
They now accept EILSEQ on macOS only, as git_seed/secrets.rs does since #32091; on Linux
(ext4 takes raw bytes) the assertions run unchanged.

This branch was previously deployed

3 inactive deployments
artifacts — ea1e0d2e Deployed Nov 2, 2026 by lawrencecchen via publish tree-addressed cmux-tui #100461
sentry-dsyms — ea1e0d2e Deployed Nov 2, 2026 by lawrencecchen via upload cmux-tui dSYMs to Sentry #100461
ci-routing-agent — ea1e0d2e Deployed Nov 2, 2026 by lawrencecchen via cmux-tui tree preflight #100461
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant