Skip to content

Mark ambiguous run summary recommendations#1926

Open
snoopuppy582 wants to merge 2 commits into
pydantic:mainfrom
snoopuppy582:fix/run-summary-special-case-note
Open

Mark ambiguous run summary recommendations#1926
snoopuppy582 wants to merge 2 commits into
pydantic:mainfrom
snoopuppy582:fix/run-summary-special-case-note

Conversation

@snoopuppy582
Copy link
Copy Markdown

Fixes #1296

Summary

  • Mark ambiguous logfire run recommendations (requests, sqlite3, urllib) with *.
  • Add a short note explaining that these packages can be detected from environment availability even when the app does not use them directly.
  • Keep normal recommendation/install-command behavior unchanged.

Tests

  • uv run pytest tests/test_cli.py::test_get_recommendation_texts tests/test_cli.py::test_get_recommendation_texts_marks_ambiguous_packages -q
  • uv run ruff check logfire/_internal/cli/run.py tests/test_cli.py
  • uv run ruff format --check logfire/_internal/cli/run.py tests/test_cli.py

Notes

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@snoopuppy582
Copy link
Copy Markdown
Author

I pushed a small snapshot-spacing follow-up after CI.

The test matrix was failing in tests/test_cli.py::test_inspect; the rendered Rich panel line for the new urllib* note had one fewer padding space than my snapshot expected.

Local checks after the follow-up:

  • uv run pytest tests/test_cli.py::test_get_recommendation_texts tests/test_cli.py::test_get_recommendation_texts_marks_ambiguous_packages -q -> 2 passed
  • uv run ruff check logfire/_internal/cli/run.py tests/test_cli.py -> passed
  • uv run ruff format --check logfire/_internal/cli/run.py tests/test_cli.py -> passed
  • git diff --check -> passed

@snoopuppy582
Copy link
Copy Markdown
Author

CI update after the snapshot-spacing follow-up:

  • lint, docs, test on Pyodide, Cubic review, and the Python 3.10-3.14 matrix jobs passed.
  • The remaining real test failure is only test on Python 3.9, pydantic 2, otel 1, in tests/otel_integrations/test_celery.py::test_instrument_celery.
  • That job reports 1586 passed, 41 skipped, 2 xfailed, and one Celery span assertion failure where the observed span is run/tasks.say_hello rather than the expected apply_async/tasks.say_hello.

This looks unrelated to this PR's CLI recommendation text/snapshot change. I tried to rerun the failed job, but GitHub requires repository admin rights for reruns on this workflow.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment thread tests/test_cli.py
Comment on lines +295 to +297
│ ☐ urllib* (need to install opentelemetry-instrumentation-urllib) │
│ │
│ * `urllib` may be detected even when your app does not use it directly; ignore these recommendations if they are not used by your code. │
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
│ ☐ urllib* (need to install opentelemetry-instrumentation-urllib) │
│ │
* `urllib` may be detected even when your app does not use it directly; ignore these recommendations if they are not used by your code.
│ ☐ urllib [*] (need to install opentelemetry-instrumentation-urllib) │
│ │
[*] `urllib` may not actually be used by your app, in which case you can ignore this recommendation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

logfire run always suggests requests, sqlite3, urllib

2 participants