Skip to content

Use native Codex Cloud environment and remove Codex-specific launcher test - #3836

Closed
max-sixty wants to merge 1 commit into
mainfrom
codex/remove-codex-cloud-specific-tests-tn31ip
Closed

Use native Codex Cloud environment and remove Codex-specific launcher test#3836
max-sixty wants to merge 1 commit into
mainfrom
codex/remove-codex-cloud-specific-tests-tn31ip

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Motivation

  • Codex Cloud environment setup should use the platform's native toolchain behavior instead of a repository-specific UID-switching Cargo wrapper and interposed tini logic.
  • The repository-owned Codex Cloud launcher synchronization test is repository-specific and unnecessary for usual CI runs and causes coupling between documentation launchers and test suite mechanics.

Description

  • Removed the Codex Cloud launcher synchronization integration test in tests/integration_tests/readme_sync.rs so README/Taskfile launcher checks no longer assert a repo-specific launcher string.
  • Simplified scripts/codex-cloud/Taskfile.yaml to stop creating a UID-switching cargo wrapper, drop tini usage, and avoid enforcing the ubuntu UID 1000 precondition; the Taskfile now prepares and runs Rustup, pre-commit, and Cargo directly using the native environment.
  • Removed chown/chmod dance targeting the ubuntu user and replaced those with straightforward directory creation and native rustup/pre-commit invocations in prepare-codex.
  • Updated scripts/codex-cloud/README.md to reflect the new Taskfile behavior and refreshed the documented TASKFILE_SHA to match the updated Taskfile.

Testing

  • Ran cargo test --test integration test_taskfile_llm_commands_match_config_example and it passed (1 passed).
  • Verified Taskfile parsing with task --taskfile scripts/codex-cloud/Taskfile.yaml --list and it succeeded.
  • Verified documented launcher checksums by checking TASKFILE_SHA lines in scripts/codex-cloud/README.md match sha256sum scripts/codex-cloud/Taskfile.yaml and the checks passed.
  • Ran git diff --check and basic repo hygiene checks and they passed; note that python3 -c 'import yaml' failed due to PyYAML not being installed in the environment, but task itself successfully parsed the YAML, so Taskfile syntax was validated.

Codex Task

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing as a draft — flagging anything that looks worth a quick fix. Mark ready for a full review.

Two things, one of which I think blocks the environment doing its job.

Running the suite as root will fail three tests. Dropping the UID-1000 switch means the README's own validation command (cargo run -- hook pre-merge --yes) now runs as root, and three tests in tests/integration_tests/step_copy_ignored.rs derive their expected failure purely from a 0o555 directory, with no root guard: test_copy_ignored_error_includes_path_directory, test_copy_ignored_error_includes_path_file, and test_copy_ignored_error_nested_file_parent_creation. Each chmods the destination to 0o555, runs wt step copy-ignored, and asserts !output.status.success() — under CAP_DAC_OVERRIDE the copy succeeds and the assertion fires. The repo already treats this as a known shape elsewhere: test_configure_shell_fish_legacy_remove_failure_warns in tests/integration_tests/configure_shell.rs probes with a scratch write and bails out with eprintln!("Skipping - running with elevated privileges") when permissions don't restrict, and remove.rs, approval_pty.rs, and approval_save.rs carry the same guard. The three copy_ignored tests never needed it because the Cargo wrapper kept them off root — which is what the deleted README line about "the suite's permission and child-reaping assumptions" was pointing at. If native behavior is the goal, the same guard on those three (or a verified full-suite Cloud run) is the missing piece; #3810 validated with hook pre-merge --yes in Cloud, and the Testing section here covers one test plus task --list.

Related but not a failure: test_list_full_survives_read_only_object_database and test_list_statusline_survives_read_only_object_database in list.rs freeze .git/objects by stripping write bits, so as root they pass without ever reaching redirect_objects_if_read_only. The coverage doesn't break, it just stops existing in this environment.

The deleted digest test is the only thing enforcing a gate the README still depends on. See the inline comment.

On tini — the paragraph being removed cited child-reaping, and the PR body drops it without saying whether that was load-bearing (zombies actually observed under cargo nextest) or belt-and-braces. Worth stating either way, since it's the one removal with no direct replacement.

Last, a judgment call rather than a rule I can point at: these are two independent changes — the digest test removal doesn't depend on the environment simplification, and either could be reverted without the other — so they'd land more cleanly as separate PRs.

}
}

#[test]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this test leaves the digest gate documented but unenforced. scripts/codex-cloud/README.md still says "The hash prevents a task branch from changing code run as root. After a reviewed Taskfile change reaches the default branch, update both environment commands", and the weekly-maintenance entry in .claude/skills/running-tend/SKILL.md still instructs "copy the Taskfile's new digest into both README launchers" for the Codex Cloud tools. With the test gone, the next Taskfile edit that forgets the README produces a mismatch that surfaces only inside Codex Cloud, at sha256sum -c - before anything runs, with no CI signal at all — and the Testing section of this PR did that comparison by hand, which is precisely what the test automated.

The TASK_VERSION extraction is the part that couples this to Taskfile internals; the digest assertion alone doesn't. If the coupling is the objection, dropping the regex and keeping the sha256sum-equivalent check would keep the guard at a fraction of the surface. Worth having a reason to lose it entirely, given the failure it catches is invisible to every check that runs here.

@max-sixty

Copy link
Copy Markdown
Owner Author

Closing as a duplicate of #3835 — the two diffs are byte-identical. Keeping #3835 as the single home for the run-as-root proposal.

This was written by Claude Code on behalf of max-sixty

@max-sixty max-sixty closed this Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants