Skip to content

fix(cli): honor configured organizations for short IDs - #1418

Merged
betegon merged 5 commits into
mainfrom
bt/cli-shortid-org-context
Oct 6, 2026
Merged

betegon merged 5 commits into
mainfrom
bt/cli-shortid-org-context

Conversation

@betegon

@betegon betegon commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Bare issue short IDs can report “not found” when the cached organization list omits an accessible organization, even when that organization is configured as the default.

Before

With team-org missing from the cached organization list:

sentry cli defaults org team-org
sentry issue view FRONT-ABC           # May report not found
sentry issue view team-org/FRONT-ABC  # Resolves successfully

The bare short ID searches cached organizations without applying the configured organization.

After

sentry cli defaults org team-org
sentry issue view FRONT-ABC           # Resolves directly in team-org

Short IDs use the existing environment → .sentryclirc → persistent-default precedence. A configured organization remains authoritative: a 404 does not fall through to another organization. Project aliases retain their associated organization.

Without configured context, a cached lookup miss refreshes the organization list once through the existing discovery path, including its HTTP cache bypass and credential validation, then searches newly discovered organizations. Ambiguous matches still require an explicit organization. This does not assume that refreshing can repair an organization omitted by the API itself.

Includes regression coverage, command help, documentation, and the issue-specific generated example.

Validation

  • 123 focused tests passed for short-ID resolution, organization discovery, credential isolation, regions, HTTP cache bypass, redirects, and token refresh.
  • Full CLI unit suite with TZ=UTC: 10,468 passed, 17 skipped, 1 failed. The remaining Linux/musl installer test fails on macOS because it does not mock the OS; it is unchanged by this PR.
  • All 3 shared authentication protocol tests passed.
  • CLI typecheck, lint, docs/SDK generation, native build, and executable smoke checks passed. Generation leaves no additional tracked changes.
  • Production behavior after release remains unverified.

betegon and others added 2 commits October 5, 2026 21:51
Resolve full short IDs in the configured organization and refresh incomplete cached organization inventories once on a miss.

Co-Authored-By: GPT-6 <noreply@openai.com>
Leave skill version regeneration to the dedicated PR while keeping the issue-specific documentation example.

Co-Authored-By: GPT-6 <noreply@openai.com>
@betegon
betegon force-pushed the bt/cli-shortid-org-context branch from 4f9f128 to 61f2ace Compare October 5, 2026 19:51
Return the organization with each lookup result so collection no longer depends on parallel array indices.

Co-Authored-By: GPT-6 <noreply@openai.com>
@betegon
betegon marked this pull request as ready for review October 5, 2026 20:13
@betegon
betegon requested a review from BYK October 5, 2026 20:20

@BYK BYK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yup, great catch

Reuse upstream organization discovery and credential-scoped caching instead of the superseded reload transport option.
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 6, 2026
Restore the MCP client test exactly to main. Skip the formatting hook for this restoration so it does not reintroduce changes outside the CLI fix.
@betegon
betegon merged commit 486de4b into main Oct 6, 2026
23 of 24 checks passed
@betegon
betegon deleted the bt/cli-shortid-org-context branch October 6, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants