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-checkin-in-trace-id/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[project]
name = "test-checkin-in-trace-id"
version = "0"
requires-python = ">=3.12"

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

[tool.uv.sources]
sentry-sdk = { path = "../../sentry-python", editable = true }
Comment on lines +4 to +14

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 test setup uses uv pip install -e . which will fail due to a missing [build-system] and would ignore local dependency paths in [tool.uv.sources].
Severity: HIGH

Suggested Fix

Replace uv pip install -e . in run.sh and run-celery.sh with uv sync. This command correctly respects the [tool.uv.sources] configuration to use the local SDK path. Additionally, add a [build-system] table (e.g., for setuptools) to pyproject.toml to make the project installable.

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-checkin-in-trace-id/pyproject.toml#L1-L14

Potential issue: The test setup scripts `run.sh` and `run-celery.sh` use `uv pip install
-e .` to install the test project. This command will fail for two reasons. First, the
`pyproject.toml` file lacks a `[build-system]` table, which is required for an editable
installation, causing the installation to crash. Second, even if a build system were
present, `uv pip install` ignores the `[tool.uv.sources]` configuration. This means it
would install the `sentry-sdk` dependency from PyPI instead of the specified local
development path, defeating the purpose of testing local code changes.

7 changes: 0 additions & 7 deletions test-checkin-in-trace-id/requirements.txt

This file was deleted.

11 changes: 6 additions & 5 deletions test-checkin-in-trace-id/run-celery.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
python -m venv .venv
#!/usr/bin/env bash
set -euo pipefail

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
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 in a subshell, but the parent script's PATH is not updated, causing the subsequent uv run command to fail.
Severity: MEDIUM

Suggested Fix

After the installation line curl -LsSf https://astral.sh/uv/install.sh | sh, source the appropriate environment file to update the PATH in the current shell session. For example, add a line like source "$HOME/.cargo/env" or export PATH="$HOME/.local/bin:$PATH", depending on where the uv installation script places the executable.

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-checkin-in-trace-id/run-celery.sh#L4-L6

Potential issue: The script attempts to install `uv` if it is not found by piping a curl
command to `sh`. This installation process runs in a subshell and cannot modify the
`PATH` environment variable of the parent script. As a result, when the script later
tries to execute `uv run celery ...`, the `uv` command will not be found in the
unchanged `PATH`, leading to a 'command not found' error. This will cause the script to
fail in any environment where `uv` was not already installed and available in the
`PATH`.


redis-server &

celery -A tasks worker --loglevel=DEBUG
uv run celery -A tasks worker --loglevel=DEBUG
12 changes: 6 additions & 6 deletions test-checkin-in-trace-id/run.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail

python -m venv .venv
if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
fi

source .venv/bin/activate

pip install -r requirements.txt

python main.py
uv run python main.py
Loading