mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-17 15:34:54 +00:00
follow the vendored tree to its new path
The move to vendor/ left four references behind. check-codex-path-deps.sh
hard-failed every build ("Expected both code-rs/ and codex-rs/"), and the
auto-review scope excluded a prefix that now matches nothing — so all 5,624
vendored files were eligible for review context. That exclusion is vendor/
now, which covers whatever else we vendor later.
This commit is contained in:
@@ -525,7 +525,7 @@ jobs:
|
||||
GH_TOKEN: ${{ secrets.CODE_GH_PAT || github.token }}
|
||||
MERGE_MODE: ${{ steps.prep.outputs.merge_mode || 'one-shot' }}
|
||||
OURS_GLOBS: |
|
||||
codex-rs/tui/**
|
||||
vendor/codex/tui/**
|
||||
codex-cli/**
|
||||
.github/workflows/**
|
||||
AGENTS.md
|
||||
@@ -585,7 +585,7 @@ jobs:
|
||||
- Do NOT blanket-delete new crates or reintroduced paths. Surface noteworthy cases in MERGE_REPORT.md and make a reasoned choice.
|
||||
- For any path listed in purge_globs or perma_removed_paths, ensure it remains deleted if upstream reintroduced it.
|
||||
- Review the upstream commit range (e.g., via `git rev-list upstream/UPSTREAM_BRANCH ^origin/DEFAULT_BRANCH`). Use repo context and the provided artifacts to make sensible, minimal decisions. Prefer preserving our local UX/branding and workflows; adopt upstream when it improves correctness, security, or compatibility. Record notable decisions in MERGE_REPORT.md.
|
||||
5) Resolve lockfile conflicts early: if `codex-rs/Cargo.lock` contains merge markers or becomes out of sync with the workspace manifests, regenerate it inside `codex-rs/` (e.g., `cargo update --workspace --locked`; fall back to `cargo update --workspace` if the locked run fails). Commit the regenerated lock as part of the merge and note the action in MERGE_REPORT.md. Prefer preserving our crate versions, but do not leave conflict markers in place.
|
||||
5) Resolve lockfile conflicts early: if `vendor/codex/Cargo.lock` contains merge markers or becomes out of sync with the workspace manifests, regenerate it inside `vendor/codex/` (e.g., `cargo update --workspace --locked`; fall back to `cargo update --workspace` if the locked run fails). Commit the regenerated lock as part of the merge and note the action in MERGE_REPORT.md. Prefer preserving our crate versions, but do not leave conflict markers in place.
|
||||
6) Compatibility (do not break callers):
|
||||
- Keep these public re-exports in codex-core: ModelClient, Prompt, ResponseEvent, ResponseStream.
|
||||
Removing them breaks downstream imports and will fail API tests.
|
||||
@@ -634,7 +634,7 @@ jobs:
|
||||
-c sandbox_workspace_write.allow_git_writes=true \
|
||||
-c sandbox_workspace_write.network_access=true \
|
||||
-c shell_environment_policy.r#set.CARGO_HOME="${RUNNER_TEMP}/cargo-home" \
|
||||
-c shell_environment_policy.r#set.CARGO_TARGET_DIR="${GITHUB_WORKSPACE}/codex-rs/target" \
|
||||
-c shell_environment_policy.r#set.CARGO_TARGET_DIR="${GITHUB_WORKSPACE}/vendor/codex/target" \
|
||||
-c shell_environment_policy.r#set.RUSTC_WRAPPER="sccache" \
|
||||
-c shell_environment_policy.r#set.SCCACHE_GHA_ENABLED="true" \
|
||||
-c shell_environment_policy.r#set.SCCACHE_IDLE_TIMEOUT="1800" \
|
||||
@@ -723,7 +723,7 @@ jobs:
|
||||
- Restore or add back missing public re-exports in codex-core that cause `cargo check --tests` to fail (e.g., ModelClient, Prompt, ResponseEvent, ResponseStream), unless you can conclusively update all workspace imports safely.
|
||||
- Prefer adding compatibility aliases over large refactors.
|
||||
- Do not remove or rename crates. Do not drop ICU/sys-locale unless unused repo-wide.
|
||||
- If verification failed due to `codex-rs/Cargo.lock` parse errors or merge markers, regenerate the lock inside `codex-rs/` (try `cargo update --workspace --locked`; fall back to `cargo update --workspace` if necessary) and include the updated file in the fix.
|
||||
- If verification failed due to `vendor/codex/Cargo.lock` parse errors or merge markers, regenerate the lock inside `vendor/codex/` (try `cargo update --workspace --locked`; fall back to `cargo update --workspace` if necessary) and include the updated file in the fix.
|
||||
- Run scripts/upstream-merge/verify.sh and iterate until it returns success.
|
||||
- Update .github/auto/MERGE_REPORT.md with a short note under "Other changes" describing the compatibility adjustments.
|
||||
- Push to ${MERGE_BRANCH}.
|
||||
@@ -747,7 +747,7 @@ jobs:
|
||||
-c sandbox_workspace_write.allow_git_writes=true \
|
||||
-c sandbox_workspace_write.network_access=true \
|
||||
-c shell_environment_policy.r#set.CARGO_HOME="${RUNNER_TEMP}/cargo-home" \
|
||||
-c shell_environment_policy.r#set.CARGO_TARGET_DIR="${GITHUB_WORKSPACE}/codex-rs/target" \
|
||||
-c shell_environment_policy.r#set.CARGO_TARGET_DIR="${GITHUB_WORKSPACE}/vendor/codex/target" \
|
||||
-c shell_environment_policy.r#set.RUSTC_WRAPPER="sccache" \
|
||||
-c shell_environment_policy.r#set.SCCACHE_GHA_ENABLED="true" \
|
||||
-c shell_environment_policy.r#set.SCCACHE_IDLE_TIMEOUT="1800" \
|
||||
@@ -813,8 +813,8 @@ jobs:
|
||||
if [ -n "$files" ]; then echo "$files" | xargs -r git rm -f --; removed=true; fi
|
||||
done
|
||||
# Belt-and-suspenders: drop any accidentally committed cargo cache dirs
|
||||
# Cover both repo-root and nested workspace (e.g., codex-rs/.cargo-home)
|
||||
for d in .cargo-home .cargo2 codex-rs/.cargo-home codex-rs/.cargo2; do
|
||||
# Cover both repo-root and nested workspace (e.g., vendor/codex/.cargo-home)
|
||||
for d in .cargo-home .cargo2 vendor/codex/.cargo-home vendor/codex/.cargo2; do
|
||||
files=$(git ls-files -- "$d/**" || true)
|
||||
if [ -n "$files" ]; then echo "$files" | xargs -r git rm -f --; removed=true; fi
|
||||
done
|
||||
@@ -847,7 +847,7 @@ jobs:
|
||||
# Guide-only branding report: detect user-visible 'Codex' strings under TUI/CLI affected by this merge.
|
||||
mkdir -p .github/auto
|
||||
: > .github/auto/VERIFY_branding.log
|
||||
changed_files=$(git diff --name-only "origin/${DEFAULT_BRANCH}..origin/upstream-merge" -- 'codex-rs/tui/**' 'codex-cli/**' | tr '\n' ' ' || true)
|
||||
changed_files=$(git diff --name-only "origin/${DEFAULT_BRANCH}..origin/upstream-merge" -- 'vendor/codex/tui/**' 'codex-cli/**' | tr '\n' ' ' || true)
|
||||
if [ -n "${changed_files:-}" ]; then
|
||||
echo "[branding] scanning changed TUI/CLI files for user-visible 'Codex' strings..." | tee -a .github/auto/VERIFY_branding.log
|
||||
git diff -U0 --no-color "origin/${DEFAULT_BRANCH}..origin/upstream-merge" -- $changed_files \
|
||||
@@ -909,14 +909,14 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# Only run if upstream delta touched TUI
|
||||
if ! grep -q '^codex-rs/tui/' .github/auto/DELTA_FILES.txt 2>/dev/null; then
|
||||
if ! grep -q '^vendor/codex/tui/' .github/auto/DELTA_FILES.txt 2>/dev/null; then
|
||||
echo "No TUI changes in upstream delta; skipping invariants guard."; exit 0
|
||||
fi
|
||||
# Verify critical ordering identifiers exist somewhere under codex-rs/tui/
|
||||
# Verify critical ordering identifiers exist somewhere under vendor/codex/tui/
|
||||
failed=0
|
||||
for token in request_ordinal output_index sequence_number; do
|
||||
if ! git ls-tree -r --name-only origin/upstream-merge -- 'codex-rs/tui/**' | while read -r f; do git show "origin/upstream-merge:$f" || true; done | grep -q "$token"; then
|
||||
echo "::warning::Invariant token '$token' not found under codex-rs/tui on upstream-merge (non-blocking)." >&2
|
||||
if ! git ls-tree -r --name-only origin/upstream-merge -- 'vendor/codex/tui/**' | while read -r f; do git show "origin/upstream-merge:$f" || true; done | grep -q "$token"; then
|
||||
echo "::warning::Invariant token '$token' not found under vendor/codex/tui on upstream-merge (non-blocking)." >&2
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
+2
-2
@@ -194,7 +194,7 @@ fi
|
||||
|
||||
REPO_ROOT="${SCRIPT_DIR}"
|
||||
|
||||
# Guard against regressions where a code-rs crate references ../codex-rs.
|
||||
# Guard against regressions where a code-rs crate references the vendored tree.
|
||||
if [ "${BUILD_FAST_SKIP_CODEX_GUARD:-0}" != "1" ]; then
|
||||
echo "Running codex path dependency guard..."
|
||||
(
|
||||
@@ -234,7 +234,7 @@ esac
|
||||
|
||||
case "$WORKSPACE_CHOICE" in
|
||||
codex|codex-rs)
|
||||
WORKSPACE_DIR="codex-rs"
|
||||
WORKSPACE_DIR="vendor/codex"
|
||||
CRATE_PREFIX="codex"
|
||||
;;
|
||||
code|code-rs)
|
||||
|
||||
@@ -102,7 +102,7 @@ use code_core::timeboxed_exec_guidance::{
|
||||
const AUTO_REVIEW_SHUTDOWN_GRACE_MS: u64 = 1_500;
|
||||
const REVIEW_SCOPE_MAX_LISTED_PATHS: usize = 120;
|
||||
const REVIEW_SCOPE_EXCLUDED_PREFIXES: [&str; 5] = [
|
||||
"codex-rs/",
|
||||
"vendor/",
|
||||
"node_modules/",
|
||||
"target/",
|
||||
".git/",
|
||||
@@ -2826,7 +2826,7 @@ mod tests {
|
||||
fn apply_commit_scope_filters_and_truncates_paths() {
|
||||
let mut paths = vec![
|
||||
"./src/main.rs".to_string(),
|
||||
"codex-rs/Cargo.lock".to_string(),
|
||||
"vendor/codex/Cargo.lock".to_string(),
|
||||
"./src/main.rs".to_string(),
|
||||
];
|
||||
for idx in 0..130 {
|
||||
@@ -2844,19 +2844,19 @@ mod tests {
|
||||
let scoped = apply_commit_scope_to_review_request(request, "abc1234", "def5678", Some(&paths));
|
||||
assert!(scoped.prompt.contains("Files changed in this snapshot:"));
|
||||
assert!(scoped.prompt.contains("- src/main.rs"));
|
||||
assert!(!scoped.prompt.contains("codex-rs/Cargo.lock"));
|
||||
assert!(!scoped.prompt.contains("vendor/codex/Cargo.lock"));
|
||||
assert!(
|
||||
scoped
|
||||
.prompt
|
||||
.contains("Omitted 12 changed path(s) from this list (1 excluded by path policy; 11 truncated for prompt size).")
|
||||
);
|
||||
assert!(scoped.prompt.contains("Excluded prefixes: codex-rs/"));
|
||||
assert!(scoped.prompt.contains("Excluded prefixes: vendor/"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn apply_commit_scope_reports_when_all_paths_excluded() {
|
||||
let paths = vec![
|
||||
"codex-rs/Cargo.lock".to_string(),
|
||||
"vendor/codex/Cargo.lock".to_string(),
|
||||
"target/debug/code".to_string(),
|
||||
"node_modules/pkg/index.js".to_string(),
|
||||
];
|
||||
@@ -2876,7 +2876,7 @@ mod tests {
|
||||
.prompt
|
||||
.contains("Omitted 3 changed path(s) from this list (3 excluded by path policy; 0 truncated for prompt size).")
|
||||
);
|
||||
assert!(scoped.prompt.contains("Excluded prefixes: codex-rs/"));
|
||||
assert!(scoped.prompt.contains("Excluded prefixes: vendor/"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -12,18 +12,18 @@ if command -v git >/dev/null 2>&1; then
|
||||
fi
|
||||
|
||||
CODE_RS_DIR="$ROOT_DIR/code-rs"
|
||||
FORBIDDEN_DIR="$ROOT_DIR/codex-rs"
|
||||
FORBIDDEN_DIR="$ROOT_DIR/vendor/codex"
|
||||
|
||||
if [[ ! -d "$CODE_RS_DIR" || ! -d "$FORBIDDEN_DIR" ]]; then
|
||||
echo "ERROR: Expected both code-rs/ and codex-rs/ to exist next to this script." >&2
|
||||
echo "ERROR: Expected both code-rs/ and vendor/codex/ to exist next to this script." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
violations=0
|
||||
|
||||
echo "Scanning Cargo manifests under code-rs/ for forbidden ../codex-rs references…"
|
||||
echo "Scanning Cargo manifests under code-rs/ for forbidden vendor/codex references…"
|
||||
while IFS= read -r -d '' cargo_file; do
|
||||
matches=$(grep -nE '\\.\\./codex-rs|codex-[^\"]*\s*=\s*\{[^}]*path' "$cargo_file" || true)
|
||||
matches=$(grep -nE 'vendor/codex|codex-[^\"]*\s*=\s*\{[^}]*path' "$cargo_file" || true)
|
||||
if [[ -z "$matches" ]]; then
|
||||
continue
|
||||
fi
|
||||
@@ -55,8 +55,8 @@ fi
|
||||
|
||||
if [[ $violations -ne 0 ]]; then
|
||||
echo "" >&2
|
||||
echo "ERROR: Forbidden ../codex-rs path dependencies detected. Remove them before proceeding." >&2
|
||||
echo "ERROR: Forbidden vendor/codex path dependencies detected. Remove them before proceeding." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ No forbidden ../codex-rs dependencies detected in code-rs/."
|
||||
echo "✅ No forbidden vendor/codex dependencies detected in code-rs/."
|
||||
|
||||
Reference in New Issue
Block a user