Skip to content

Commit a0c1d6f

Browse files
committed
fix: full clone for commit checkout, explicit pip/pytest symlinks
- Use full clone (not --depth 50) when checking out specific commits - Use explicit /usr/bin/python3 and /usr/bin/pip3 paths for symlinks - Install pytest and create symlink in /usr/bin/pytest - Fixes 'pytest not found' and clone failures on older commits
1 parent 80a3a0c commit a0c1d6f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/executor.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -735,11 +735,12 @@ async fn run_task_on_basilica(
735735

736736
let repo_url = &task.workspace.repo;
737737
let clone_cmd = if let Some(ref commit) = task.workspace.base_commit {
738+
// Full clone needed to reach arbitrary commits
738739
format!(
739-
"mkdir -p {work_dir} && git clone --depth 50 --single-branch {repo_url} {work_dir}/repo && cd {work_dir}/repo && git checkout {commit}",
740+
"mkdir -p {work_dir} && git clone {repo_url} {work_dir}/repo && cd {work_dir}/repo && git checkout {commit}",
740741
)
741742
} else {
742-
format!("mkdir -p {work_dir} && git clone --depth 50 --single-branch {repo_url} {work_dir}/repo")
743+
format!("mkdir -p {work_dir} && git clone --depth 1 --single-branch {repo_url} {work_dir}/repo")
743744
};
744745

745746
let (_, stderr, exit) = ssh_exec(host, port, user, &clone_cmd, timeout, ssh_key).await?;
@@ -758,9 +759,10 @@ async fn run_task_on_basilica(
758759
let base_tools = format!(
759760
"sudo apt-get update -qq && \
760761
sudo apt-get install -y -qq git curl build-essential python3 python3-pip python3-venv unzip > /dev/null 2>&1 && \
761-
sudo ln -sf $(command -v python3) /usr/local/bin/python 2>/dev/null; \
762-
sudo ln -sf $(command -v pip3) /usr/local/bin/pip 2>/dev/null; \
763-
sudo python3 -m pip install --break-system-packages pytest 2>/dev/null; true"
762+
sudo ln -sf /usr/bin/python3 /usr/local/bin/python 2>/dev/null; \
763+
sudo ln -sf /usr/bin/pip3 /usr/local/bin/pip 2>/dev/null; \
764+
sudo python3 -m pip install --break-system-packages pytest > /dev/null 2>&1; \
765+
sudo ln -sf /usr/local/bin/pytest /usr/bin/pytest 2>/dev/null; true"
764766
);
765767
let (_, _, exit) = ssh_exec(host, port, user, &base_tools, timeout, ssh_key).await?;
766768
if exit != 0 {

0 commit comments

Comments
 (0)