Skip to content

[Feature]: Surface the actual Gitea API error when integration auth fails #13786

Description

@aliuq

Problem or use case

When the Gitea integration is configured but fails to authenticate, Orca only shows a generic message: "Gitea credentials are configured but could not authenticate. Check the token, API base URL, and repository permissions, then restart Orca if environment variables changed." The actual cause is discarded, so users cannot tell what to fix.

Real case: a token that was valid but lacked the required API scope. Gitea returned a precise, actionable error body that Orca's client dropped before surfacing anything:

{"message":"token does not have at least one of required scope(s), required=[read:user], token scope=write:package,write:issue,write:repository","url":"https:///api/swagger"}

Because the body is discarded on non-2xx responses, the integration card cannot explain why auth failed and the user has to reverse-engineer the cause.

Proposed solution

When a Gitea API request returns a non-2xx status, surface the server's error message to the user instead of the generic "could not authenticate" copy. Specifically:

  • Parse the Gitea error body (e.g. the message field returned by the API) and include it in the integration status/card so users see the actionable cause, such as a token missing the required read:user scope.
  • Keep the token and any sensitive URL query values redacted.
  • Fall back to the existing generic message when the API returns no usable body.

The Gitea client currently reads and discards the response body on failure, so surfacing it is a small, low-risk change.

Alternatives or additional context

  • Logging the Gitea error body to the application log only would be a lighter-touch alternative, but it is less discoverable than showing it in the integration card.
  • The generic message already points at token/URL/permissions; adding the concrete API error (e.g. missing read:user scope) would turn that guidance into a direct fix.

Activity

  1. added theissue type on Aug 11, 2026
  2. added
    enhancement
    on Aug 11, 2026
  3. added 2 commits that reference this issue on Aug 14, 2026
    c0a8b57
  4. added a commit that references this issue on Sep 20, 2026
    5c807e6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions