fix: allow requirements/updater.sh to run outside the AWX container#16362
fix: allow requirements/updater.sh to run outside the AWX container#16362TheRealHaoLiu wants to merge 1 commit intoansible:develfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughShebang changed to bash; venv creation selects Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
requirements/updater.sh (1)
1-2: Consider changing shebang to#!/bin/bashfor portability.The script uses bash-specific features (
[[ ]],source, parameter expansion patterns) but declares#!/bin/sh. Since this PR enables running outside the container, the script may encounter systems where/bin/shis dash or another POSIX shell, causing failures.Proposed fix
-#!/bin/sh +#!/bin/bash set -ueAlso applies to: 36-36
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@requirements/updater.sh` around lines 1 - 2, Change the script shebang from a POSIX shell to bash because the script uses bash-only constructs (e.g., the shebang line, test expressions like [[ ]], use of source, and bash parameter expansion patterns); update the top line to use bash and scan the script (notably the conditional/test usages and any lines around the parameter expansions such as around the existing [[ ... ]] and source calls) to ensure they rely on bash semantics so the script runs correctly on systems where /bin/sh is not bash.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@requirements/updater.sh`:
- Around line 1-2: Change the script shebang from a POSIX shell to bash because
the script uses bash-only constructs (e.g., the shebang line, test expressions
like [[ ]], use of source, and bash parameter expansion patterns); update the
top line to use bash and scan the script (notably the conditional/test usages
and any lines around the parameter expansions such as around the existing [[ ...
]] and source calls) to ensure they rely on bash semantics so the script runs
correctly on systems where /bin/sh is not bash.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0bc0289d-b86a-4ca4-bf20-1bca4bfc5b2e
📒 Files selected for processing (1)
requirements/updater.sh
879947f to
05ba4ac
Compare
- Change shebang to #!/bin/bash since the script uses bash-specific features ([[ ]], source, parameter expansion patterns) - Prefer /usr/bin/python3.12 when available (as in the container), fall back to python3.12 from PATH otherwise - Use python3 instead of python for tempfile creation - Detect pip-compile from pyenv or PATH and reuse it (with existing flags preserved) to avoid a network download of pip-tools when already available; falls back to installing pip-tools into the venv if not found - Search pyenv 3.12 envs first (most specific), then pyenv active version, then PATH to ensure a Python 3.12 pip-compile is preferred - Fix pip-compile detection to use explicit non-empty checks instead of a find|head -1 pipeline (which always exits 0, making later fallbacks unreachable) - Remove the /awx_devel guard that blocked execution outside the container Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
05ba4ac to
9c101bf
Compare
|




Summary
/usr/bin/python3.12when available (as in the container), fall back topython3.12from PATH otherwisepython3instead ofpythonfor tempfile creationpip-compilefrom pyenv or PATH and reuse it (preserving flags like--upgrade) to avoid a network download of pip-tools when already available; falls back to installing pip-tools into the venv if not found/awx_develguard that blocked execution outside the containerTest plan
bash updater.sh runoutside the container — resolves pip-compile from host pyenv, generates correctrequirements.txtwith paths normalized to/awx_devel/requirements/bash updater.sh runinside the AWX docker-compose container — uses/usr/bin/python3.12, installs pip-tools from PyPI, generates correct output🤖 Generated with Claude Code
Note
Medium Risk
Changes the dependency pinning workflow by altering interpreter/tool selection (python3.12/pip-compile), which could produce different
requirements.txtoutput depending on the host environment. Impact is limited to build/dependency maintenance tooling, not runtime application code.Overview
Makes
requirements/updater.shrunnable outside the AWX container by switching tobash, removing the/awx_develexecution guard, and usingpython3for temp-dir creation.Updates the venv/tooling setup to prefer
/usr/bin/python3.12when available (fallback topython3.12on PATH), pin onlypip==25.3in the venv, and reuse an existingpip-compilefrom pyenv/PATH (preserving flags like--upgrade) before falling back to installingpip-tools.Written by Cursor Bugbot for commit 9c101bf. This will update automatically on new commits. Configure here.
Summary by CodeRabbit