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: 6 additions & 3 deletions test-lambda-function/build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail

set -ex
if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
fi

rm -rf lambda_function_package.zip
rm -rf ./python_with_sentry/package/*

pip install --target ./python_with_sentry/package -r requirements.txt
uv pip install --target ./python_with_sentry/package -r pyproject.toml

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 command uv pip install -r pyproject.toml is invalid. The -r flag expects a requirements file, not a TOML file, which will cause the build script to fail.
Severity: CRITICAL

Suggested Fix

Replace uv pip install -r pyproject.toml with the correct command to install dependencies from the current project's pyproject.toml. The suggested command is uv pip install --target ./python_with_sentry/package .. This correctly reads the project definition and installs dependencies into the specified target directory.

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-lambda-function/build.sh#L11

Potential issue: The build script `test-lambda-function/build.sh` uses the command `uv
pip install -r pyproject.toml`. The `-r` flag is for line-by-line requirements files,
but `pyproject.toml` is a TOML-formatted file, which `uv` cannot parse in this context.
Because the script enables `set -euo pipefail`, this invalid command will cause an
immediate error and halt the entire build process. As a result, the lambda package will
not be created, and any deployment relying on this script will fail.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Editable SDK breaks Lambda zip

High Severity

build.sh vendors deps with uv pip install --target then zips only that folder, but pyproject.toml pins sentry-sdk as an editable path under ../../sentry-python. Editable installs typically add .pth pointers instead of copying sources, so the Lambda archive can ship without a usable sentry_sdk at runtime.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b1aff78. Configure here.

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 not on PATH after install

Medium Severity

When uv is missing, build.sh runs the Astral installer then immediately calls uv pip install. The installer updates shell profiles for future sessions but does not put uv on PATH in the current non-interactive script, so the next line can fail with “command not found” under set -e.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b1aff78. Configure here.


cd ./python_with_sentry/package && zip -x "**/__pycache__/*" -r ../../lambda_function_package.zip . && cd -

cd ./python_with_sentry && zip -g ../lambda_function_package.zip lambda_function.py && cd -
cd ./python_with_sentry && zip -g ../lambda_function_package.zip lambda_function.py && cd -
11 changes: 11 additions & 0 deletions test-lambda-function/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[project]
name = "test-lambda-function"
version = "0"
requires-python = ">=3.12"

dependencies = [
"sentry-sdk",
]

[tool.uv.sources]
sentry-sdk = { path = "../../sentry-python", editable = true }
1 change: 0 additions & 1 deletion test-lambda-function/requirements.txt

This file was deleted.

Loading