Skip to content

[O2B-1623] Document the DPL process endpoints in the HTTP API documentation - #2282

Open
graduta wants to merge 7 commits into
feature/O2B-1623/docs-attachments-endpointsfrom
feature/O2B-1623/docs-dpl-process-endpoints
Open

graduta wants to merge 7 commits into
feature/O2B-1623/docs-attachments-endpointsfrom
feature/O2B-1623/docs-dpl-process-endpoints

Conversation

@graduta

@graduta graduta commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

I have a JIRA ticket

  • branch and/or PR name(s) include(s) JIRA ID
  • issue has "Fix version" assigned
  • issue "Status" is set to "In review"
  • PR labels are selected

Part of a stack of PRs documenting the HTTP API (O2B-1623). This PR is stacked on the previous one of the stack (its base is the branch of that PR): GitHub retargets it to main once the PRs below are merged.

Notable changes for users:

  • The four GET /api/dpl-process/* endpoints (detectors, processes, hosts, executions) are now documented at /api-docs.
  • The ids of these endpoints (run number, detector id, process id, host id) are validated as positive integers: 0, negative numbers and decimals are rejected with a 400 instead of ending as a 404.
  • The detectors, processes (and their type), hosts and executions no longer contain createdAt and updatedAt (nothing used them; breaking for any external client reading them).

Notable changes for developers:

  • Checked the chain of the endpoints: all 38 files of the chain have their license header, no use case is involved and the router references existing handlers. The frontend (run details page) only reads names, ids, the process type label, the host name and the arguments.
  • The four read methods of DplProcessService queried the repositories directly while the creation of an execution already relies on small functions: they now use getDplDetectorIdsWithExecutedProcessesInRun, getAllDplDetectors, getDplProcessIdsExecutedInRunByDetector, getAllDplProcesses, getHostIdsWithExecutedDplProcess, getAllHosts and getAllDplProcessExecutions, each with a test. The two steps of the queries (ids first, then sorted entities) are kept. Checked against the previous service with the SQL layer stubbed: same queries (up to redundant parentheses) and same results.
  • The adapters of the DPL detectors, processes, process types, process executions and hosts (only used by these endpoints and by the gRPC creation of an execution, whose response is only the id) stop returning createdAt / updatedAt, and their typedefs are updated. The always empty relations (processesExecutions, and detector, host, process, run set to null) are left as they are: the tests check them.
  • The controller disabled the JSDoc rules for the whole file: the handlers are documented. The DplProcessExecution typedef declared strings for processId and hostId (integers) and for args (nullable).

Changes made to the database:

  • None

🤖 Generated with Claude Code

@graduta
graduta requested a review from isaachilly as a code owner October 22, 2026 13:56
@graduta graduta added documentation Improvements or additions to documentation backend labels Oct 22, 2026
@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.11%. Comparing base (cdcaebe) to head (defc87e).

Additional details and impacted files
@@                               Coverage Diff                               @@
##           feature/O2B-1623/docs-attachments-endpoints    #2282      +/-   ##
===============================================================================
+ Coverage                                        42.53%   43.11%   +0.57%     
===============================================================================
  Files                                             1064     1071       +7     
  Lines                                            17453    17496      +43     
  Branches                                          3178     3176       -2     
===============================================================================
+ Hits                                              7424     7543     +119     
+ Misses                                           10029     9953      -76     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@graduta
graduta added this pull request to stack #2276 October 22, 2026 14:02
The controller disabled the JSDoc rules for the whole file: its four handlers now describe their parameters and their result (and the documentation of the hosts handler, which read "the hosts that on which", is fixed).
…er entity ids

The run number, the detector id, the process id and the host id of the DPL process endpoints were validated as any number (`0`, negative numbers and decimals were accepted and
ended as a 404). They are validated with `EntityIdDto`, so that invalid values are rejected with a 400, and an API test checks one invalid value on each endpoint.
…processes, hosts and executions

Nothing uses the creation and update dates returned by the DPL process endpoints: the run details page only reads the names, the process type label, the host name and the arguments, and no
test checks them. The adapters of the DPL detectors, processes, process types, process executions and hosts, only used by these endpoints (and the gRPC creation of an execution, whose response is
only the id), stop returning them and their typedefs are updated. The (always empty) relations of these entities are left as they are, as the tests check them.
…ions

The four read methods of `DplProcessService` queried the DPL detectors, DPL processes, hosts and process executions repositories directly, while the creation of an execution already
relies on small functions. They now use `getDplDetectorIdsWithExecutedProcessesInRun`, `getAllDplDetectors`, `getDplProcessIdsExecutedInRunByDetector`, `getAllDplProcesses`,
`getHostIdsWithExecutedDplProcess`, `getAllHosts` and `getAllDplProcessExecutions`, each with a test. The two steps of the queries (a first one for the ids, a second one for the sorted entities)
are kept as they were.

Checked against the previous service with the SQL layer stubbed: the same queries are generated (up to redundant parentheses around conditions) and the same results are returned.
`processId` and `hostId` are integers (as the columns of the table) and `args` can be null, but the typedef declared strings.
@graduta
graduta force-pushed the feature/O2B-1623/docs-dpl-process-endpoints branch from 43d3189 to defc87e Compare October 22, 2026 14:35

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend documentation Improvements or additions to documentation

Development

Successfully merging this pull request may close these issues.

2 participants