Skip to content

Commit cdc8041

Browse files
waleedlatif1claude
andcommitted
azure_devops: address additional bugbot comments
- Block update_work_item now forwards areaPath; the Area Path subblock condition expanded to include update operation - get_build_timeline.failedRecords now also flags partiallySucceeded and succeededWithIssues, normalized case-insensitively. Output description and added a focused test Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent db0b46b commit cdc8041

3 files changed

Lines changed: 30 additions & 3 deletions

File tree

apps/sim/blocks/blocks/azure_devops.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,10 @@ export const AzureDevOpsBlock: BlockConfig<AzureDevOpsResponse> = {
396396
title: 'Area Path',
397397
type: 'short-input',
398398
placeholder: 'e.g. MyProject\\Team',
399-
condition: { field: 'operation', value: 'azure_devops_create_work_item' },
399+
condition: {
400+
field: 'operation',
401+
value: ['azure_devops_create_work_item', 'azure_devops_update_work_item'],
402+
},
400403
mode: 'advanced',
401404
},
402405
{
@@ -533,6 +536,7 @@ export const AzureDevOpsBlock: BlockConfig<AzureDevOpsResponse> = {
533536
remainingWork: params.remainingWork ? Number(params.remainingWork) : undefined,
534537
completedWork: params.completedWork ? Number(params.completedWork) : undefined,
535538
description: (params.description as string) || undefined,
539+
areaPath: (params.areaPath as string) || undefined,
536540
tags: (params.tags as string) || undefined,
537541
}
538542
case 'azure_devops_add_comment':

apps/sim/tools/azure_devops/azure-devops.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { ToolConfig } from '../types'
88
import { addCommentTool } from './add_comment'
99
import { createWorkItemTool } from './create_work_item'
1010
import { getBuildLogTool } from './get_build_log'
11+
import { getBuildTimelineTool } from './get_build_timeline'
1112
import { getCommentsTool } from './get_comments'
1213
import { getPipelineTool } from './get_pipeline'
1314
import { getPipelineRunTool } from './get_pipeline_run'
@@ -743,6 +744,22 @@ describe('Azure DevOps trigger event matching', () => {
743744
).toBe(false)
744745
})
745746

747+
it('build timeline includes partiallySucceeded and succeededWithIssues in failedRecords', async () => {
748+
const records = [
749+
{ id: 'a', name: 'Step A', type: 'Task', result: 'succeeded', log: { id: 1 } },
750+
{ id: 'b', name: 'Step B', type: 'Task', result: 'failed', log: { id: 2 } },
751+
{ id: 'c', name: 'Step C', type: 'Task', result: 'partiallySucceeded', log: { id: 3 } },
752+
{ id: 'd', name: 'Step D', type: 'Task', result: 'succeededWithIssues', log: { id: 4 } },
753+
{ id: 'e', name: 'Step E', type: 'Task', result: 'skipped', log: null },
754+
]
755+
const result = await getBuildTimelineTool.transformResponse!(
756+
new Response(JSON.stringify({ records }))
757+
)
758+
const failedIds = result.output.metadata.failedRecords.map((r) => r.id)
759+
expect(failedIds).toEqual(['b', 'c', 'd'])
760+
expect(result.output.metadata.failedCount).toBe(3)
761+
})
762+
746763
it('matches workitem.created and passes through generic webhook', () => {
747764
expect(isAzureDevOpsEventMatch('azure_devops_work_item_created', baseWorkItem)).toBe(true)
748765
expect(isAzureDevOpsEventMatch('azure_devops_work_item_created', baseBuild)).toBe(false)

apps/sim/tools/azure_devops/get_build_timeline.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,12 @@ export const getBuildTimelineTool: ToolConfig<GetBuildTimelineParams, GetBuildTi
7575
})
7676
)
7777

78-
const failedRecords = records.filter((r) => r.result === 'failed')
78+
const failedRecords = records.filter((r) => {
79+
const result = r.result?.toLowerCase()
80+
return (
81+
result === 'failed' || result === 'partiallysucceeded' || result === 'succeededwithissues'
82+
)
83+
})
7984

8085
const content =
8186
failedRecords.length === 0
@@ -136,7 +141,8 @@ export const getBuildTimelineTool: ToolConfig<GetBuildTimelineParams, GetBuildTi
136141
},
137142
failedRecords: {
138143
type: 'array',
139-
description: 'Subset of records where result === "failed" — use logId to fetch logs',
144+
description:
145+
'Subset of records where result is failed, partiallySucceeded, or succeededWithIssues — use logId to fetch logs',
140146
items: {
141147
type: 'object',
142148
properties: {

0 commit comments

Comments
 (0)