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 tmp-celery-flush/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[project]
name = "tmp-celery-flush"
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 tmp-celery-flush/requirements.txt

This file was deleted.

15 changes: 4 additions & 11 deletions tmp-celery-flush/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
Comment on lines +4 to +6

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 PATH for the current session, causing subsequent uv commands to fail with "command not found".
Severity: HIGH

Suggested Fix

After the uv installation block, add a line to update the PATH for the current shell session, for example: export PATH="$HOME/.local/bin:$PATH". This will ensure the uv binary is discoverable in subsequent commands within the same script execution.

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: tmp-celery-flush/run-celery.sh#L4-L6

Potential issue: After installing `uv` via a curl script, the shell script immediately
attempts to use the `uv` command. The installer places the `uv` binary in `~/.local/bin`
and updates shell profile files, but these changes do not affect the current, running
shell session. Because the `PATH` is not updated for the current session, the `uv`
command is not found. As the script is configured with `set -euo pipefail`, this
"command not found" error will cause the script to exit immediately, preventing it from
completing its task. This failure occurs precisely in the scenario the installation
block is meant to handle—when `uv` is not already present.

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


redis-server --daemonize yes

celery -A tasks.app worker \
uv run celery -A tasks.app worker \

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 unavailable after inline install

Medium Severity

When uv is not already on PATH, the scripts run Astral’s installer and then immediately invoke uv run. The installer does not expose uv to the current shell session, so the next line fails with “command not found” under set -euo pipefail, breaking the PR test plan on a fresh environment.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit af7a7b1. Configure here.

--loglevel=INFO \
-c 1
11 changes: 4 additions & 7 deletions tmp-celery-flush/start-task.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#!/usr/bin/env bash

# exit on first error
set -euo pipefail

# create and activate virtual environment
python -m venv .venv
source .venv/bin/activate
if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
fi

# Start task
python -c 'import tasks; tasks.my_task.delay()'
uv run python -c 'import tasks; tasks.my_task.delay()'
Loading