Skip to content

Do not update immutable AdvisoryV2 #2187

@keshav-space

Description

@keshav-space

Do not update an existing advisory identified by the unique combination of (content_id, pipeline_id, and advisory_id). Advisories are immutable so it does not make sense to alter related field of an immutable advisory. If the incoming advisory has changed it will lead to new content_id and therefore a new advisory will be created for that advisory_id.

Code below will alter the advisory relation even if the advisory in question already exists.

for field_name, values in related_fields.items():
if values:
getattr(advisory_obj, field_name).add(*values)

If there is any parsing bug in an existing advisory, it should be handled in a pipeline or through data migration using the original_advisory_text field.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions