Skip to content

Handle project setup for accounts without organizations - #2469

Merged
alexmojaki merged 3 commits into
mainfrom
codex/handle-orgless-project-setup
Oct 9, 2026
Merged

alexmojaki merged 3 commits into
mainfrom
codex/handle-orgless-project-setup

Conversation

@strawgate

@strawgate strawgate commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Logfire accounts can now exist without an organization or account default. Project setup needs to handle both states without an SDK traceback.

  • raise an actionable LogfireConfigError when no organizations are available for project creation
  • use the first available organization as the selection default when default_organization is null
  • omit the invalid --default-org remedy when the account has no default organization

Test plan

  • configuration tests for zero organizations and a nullable account default
  • non-interactive CLI tests with and without an account default
  • changed-file hooks: Ruff, Ruff Format, and Pyright

@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.

Re-trigger cubic

@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 007f8b3d-b4b2-49d9-ad09-cd93a1cfb67b

📥 Commits

Reviewing files that changed from the base of the PR and between 0807945 and 845ecf4.

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

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

  • pydantic/logfire (manual)
  • pydantic/pydantic-ai (manual)

Included review availability: Your plan provides up to 8 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

Project creation now raises LogfireConfigError when no organizations are available. Organization selection handles a missing or null account default and uses the fallback organization. In non-interactive mode, guidance includes --default-org only when a default organization name exists. Tests cover these behaviors.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 845ec

Project setup now gives an actionable error when no organizations are available and avoids suggesting an unavailable default organization. No merge-blocking issue was identified.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: handling project setup for accounts without organizations.
Description check ✅ Passed The description directly matches the changeset and explains the error handling, organization fallback, and related tests.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR

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

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  logfire-sdk/logfire/_internal
  config.py
Project Total  

This report was generated by python-coverage-comment-action

@alexmojaki
alexmojaki merged commit e00fed0 into main Oct 9, 2026
27 checks passed
@alexmojaki
alexmojaki deleted the codex/handle-orgless-project-setup branch October 9, 2026 19:45
@cubic-dev-ai cubic-dev-ai Bot mentioned this pull request Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug related to the Logfire Python SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants