feat(vsts): Add API pipeline frontend flow#113095
Conversation
Refs [VDY-43: Azure DevOps (VSTS): API-driven integration setup](https://linear.app/getsentry/issue/VDY-43/azure-devops-vsts-api-driven-integration-setup)
| <DropdownMenu | ||
| triggerLabel={t('Select Azure DevOps organization')} | ||
| items={accounts.map(account => ({ | ||
| key: account.accountId, | ||
| label: account.accountName, | ||
| }))} | ||
| isDisabled={isAdvancing} | ||
| onAction={key => { | ||
| advance({account: key as string}); | ||
| }} | ||
| /> |
There was a problem hiding this comment.
Bug: The onAction handler is passed as a top-level prop to DropdownMenu, but Sentry's implementation never invokes it, so advance is never called.
Severity: HIGH
Suggested Fix
Move onAction to each item in the items array instead of passing it as a top-level DropdownMenu prop: items={accounts.map(account => ({ key: account.accountId, label: account.accountName, onAction: () => advance({account: account.accountId}) }))} and remove the top-level onAction prop.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: static/app/components/pipeline/pipelineIntegrationVsts.tsx#L73-L83
Potential issue: In `VstsAccountSelectionStep`, the `onAction` callback is passed as a
top-level prop to the `<DropdownMenu>` component (line 80). However, Sentry's custom
`DropdownMenuItem` always overrides react-aria's menu-level `onAction` by passing its
own `actionHandler` to `useMenuItem({ onAction: actionHandler })` (item.tsx:178). This
`actionHandler` only calls the **item-level** `onAction?.()` from `node.value`
(item.tsx:133), which is undefined here since items don't define `onAction`.
Consequently, selecting an account does nothing — `advance` is never called, and the
pipeline can never progress past the account selection step.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Not a real issue. The top-level onAction prop flows through {...props} into DropdownMenuList, which passes it to react-aria's useMenu(). React-aria fires the menu-level onAction(key) when any item is selected, independently of item-level onAction. The test in pipelineIntegrationVsts.spec.tsx confirms this works correctly.
Refs VDY-43: Azure DevOps (VSTS): API-driven integration setup