Skip to content

Commit

Permalink
Merge branch 'main' into add-curl-advisories-importer
Browse files Browse the repository at this point in the history
  • Loading branch information
ambuj-1211 authored May 10, 2024
2 parents 24b5eaa + 4a6734b commit a5b0752
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 127 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Release notes
=============

Version v34.0.0rc4
-------------------

- Drop migration for removing duplicated changelogs.


Version v34.0.0rc3
-------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Generated by Django 4.1.13 on 2024-02-26 13:52
# Generated by Django 4.1.13 on 2024-03-18 08:35

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("vulnerabilities", "0056_alter_packagechangelog_unique_together_and_more"),
("vulnerabilities", "0054_alter_packagechangelog_software_version_and_more"),
]

operations = [
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Generated by Django 4.1.13 on 2024-03-18 08:45

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("vulnerabilities", "0055_alter_packagechangelog_software_version_and_more"),
]

operations = [
migrations.AlterField(
model_name="packagechangelog",
name="software_version",
field=models.CharField(
default="34.0.0rc4",
help_text="Version of the software at the time of change",
max_length=100,
),
),
migrations.AlterField(
model_name="vulnerabilitychangelog",
name="software_version",
field=models.CharField(
default="34.0.0rc4",
help_text="Version of the software at the time of change",
max_length=100,
),
),
]

This file was deleted.

1 change: 0 additions & 1 deletion vulnerabilities/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,6 @@ def get_iso_time(self):
class Meta:
abstract = True
ordering = ("-action_time",)
unique_together = ("action_time", "actor_name", "action_type", "source_url")


class VulnerabilityHistoryManager(models.Manager):
Expand Down
50 changes: 0 additions & 50 deletions vulnerabilities/tests/test_data_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,53 +610,3 @@ def setUpBeforeMigration(self, apps):
def test_removal_of_duped_purls(self):
Package = apps.get_model("vulnerabilities", "Package")
assert Package.objects.count() == 1


class TestRemoveDupedChangeLogWithSameData(TestMigrations):
app_name = "vulnerabilities"
migrate_from = "0054_alter_packagechangelog_software_version_and_more"
migrate_to = "0055_remove_changelogs_with_same_data_different_software_version"

def setUpBeforeMigration(self, apps):
PackageChangeLog = apps.get_model("vulnerabilities", "PackageChangeLog")
VulnerabilityChangeLog = apps.get_model("vulnerabilities", "VulnerabilityChangeLog")
Package = apps.get_model("vulnerabilities", "Package")
Vulnerability = apps.get_model("vulnerabilities", "Vulnerability")
pkg1 = Package.objects.create(type="nginx", name="nginx", qualifiers={"os": "windows"})
vuln = Vulnerability.objects.create(summary="NEW")
PackageChangeLog.objects.create(
actor_name="Nginx",
action_type=1,
source_url="test",
software_version="1",
package=pkg1,
related_vulnerability=vuln,
)
PackageChangeLog.objects.create(
actor_name="Nginx",
action_type=1,
source_url="test",
software_version="2",
package=pkg1,
related_vulnerability=vuln,
)
VulnerabilityChangeLog.objects.create(
actor_name="Nginx",
action_type=1,
source_url="test",
software_version="2",
vulnerability=vuln,
)
VulnerabilityChangeLog.objects.create(
actor_name="Nginx",
action_type=1,
source_url="test",
software_version="1",
vulnerability=vuln,
)

def test_removal_of_changelog(self):
PackageChangeLog = apps.get_model("vulnerabilities", "PackageChangeLog")
VulnerabilityChangeLog = apps.get_model("vulnerabilities", "VulnerabilityChangeLog")
assert PackageChangeLog.objects.all().count() == 1
assert VulnerabilityChangeLog.objects.all().count() == 1
2 changes: 1 addition & 1 deletion vulnerablecode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import warnings
from pathlib import Path

__version__ = "34.0.0rc3"
__version__ = "34.0.0rc4"


def command_line():
Expand Down

0 comments on commit a5b0752

Please sign in to comment.