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

dependencies = [
"celery>=5.4.0",
"ipdb>=0.13.13",
"redis>=5.2.1",
"sentry-sdk[celery]",
]

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

This file was deleted.

15 changes: 4 additions & 11 deletions test-celery-sentry-propagate-traces/run-celery.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
#!/usr/bin/env bash

# exit on first error
set -euo pipefail

reset

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

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

redis-server --daemonize yes

celery -A tasks.app worker --loglevel=DEBUG -c 1
uv run celery -A tasks.app worker --loglevel=DEBUG -c 1
Comment on lines +4 to +10

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 fails to update the current shell's PATH, causing subsequent uv commands to fail with command not found on a fresh system.
Severity: HIGH

Suggested Fix

After the uv installation block, explicitly add the binary's directory to the PATH for the current session. For example, add export PATH="$HOME/.local/bin:$PATH" before the first call to uv.

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-celery-sentry-propagate-traces/run-celery.sh#L4-L10

Potential issue: The script checks if `uv` is installed and, if not, installs it. The
`uv` installer adds its binary directory to the `PATH` in shell profile files, but these
changes only take effect in new shell sessions. The current script, which has `set -euo
pipefail` enabled, immediately attempts to execute `uv run ...` without updating the
current session's `PATH`. This results in a `command not found` error, causing the
script to abort on any system where `uv` is not already installed.

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

17 changes: 5 additions & 12 deletions test-celery-sentry-propagate-traces/run.sh
Original file line number Diff line number Diff line change
@@ -1,15 +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

reset

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

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

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

Medium Severity

When uv is missing, both scripts install it via curl | sh and then immediately call uv run. The installer updates shell profile files for future sessions but does not put uv on PATH in the current bash process, so the next line often fails with uv: command not found on a first-time machine.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f2352f9. Configure here.

Loading