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

dependencies = [
"ipdb>=0.13.13",
"sentry-sdk",
"Werkzeug<2.1.0",
]

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

This file was deleted.

11 changes: 4 additions & 7 deletions test-long-running-transaction/run.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#!/usr/bin/env bash

set -euo pipefail

reset

python -m venv .venv
source .venv/bin/activate

pip install -r requirements.txt
if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
fi

python main.py
uv run python main.py

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 install

Medium Severity

When uv is not on PATH, the script installs it via the official installer but never loads the installer’s env into the current shell. The next uv run still runs in a session where command -v uv fails, so the first run can exit with “command not found” even though installation succeeded.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 89a8ee7. Configure here.

Comment on lines +5 to +9

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 PATH for the current session, causing the uv run command to fail in clean environments.
Severity: MEDIUM

Suggested Fix

After the uv installation command, update the PATH for the current session before calling uv. For example, add export PATH="$HOME/.local/bin:$PATH" to make the uv binary available to the script.

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-long-running-transaction/run.sh#L5-L9

Potential issue: In a clean environment where `uv` is not pre-installed, the `run.sh`
script attempts to install it. The `uv` installer modifies shell configuration files for
future sessions but does not update the `PATH` for the currently executing script.
Consequently, the subsequent `uv run python main.py` command fails with a "command not
found" error. Because the script has `set -euo pipefail` enabled, this failure will
cause the script to abort, preventing the test from running. This issue will likely only
surface in CI/CD environments or on machines that do not already have `uv` installed.

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

Loading