Skip to content

fix(cli): validate repository list responses - #1364

Merged
betegon merged 3 commits into
mainfrom
bt/fix-cli-repository-response
Oct 2, 2026
Merged

betegon merged 3 commits into
mainfrom
bt/fix-cli-repository-response

Conversation

@betegon

@betegon betegon commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

sentry release set-commits --auto crashes with TypeError: data.find is not a function when the repositories endpoint returns a successful response with a non-array body. An incomplete API mock returning 200 {"ok":true} reproduces the failure; the backend contract is an array, including an empty array when no repositories exist.

Validate repository pages before returning them to callers. Unexpected responses produce an ApiError with the actual HTTP status and requested endpoint, without updating the release or triggering the no-integration fallback. Keeping the real status avoids classifying a malformed successful response as a status-0 network/user-environment failure. The error remains captured by CLI telemetry; its cause is not inferred from a self-hosted URL or the response shape.

Regression coverage exercises object, string, and null responses through the real SDK path, preserves successful HTTP statuses, verifies the error stays reportable and is not classified as a user error, and confirms no release mutation occurs. The focused API, command, classification, and telemetry suites pass (368 tests), along with CLI typecheck and lint for the changed files.

betegon and others added 3 commits October 2, 2026 12:13
Report malformed repository pages as API errors before release commit discovery can crash or mistake them for missing integrations.

Co-Authored-By: GPT-6 (OpenAI) <[email protected]>
Avoid attributing invalid repository responses to self-hosted versions without evidence. Exercise the object payload reproduced with an incomplete API mock.

Co-Authored-By: GPT-6 (OpenAI) <[email protected]>
Keep the real HTTP status and endpoint when a repository response violates the array contract. Status zero would incorrectly attribute a successful malformed response to network or user configuration. Verify that the failure stays captured and cannot update the release.

Co-Authored-By: GPT-6 (OpenAI) <[email protected]>
@betegon
betegon marked this pull request as ready for review October 2, 2026 11:44
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 2, 2026
@betegon
betegon merged commit 45822a3 into main Oct 2, 2026
25 checks passed
@betegon
betegon deleted the bt/fix-cli-repository-response branch October 2, 2026 17:55
mr-danya pushed a commit to mr-danya/sentry-mcp that referenced this pull request Oct 6, 2026
mr-danya pushed a commit to mr-danya/sentry-mcp that referenced this pull request Oct 6, 2026
mr-danya pushed a commit to mr-danya/sentry-mcp that referenced this pull request Oct 6, 2026
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.

1 participant