Repository navigation
Expose workflow run status on BOM token polling endpoint - #7127
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
🟢 Coverage 94.59% diff coverage · -0.01% coverage variation
Metric Results Coverage variation ✅ -0.01% coverage variation (-1.00%) Diff coverage ✅ 94.59% diff coverage (70.00%) Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (b881e18) 44317 38684 87.29% Head commit (da5aa77) 44337 (+20) 38695 (+11) 87.27% (-0.01%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#7127) 37 35 94.59% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
nscuro
left a comment
There was a problem hiding this comment.
Thanks for the PR! A few changes please.
Also, make sure to follow the PR template. The corresponding build check is currently failing.
|
Hi @nscuro , |
806f41e to
2acd8a2
Compare
|
Hi @nscuro ! |
2bf0b9a to
699b630
Compare
Signed-off-by: suhas-SHS <[email protected]>
699b630 to
da5aa77
Compare
nscuro
left a comment
There was a problem hiding this comment.
Thanks!
FYI I replaced the "Fixes" with "Relates to" for #1665 because this change is API-only, whereas the issue was asking for making upload status observable by users:
There should be a way to see that the BOM processing failed in the frontend, especially when uploaded manually
Description
Fixes the BOM upload token polling endpoints (
GET /v1/bom/token/{uuid}andGET /v1/event/token/{uuid}) so they now expose the actual processing status of the associated workflow run instead of silently reporting only a booleanprocessingflag. The response now includes astatusfield using a dedicated, consumer-facingIsTokenBeingProcessedResponse.Statusenum (PENDING,RUNNING,COMPLETED,FAILED), decoupled from the internalWorkflowRunStatusused by the workflow engine. Additionally, the underlyinglistRunslookups by BOM upload token now specify an explicit sort order (CREATED_ATdescending) to ensure deterministic results when multiple runs share the same label.Addressed Issue
Relates to #1665
Additional Details
IsTokenBeingProcessedResponse.Status, a dedicated enum mirroring the pattern used inVulnDataSourceMirrorService.MirrorStatus.Status, to avoid leaking internalWorkflowRunStatussemantics (and the word "workflow") into the public API surface.Status.of(WorkflowRunStatus)maps:CREATED/SUSPENDED->PENDING,RUNNING->RUNNING,COMPLETED->COMPLETED,CANCELLED/FAILED->FAILED..withSortBy(CREATED_AT)+.withSortDirection(DESC)to thelistRunscalls inBomResourceandEventResourcefor deterministic run resolution.{"processing": false, "status": "FAILED"}, and a valid BOM upload yields{"processing": false, "status": "COMPLETED"}once processing completes.mainto resolve a merge conflict caused by a concurrent unrelated refactor of the same endpoint.Checklist
docs/adr/