Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes invalid
stream header
exception when modifying analyses with associated vuln policy.When an existing analysis, which is assigned to a vulnerability policy, was updated, DataNucleus failed with
invalid stream header
. This happened because, when updating an analysis, DataNucleus fetches all associated objects, which includesVulnerabilityPolicy
.The
VulnerabilityPolicy
class does not map cleanly to the database schema: Some fields use PostgreSQL-native arrays, others use JSONB.It also turned out that the model class isn't really used anywhere, since we modify and query
VulnerabilityPolicy
via JDBI. Hence the class was removed entirely, replacing it with a simple ID column of typeLong
.Also fixes vuln policy assignment getting lost upon project cloning.
Addressed Issue
N/A
Additional Details
N/A
Checklist
This PR implements an enhancement, and I have provided tests to verify that it works as intendedThis PR introduces changes to the database model, and I have updated the migration changelog accordinglyThis PR introduces new or alters existing behavior, and I have updated the documentation accordingly