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

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

[tool.uv.sources]
sentry-sdk = { path = "../../sentry-python", editable = true }
8 changes: 0 additions & 8 deletions test-celery-beat-parent-span-id/requirements.txt

This file was deleted.

15 changes: 4 additions & 11 deletions test-celery-beat-parent-span-id/run-beat.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
#!/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 beat \
uv run celery -A tasks.app beat \
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 doesn't update the current shell's PATH, causing the subsequent uv run command to fail if uv wasn't already installed.
Severity: HIGH

Suggested Fix

After the uv installation command, source the appropriate shell profile file (e.g., source ~/.bashrc) or explicitly add the uv binary's directory to the PATH environment variable for the current script session. For example: export PATH="$HOME/.cargo/bin:$PATH".

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-beat-parent-span-id/run-beat.sh#L4-L10

Potential issue: When `uv` is not installed, the script attempts to install it. However,
the installer only updates shell profile files for future sessions and does not modify
the `PATH` of the current running shell. Because `set -euo pipefail` is enabled, the
script immediately fails and exits on the next line when it tries to execute `uv run
...` and the command is not found. This same issue is present in `run-celery.sh` and
`run-flask.sh`.

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

--loglevel=INFO
15 changes: 4 additions & 11 deletions test-celery-beat-parent-span-id/run-celery.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
#!/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 \
uv run celery -A tasks.app worker \
--loglevel=INFO \
-c 1
15 changes: 4 additions & 11 deletions test-celery-beat-parent-span-id/run-flask.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

flask --app main run
uv run flask --app main 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.

Same-shell uv PATH not updated

Medium Severity

The scripts install uv via the Astral installer, which places the binary in ~/.local/bin. This installer doesn't update the PATH for the current non-interactive shell, causing subsequent uv run commands to fail with "command not found".

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit dcb02bd. Configure here.

7 changes: 0 additions & 7 deletions test-celery-beat-parent-span-id/start-task.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
#!/usr/bin/env bash

# exit on first error
set -euo pipefail

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

# Start task
curl -i -X GET http://localhost:5000/
Loading