Code Room
Code reviewHard
Question
Review this Python CI service that clones a user-supplied repo URL, correctly avoiding the shell.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
import subprocess, os def clone(repo_url, build_id): dest = os.path.join('/tmp/builds', build_id) os.makedirs(dest, exist_ok=True) subprocess.run( ['git', 'clone', '--depth', '1', repo_url, dest], check=True, timeout=120, capture_output=True, ) return destRun or narrate your approach, then ask the coach.