feat(azure-devops): block and trigger#4664
Conversation
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
- bgColor switched from white to Azure DevOps brand color #0078D4 (block + mdx) - WIQL query_work_items: hydrate ALL matched IDs by chunking through batches of 200 instead of silently truncating; check response.ok on the follow-up fetch and surface a clear error on 4xx/5xx; trim org/project; expose totalMatched in metadata so users can see pre-hydration count - Add MANUAL-CONTENT-START:intro section to the azure_devops.mdx docs page - Update unit tests for new chunking behavior and update-work-item validation Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Wires the integration into the product and docs surfaces by adding an Reviewed by Cursor Bugbot for commit 41b172f. Configure here. |
Greptile SummaryThis PR adds a full Azure DevOps integration: 16 tools spanning pipelines, builds, and work items; a single
Confidence Score: 5/5The integration is safe to merge; all 16 tools, the block, and both triggers are wired up correctly with proper auth and chunked hydration. The chunked WIQL hydration, org/project trimming, and webhook dispatch logic all look correct. The two findings are both minor inconsistencies (priority stringification and a test coverage gap for the timeline tool) that do not affect runtime correctness of the primary user-facing paths. apps/sim/tools/azure_devops/update_work_item.ts and create_work_item.ts for the priority serialization inconsistency; apps/sim/tools/azure_devops/azure-devops.test.ts for the missing getBuildTimelineTool surface check. Important Files Changed
Sequence DiagramsequenceDiagram
participant User as Sim Workflow
participant Block as AzureDevOps Block
participant Tool as Tool (e.g. query_work_items)
participant ADO as Azure DevOps API
User->>Block: Execute with operation + PAT
Block->>Tool: Dispatch via tools.config.params()
Tool->>ADO: POST /wit/wiql (WIQL query)
ADO-->>Tool: workItems[] (IDs only)
loop Chunks of 200 IDs
Tool->>ADO: "GET /wit/workitems?ids=..."
ADO-->>Tool: Full work item details
end
Tool-->>Block: content + metadata
Block-->>User: Structured output
Note over User,ADO: Webhook triggers (separate flow)
ADO->>WebhookProvider: POST service hook payload
WebhookProvider->>WebhookProvider: matchEvent() isAzureDevOpsEventMatch()
WebhookProvider->>WebhookProvider: formatInput() formatBuildCompleteInput()
WebhookProvider-->>User: Typed trigger output fields
Reviews (4): Last reviewed commit: "azure_devops: address more bugbot commen..." | Re-trigger Greptile |
- Add types barrel export to tools/azure_devops/index.ts - Normalize comment endpoint path casing (/workItems/ -> /workitems/) - Update test assertions to match normalized path - Biome formatter reflow across tools, triggers, registry, and docs icon Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Fix bgColor #FFFFFF -> #0078D4 in integrations.json and triggers/azure_devops.mdx
- Bump File tool operationCount from 4 to 5 (Read, Fetch, Get, Write, Append)
- Apply .trim() to org/project across all 15 remaining tools (consistency with query_work_items)
- Fix Found ${data.count} -> Found ${data.count ?? items.length} fallback in list_builds, list_pipelines, list_pipeline_runs content strings
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
- triggers/utils: match build.complete result case-insensitively, accept stopped/cancelled in addition to failed/canceled/partiallySucceeded so PascalCase and legacy Azure DevOps payloads aren't dropped - get_work_items_batch: chunk comma-separated IDs into 200-batch loops with proper status checks (was failing or returning incomplete data on >200 IDs) - Add tests for both behaviors Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
- 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>
|
@cursor review |
- Webhook provider extractIdempotencyId returns null when subscriptionId or notificationId is missing/empty, preventing the literal "azure_devops:undefined:undefined" key from collapsing unrelated deliveries into duplicates - Get Work Items Batch validates that at least one non-empty ID is supplied before issuing the API request, throwing a clear error instead of hitting an empty ids= query - Tests cover both behaviors Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 41b172f. Configure here.
Microsoft's Add Comments docs only publish 7.0-preview.3 (the 7.2 view falls back to the 7.0 page). Get Comments stays on the documented 7.2-preview.4. Matches what's strictly in the Azure DevOps REST API reference rather than relying on undocumented version behavior. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
Pulls in @mzxchandra's Azure DevOps integration from #4642, rebases onto
staging, and applies validate-integration fixes.Supersedes #4642 (which targeted a fork branch — this PR carries the rebased commits on origin so it can be merged through the normal flow).
Validate-integration fixes applied on top of #4642
bgColorswitched from#FFFFFFto Azure DevOps blue#0078D4in both block and docsBlockInfoCard— the white-on-light theme was unreadable.query_work_itemspreviously sliced to the first 200 IDs and silently dropped the rest. It now chunks the matched IDs into batches of 200 and hydrates all matches. Added an HTTP status check on the follow-up fetch so a 401/403 from the second call surfaces a clear error instead of producing empty rows. NewtotalMatchedfield in metadata reports the pre-hydration count.query_work_itemsURL now trimsorganization/projectto avoid copy-paste whitespace 404s.{/* MANUAL-CONTENT-START:intro */}block toazure_devops.mdxwith audience-facing description and use cases (matches the convention used by other tool docs, e.g.box.mdx).What's included (from #4642)
16 tools across pipelines, builds, and work-item tracking; single
azure_devopsblock; 2 webhook triggers (build.completefailed/canceled/partial,workitem.created). PAT auth via HTTP Basic. Targets Azure DevOps Services (cloud), API version 7.2.Test plan
bun vitest run tools/azure_devops/azure-devops.test.ts→ 20 passedbun vitest run blocks/blocks/azure_devops.test.ts→ 6 passedbun run check:api-validationpassesazure_devops_query_work_itemswith a WIQL returning >200 rows; verify all rows hydrate