Skip to content

Mark ambiguous run summary recommendations - #1926

Merged
alexmojaki merged 6 commits into
pydantic:mainfrom
snoopuppy582:fix/run-summary-special-case-note
Jun 19, 2026
Merged

alexmojaki merged 6 commits into
pydantic:mainfrom
snoopuppy582:fix/run-summary-special-case-note

Conversation

@snoopuppy582

Copy link
Copy Markdown
Contributor

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

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

Copy link
Copy Markdown
Contributor

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
Contributor 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
Contributor 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

codecov Bot commented May 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment thread tests/test_cli.py Resolved
@snoopuppy582

Copy link
Copy Markdown
Contributor Author

Thanks, applied the wording suggestion in 450535bc.

Changes:

  • Changed ambiguous recommendation markers from urllib* to urllib [*].
  • Updated the note wording to: [*] ... may not actually be used by your app, in which case you can ignore ....
  • Updated the focused recommendation-text assertions and the inspect snapshot.

Verified locally:

  • 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

Note: tests/test_cli.py::test_inspect still has the known Windows local Rich/box-drawing snapshot rendering difference, so I kept the repository snapshot aligned with the GitHub/reviewer suggestion rather than the local Windows mojibake output.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment thread logfire/_internal/cli/run.py Resolved
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 43bfc280-b7c2-47bf-88cc-fd52ea32f93f

📥 Commits

Reviewing files that changed from the base of the PR and between 1b982a7 and 73690bc.

📒 Files selected for processing (2)
  • logfire/_internal/cli/run.py
  • tests/test_cli.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • pydantic/pydantic-ai (auto-detected)
  • pydantic/pydantic (auto-detected)

📝 Walkthrough

Walkthrough

The CLI recommendation text generator in logfire/_internal/cli/run.py is updated to handle packages that are always present (stdlib or bundled with OpenTelemetry) but may not be used by the app. A new AMBIGUOUS_RECOMMENDATION_PACKAGES set identifies these packages; get_recommendation_texts() appends [*] to their checklist entries and adds an explanatory note using the new _format_package_list() helper. Tests update the test_inspect snapshot for urllib and add a dedicated test for the ambiguous-annotation logic.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly addresses the main change: marking ambiguous recommendations in logfire run output with visual indicators.
Description check ✅ Passed The description accurately explains the changes, references the linked issue #1296, and details the implementation approach and testing performed.
Linked Issues check ✅ Passed The PR successfully implements the core requirement from #1296 by marking ambiguous packages (requests, sqlite3, urllib) with [*] and adding an explanatory note about environment detection.
Out of Scope Changes check ✅ Passed All changes are scoped to handling ambiguous recommendations: a new constant, helper function, test updates, and snapshot changes—no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@alexmojaki
alexmojaki enabled auto-merge (squash) June 19, 2026 14:08
@alexmojaki

Copy link
Copy Markdown
Contributor

Thanks!

@alexmojaki
alexmojaki merged commit 3b08489 into pydantic:main Jun 19, 2026
16 checks passed
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