Skip to content

Expose REST API endpoint to list workflow run events#1753

Merged
nscuro merged 1 commit intomainfrom
workflow-run-events-api
Feb 13, 2026
Merged

Expose REST API endpoint to list workflow run events#1753
nscuro merged 1 commit intomainfrom
workflow-run-events-api

Conversation

@nscuro
Copy link
Copy Markdown
Member

@nscuro nscuro commented Feb 12, 2026

Description

Exposes REST API endpoint to list workflow run events.

Addressed Issue

N/A

Additional Details

N/A

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

@nscuro nscuro added this to the 5.7.0 milestone Feb 12, 2026
Copilot AI review requested due to automatic review settings February 12, 2026 21:54
@nscuro nscuro added the enhancement New feature or request label Feb 12, 2026
@nscuro nscuro force-pushed the workflow-run-events-api branch from 9f60d1d to 72b0f50 Compare February 12, 2026 21:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR exposes a new REST API endpoint to list workflow run events (history). It refactors the internal API to return WorkflowRunHistoryEntry objects (which include both sequence numbers and events) rather than just WorkflowEvent objects, and adds support for sorting, pagination, and polling via a from_sequence_number parameter.

Changes:

  • Added REST API endpoint /workflow-runs/{id}/events with support for pagination, sorting (ASC/DESC), and continuous polling via from_sequence_number
  • Refactored WorkflowRunHistoryEntry from internal persistence model to public API class, exposing sequence numbers alongside events
  • Enhanced listRunHistory to support descending order and filtering from a specific sequence number
  • Updated all existing tests to use the new listRunHistory API returning WorkflowRunHistoryEntry instead of just WorkflowEvent

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
api/src/main/openapi/openapi.yaml Added route definition for new events endpoint
api/src/main/openapi/paths/workflow-runs__id__events.yaml OpenAPI specification for listing workflow run events with pagination and sorting
api/src/main/openapi/components/schemas/list-workflow-run-events-response.yaml Response schema for events list
api/src/main/openapi/components/schemas/list-workflow-run-events-response-item.yaml Schema for individual event items with sequence numbers
apiserver/src/main/java/org/dependencytrack/resources/v2/ResourceConfig.java Registered ObjectMapper for dependency injection
apiserver/src/main/java/org/dependencytrack/resources/v2/WorkflowsResource.java Implemented REST endpoint handler with protobuf-to-JSON conversion
apiserver/src/test/java/org/dependencytrack/resources/v2/WorkflowsResourceTest.java Added basic test for new endpoint
dex/engine-api/src/main/java/org/dependencytrack/dex/engine/api/DexEngine.java Updated interface signature from listRunEvents to listRunHistory
dex/engine-api/src/main/java/org/dependencytrack/dex/engine/api/WorkflowRunHistoryEntry.java Moved from persistence layer to API layer, removed workflowRunId field
dex/engine-api/src/main/java/org/dependencytrack/dex/engine/api/request/ListWorkflowRunEventsRequest.java Removed old request class
dex/engine-api/src/main/java/org/dependencytrack/dex/engine/api/request/ListWorkflowRunHistoryRequest.java New request class with support for fromSequenceNumber and sortDirection
dex/engine/src/main/java/org/dependencytrack/dex/engine/DexEngineImpl.java Updated to use new API, converting history entries to events internally where needed
dex/engine/src/main/java/org/dependencytrack/dex/engine/persistence/WorkflowRunDao.java Enhanced SQL query with FreeMarker template for DESC sorting and fromSequenceNumber filtering
dex/engine/src/main/java/org/dependencytrack/dex/engine/persistence/jdbi/JdbiFactory.java Updated import from persistence model to API
dex/engine/src/main/java/org/dependencytrack/dex/engine/persistence/jdbi/WorkflowRunHistoryEntryRowMapper.java Updated to map to API class, removed workflowRunId mapping
dex/engine/src/test/java/org/dependencytrack/dex/engine/DexEngineImplTest.java Updated all tests to use listRunHistory API and added comprehensive tests for pagination, DESC ordering, and fromSequenceNumber

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread dex/engine-api/src/main/java/org/dependencytrack/dex/engine/api/DexEngine.java Outdated
Comment thread api/src/main/openapi/paths/workflow-runs__id__events.yaml Outdated
@nscuro nscuro force-pushed the workflow-run-events-api branch from 72b0f50 to de57054 Compare February 12, 2026 22:06
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Feb 12, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) 93.55% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (2a8c522) 37608 31512 83.79%
Head commit (7d59856) 37674 (+66) 31569 (+57) 83.80% (+0.00%)

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 (#1753) 93 87 93.55%

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%

See your quality gate settings    Change summary preferences

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nscuro nscuro force-pushed the workflow-run-events-api branch from 0dd638d to 85f51d4 Compare February 13, 2026 13:26
Signed-off-by: nscuro <nscuro@protonmail.com>
@nscuro nscuro force-pushed the workflow-run-events-api branch from 85f51d4 to 7d59856 Compare February 13, 2026 14:06
@nscuro nscuro merged commit 02e6591 into main Feb 13, 2026
12 checks passed
@nscuro nscuro deleted the workflow-run-events-api branch February 13, 2026 14:22
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants