Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions test-potel-aws-lambda/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ echo "Creating temporary directory: $TEMP_DIR"
echo "Copying function code..."
cp -r lambda_function/* $TEMP_DIR/

# Create virtual environment and install dependencies
# Install dependencies
echo "Setting up Python environment..."
python -m venv $TEMP_DIR/.venv
source $TEMP_DIR/.venv/bin/activate
pip install -r $TEMP_DIR/requirements.txt -t $TEMP_DIR/
if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
fi
uv pip install --system --no-cache -r $TEMP_DIR/pyproject.toml --target $TEMP_DIR/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

uv missing from PATH after install

Medium Severity

When uv is not already on PATH, deploy.sh runs the Astral installer and immediately calls uv pip install. The installer puts uv under ~/.local/bin and only updates future shells, so the same script can exit with “command not found” and never build the Lambda zip.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 541594f. Configure here.

Comment on lines +58 to +61

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The script installs uv but doesn't update the current shell's PATH. The subsequent uv pip install command will fail, aborting the deployment due to set -e.
Severity: CRITICAL

Suggested Fix

After the uv installation line, add source "$HOME/.local/bin/env" or export PATH="$HOME/.local/bin:$PATH" to update the PATH for the current shell session. This will ensure the uv command is found in the subsequent step.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: test-potel-aws-lambda/deploy.sh#L58-L61

Potential issue: The `deploy.sh` script attempts to install `uv` if it's not found using
the official installer. However, this installer only updates shell configuration files
for future sessions and does not modify the `PATH` of the current, running shell. The
script immediately proceeds to call `uv pip install ...` in the same session. Because
the `uv` binary's location (`~/.local/bin`) is not yet in the `PATH`, the command will
fail with a "command not found" error. Since `set -e` is active, this failure will cause
the entire deployment script to abort on any machine that does not already have `uv`
installed.

Did we get this right? 👍 / 👎 to inform future reviews.


# Create deployment package
echo "Creating deployment package..."
Expand Down
8 changes: 8 additions & 0 deletions test-potel-aws-lambda/lambda_function/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[project]
name = "test-potel-aws-lambda"
version = "0"
requires-python = ">=3.12"

dependencies = [
"sentry-sdk>=3.0.0a1",
]
1 change: 0 additions & 1 deletion test-potel-aws-lambda/lambda_function/requirements.txt

This file was deleted.

Loading