Skip to content

Expose workflow run status on BOM token polling endpoint - #7127

Merged
nscuro merged 1 commit into
DependencyTrack:mainfrom
Suhas2109:fix/bomTokenSilentFailure
Aug 27, 2026
Merged

nscuro merged 1 commit into
DependencyTrack:mainfrom
Suhas2109:fix/bomTokenSilentFailure

Conversation

@Suhas2109

@Suhas2109 Suhas2109 commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes the BOM upload token polling endpoints (GET /v1/bom/token/{uuid} and GET /v1/event/token/{uuid}) so they now expose the actual processing status of the associated workflow run instead of silently reporting only a boolean processing flag. The response now includes a status field using a dedicated, consumer-facing IsTokenBeingProcessedResponse.Status enum (PENDING, RUNNING, COMPLETED, FAILED), decoupled from the internal WorkflowRunStatus used by the workflow engine. Additionally, the underlying listRuns lookups by BOM upload token now specify an explicit sort order (CREATED_AT descending) to ensure deterministic results when multiple runs share the same label.

Addressed Issue

Relates to #1665

Additional Details

  • Introduced IsTokenBeingProcessedResponse.Status, a dedicated enum mirroring the pattern used in VulnDataSourceMirrorService.MirrorStatus.Status, to avoid leaking internal WorkflowRunStatus semantics (and the word "workflow") into the public API surface.
  • Status.of(WorkflowRunStatus) maps: CREATED / SUSPENDED -> PENDING, RUNNING -> RUNNING, COMPLETED -> COMPLETED, CANCELLED / FAILED -> FAILED.
  • Added explicit .withSortBy(CREATED_AT) + .withSortDirection(DESC) to the listRuns calls in BomResource and EventResource for deterministic run resolution.
  • Verified manually: a corrupted BOM upload yields {"processing": false, "status": "FAILED"}, and a valid BOM upload yields {"processing": false, "status": "COMPLETED"} once processing completes.
  • Rebasing onto latest upstream main to resolve a merge conflict caused by a concurrent unrelated refactor of the same endpoint.

Checklist

  • I have read and understand the [contributing guidelines]
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have updated the [migration changelog] accordingly
  • This PR introduces new or alters existing behavior, and I have updated the [documentation] accordingly
  • This PR is a substantial change (per the [ADR criteria]), and I have added an [ADR] under docs/adr/

@owasp-dt-bot

owasp-dt-bot commented Aug 26, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codacy-production

codacy-production Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

🟢 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%)

View coverage diff in Codacy

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 nscuro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR! A few changes please.

Also, make sure to follow the PR template. The corresponding build check is currently failing.

@Suhas2109

Copy link
Copy Markdown
Contributor Author

Hi @nscuro ,
Thanks for the detailed review! Will address all points and will push updates shortly.

@Suhas2109
Suhas2109 force-pushed the fix/bomTokenSilentFailure branch 2 times, most recently from 806f41e to 2acd8a2 Compare August 27, 2026 06:09
@Suhas2109

Copy link
Copy Markdown
Contributor Author

Hi @nscuro !
I've pushed the requested changes.
Let me know if anything else needs adjusting.

@Suhas2109
Suhas2109 force-pushed the fix/bomTokenSilentFailure branch 3 times, most recently from 2bf0b9a to 699b630 Compare August 27, 2026 08:09
@Suhas2109
Suhas2109 force-pushed the fix/bomTokenSilentFailure branch from 699b630 to da5aa77 Compare August 27, 2026 09:15
@nscuro nscuro added this to the 5.1 milestone Aug 27, 2026
@nscuro nscuro added the enhancement New feature or request label Aug 27, 2026

@nscuro nscuro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

@nscuro nscuro changed the title fix(api): expose workflow run status on BOM token polling endpoint Expose workflow run status on BOM token polling endpoint Aug 27, 2026
@nscuro
nscuro merged commit 1151a80 into DependencyTrack:main Aug 27, 2026
24 checks passed
@nscuro nscuro linked an issue Oct 17, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Queue status API

3 participants