DependencyTrack / dependency-track

Dependency-Track is an intelligent Component Analysis platform that allows organizations to identify and reduce risk in the software supply chain.
https://dependencytrack.org/
Apache License 2.0
2.61k stars 553 forks source link

Gracefully handle `NotSortableException`s #3724

Closed nscuro closed 4 months ago

nscuro commented 4 months ago

Description

Adds a JAX-RS ExceptionMapper for NotSortableException, which was introduced in https://github.com/stevespringett/Alpine/pull/554.

In previous versions of Dependency-Track, attempts to sort by fields that are not sortable were silently ignored. As of Alpine 2.2.6, an exception will be raised instead.

This PR handles those exceptions gracefully, and returns a response in RFC 9457 format to the client.

Addressed Issue

N/A

Additional Details

N/A

Checklist

codacy-production[bot] commented 4 months ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
:white_check_mark: +0.03% (target: -1.00%) :white_check_mark: 100.00% (target: 70.00%)
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (db58e69558845a53e3342c0e749d8abf5376e6ab) | 21630 | 16377 | 75.71% | | | Head commit (49c9359fbf2405cffb4215881d5076b4e14e19ba) | 21640 (+10) | 16390 (+13) | 75.74% (**+0.03%**) | **Coverage variation** is the difference between the coverage for the head and common ancestor commits of the pull request branch: ` - `
Diff coverage details | | Coverable lines | Covered lines | Diff coverage | | ------------- | ------------- | ------------- | ------------- | | Pull request (#3724) | 10 | 10 | **100.00%** | **Diff coverage** is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: `/ * 100%`

See your quality gate settings    Change summary preferences

Codacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more