-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into Page-Updated
- Loading branch information
Showing
27 changed files
with
1,419 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Default configuration for development build | ||
# DB Version: 13 | ||
# OS Type: linux | ||
# DB Type: development | ||
# Data Storage: local | ||
|
||
listen_addresses = '*' | ||
max_connections = 100 | ||
shared_buffers = 128MB | ||
dynamic_shared_memory_type = posix | ||
max_wal_size = 1GB | ||
min_wal_size = 80MB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# Generated by Django 4.2.16 on 2025-01-08 13:28 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("vulnerabilities", "0085_alter_package_is_ghost_alter_package_version_rank_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="CodeFix", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, primary_key=True, serialize=False, verbose_name="ID" | ||
), | ||
), | ||
( | ||
"commits", | ||
models.JSONField( | ||
blank=True, | ||
default=list, | ||
help_text="List of commit identifiers using VCS URLs associated with the code change.", | ||
), | ||
), | ||
( | ||
"pulls", | ||
models.JSONField( | ||
blank=True, | ||
default=list, | ||
help_text="List of pull request URLs associated with the code change.", | ||
), | ||
), | ||
( | ||
"downloads", | ||
models.JSONField( | ||
blank=True, | ||
default=list, | ||
help_text="List of download URLs for the patched code.", | ||
), | ||
), | ||
( | ||
"patch", | ||
models.TextField( | ||
blank=True, | ||
help_text="The code change as a patch in unified diff format.", | ||
null=True, | ||
), | ||
), | ||
( | ||
"notes", | ||
models.TextField( | ||
blank=True, | ||
help_text="Notes or instructions about this code change.", | ||
null=True, | ||
), | ||
), | ||
( | ||
"references", | ||
models.JSONField( | ||
blank=True, | ||
default=list, | ||
help_text="URL references related to this code change.", | ||
), | ||
), | ||
( | ||
"is_reviewed", | ||
models.BooleanField( | ||
default=False, help_text="Indicates if this code change has been reviewed." | ||
), | ||
), | ||
( | ||
"created_at", | ||
models.DateTimeField( | ||
auto_now_add=True, | ||
help_text="Timestamp indicating when this code change was created.", | ||
), | ||
), | ||
( | ||
"updated_at", | ||
models.DateTimeField( | ||
auto_now=True, | ||
help_text="Timestamp indicating when this code change was last updated.", | ||
), | ||
), | ||
( | ||
"affected_package_vulnerability", | ||
models.ForeignKey( | ||
help_text="The affected package version to which this code fix applies.", | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="code_fix", | ||
to="vulnerabilities.affectedbypackagerelatedvulnerability", | ||
), | ||
), | ||
( | ||
"base_package_version", | ||
models.ForeignKey( | ||
blank=True, | ||
help_text="The base package version to which this code change applies.", | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="codechanges", | ||
to="vulnerabilities.package", | ||
), | ||
), | ||
( | ||
"fixed_package_vulnerability", | ||
models.ForeignKey( | ||
blank=True, | ||
help_text="The fixing package version with this code fix", | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="code_fix", | ||
to="vulnerabilities.fixingpackagerelatedvulnerability", | ||
), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
), | ||
] |
36 changes: 36 additions & 0 deletions
36
vulnerabilities/migrations/0087_update_alpine_advisory_created_by.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
from django.db import migrations | ||
|
||
""" | ||
Update the created_by field on Advisory from the old qualified_name | ||
to the new pipeline_id. | ||
""" | ||
|
||
|
||
def update_created_by(apps, schema_editor): | ||
from vulnerabilities.pipelines.alpine_linux_importer import AlpineLinuxImporterPipeline | ||
|
||
Advisory = apps.get_model("vulnerabilities", "Advisory") | ||
Advisory.objects.filter(created_by="vulnerabilities.importers.alpine_linux.AlpineImporter").update( | ||
created_by=AlpineLinuxImporterPipeline.pipeline_id | ||
) | ||
|
||
|
||
def reverse_update_created_by(apps, schema_editor): | ||
from vulnerabilities.pipelines.alpine_linux_importer import AlpineLinuxImporterPipeline | ||
|
||
Advisory = apps.get_model("vulnerabilities", "Advisory") | ||
Advisory.objects.filter(created_by=AlpineLinuxImporterPipeline.pipeline_id).update( | ||
created_by="vulnerabilities.importers.alpine_linux.AlpineImporter" | ||
) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("vulnerabilities", "0086_codefix"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(update_created_by, reverse_code=reverse_update_created_by), | ||
] |
Oops, something went wrong.