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
16 changes: 16 additions & 0 deletions test-flask-otel/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[project]
name = "test-flask-otel"
version = "0"
requires-python = ">=3.12"

dependencies = [
"blinker>=1.9.0",
"flask>=3.1.1",
"ipdb>=0.13.13",
"markupsafe>=3.0.2",
"opentelemetry-distro>=0.52b0",
"sentry-sdk[flask]",
]

[tool.uv.sources]
sentry-sdk = { path = "../../sentry-python", editable = true }
9 changes: 0 additions & 9 deletions test-flask-otel/requirements.txt

This file was deleted.

16 changes: 5 additions & 11 deletions test-flask-otel/run.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail

# exit on first error
set -xe
if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
fi

# create and activate virtual environment
python -m venv .venv
source .venv/bin/activate

# Install (or update) requirements
python -m pip install -r requirements.txt

# Run Flask application on localhost:5000
flask --app app run
uv run flask --app app run

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 after installer subshell

Medium Severity

When uv is not on PATH, run.sh installs it via curl … | sh, then immediately runs uv run. The installer runs in a subshell and does not update the parent shell’s PATH, so the next line often fails with “command not found” on a fresh machine unless ~/.local/bin was already configured.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9e4991d. Configure here.

Comment on lines +4 to +8

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 calls uv run immediately after installing uv, but the executable's path is not added to the current shell's $PATH, causing a "command not found" error.
Severity: HIGH

Suggested Fix

After the uv installation line, explicitly add the installation directory to the $PATH for the current script session, for example: export PATH="$HOME/.local/bin:$PATH". This ensures the uv command is available for subsequent steps.

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-flask-otel/run.sh#L4-L8

Potential issue: The script installs `uv` using `curl -LsSf
https://astral.sh/uv/install.sh | sh`. This installer places the `uv` binary in a
directory like `~/.local/bin` and updates shell profile files, but these changes do not
apply to the currently running script's environment. Consequently, the subsequent call
to `uv run` fails because the shell cannot find the `uv` executable in its `$PATH`.
Since the script is configured with `set -euo pipefail`, this failure will cause the
script to exit prematurely.

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

Loading