Skip to content

fix(bitbucket): handle API errors in workspace listing and guard empty pipeline Id#8885

Merged
klesh merged 1 commit into
apache:mainfrom
bujjibabukatta:fix/bitbucket-remote-scopes-and-pipeline-id
May 30, 2026
Merged

fix(bitbucket): handle API errors in workspace listing and guard empty pipeline Id#8885
klesh merged 1 commit into
apache:mainfrom
bujjibabukatta:fix/bitbucket-remote-scopes-and-pipeline-id

Conversation

@bujjibabukatta
Copy link
Copy Markdown
Contributor

  • Add HTTP status code check in listBitbucketWorkspaces, mirroring the existing check in listBitbucketRepos. A non-2xx Bitbucket response was silently unmarshalled as an empty WorkspaceResponse, causing the UI to show No data to select with no error surfaced to the user.

  • Guard against calling the pipeline subtasks API with an empty pipelineId in card.tsx and step-4.tsx. The record is initialised with pipelineId="" in step-2 before a pipeline has been triggered, causing the frontend to issue GET /pipelines//subtasks and receive a 400 invalid pipeline ID format error from the backend.

⚠️ Pre Checklist

Please complete ALL items in this checklist, and remove before submitting

  • I have read through the Contributing Documentation.
  • I will add labels to the PR, such as pr-type/bug-fix, pr-type/feature-development, etc.

Summary

What does this PR do?

  • Backend (backend/plugins/bitbucket/api/remote_api.go): listBitbucketWorkspaces did not check the HTTP status code before unmarshalling, unlike sibling listBitbucketRepos. When Bitbucket returns a non-2xx error, json.Unmarshal silently produces a zero-value WorkspaceResponse (empty values), so the endpoint returned HTTP 200 with children: [] causing "No data to select" in the UI with no visible error.

  • Frontend (card.tsx, step-4.tsx): After a Bitbucket connection is created in Step 2, the record is stored with pipelineId: "". Both the onboard card and Step 4 called API.pipeline.subTasks(record.pipelineId) without checking if pipelineId was non-empty, sending GET /pipelines//subtasks to the backend and producing the logged 400 invalid pipeline ID format error.

Does this close any open issues?

Closes 8868

…y pipelineId

- Add HTTP status code check in listBitbucketWorkspaces, mirroring
  the existing check in listBitbucketRepos. A non-2xx Bitbucket response
  was silently unmarshalled as an empty WorkspaceResponse, causing the
  UI to show No data to select with no error surfaced to the user.

- Guard against calling the pipeline subtasks API with an empty
  pipelineId in card.tsx and step-4.tsx. The record is initialised
  with pipelineId="" in step-2 before a pipeline has been triggered,
  causing the frontend to issue GET /pipelines//subtasks and receive
  a 400 invalid pipeline ID format error from the backend.

Fixes apache#8868
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. component/config-ui This issue or PR relates to config-ui pr-type/bug-fix This PR fixes a bug severity/p1 This bug affects functionality or significantly affect ux labels May 25, 2026
Copy link
Copy Markdown
Contributor

@klesh klesh left a comment

Choose a reason for hiding this comment

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

LGTM.
Thanks for your contribution.

@klesh klesh merged commit 4ac2c42 into apache:main May 30, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/config-ui This issue or PR relates to config-ui pr-type/bug-fix This PR fixes a bug severity/p1 This bug affects functionality or significantly affect ux size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants