generated from aboutcode-org/skeleton
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jono Yang <[email protected]>
- Loading branch information
Showing
9 changed files
with
103 additions
and
52 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
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
63 changes: 63 additions & 0 deletions
63
packagedb/migrations/0079_remove_package_packagedb_p_search__8d33bb_gin_and_more.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,63 @@ | ||
# Generated by Django 4.1.2 on 2023-10-31 20:44 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("packagedb", "0078_alter_package_release_date"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveIndex( | ||
model_name="package", | ||
name="packagedb_p_search__8d33bb_gin", | ||
), | ||
migrations.RemoveField( | ||
model_name="package", | ||
name="search_vector", | ||
), | ||
migrations.AlterField( | ||
model_name="package", | ||
name="name", | ||
field=models.CharField( | ||
blank=True, help_text="Name of the package.", max_length=100 | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="package", | ||
name="namespace", | ||
field=models.CharField( | ||
blank=True, | ||
help_text="Package name prefix, such as Maven groupid, Docker image owner, GitHub user or organization, etc.", | ||
max_length=255, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="package", | ||
name="qualifiers", | ||
field=models.CharField( | ||
blank=True, | ||
help_text="Extra qualifying data for a package such as the name of an OS, architecture, distro, etc.", | ||
max_length=1024, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="package", | ||
name="subpath", | ||
field=models.CharField( | ||
blank=True, | ||
help_text="Extra subpath within a package, relative to the package root.", | ||
max_length=200, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="package", | ||
name="type", | ||
field=models.CharField( | ||
blank=True, | ||
help_text="A short code to identify the type of this package. For example: gem for a Rubygem, docker for a container, pypi for a Python Wheel or Egg, maven for a Maven Jar, deb for a Debian package, etc.", | ||
max_length=16, | ||
), | ||
), | ||
] |
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 |
---|---|---|
|
@@ -362,7 +362,7 @@ def test_package_api_list_endpoint_filter(self): | |
def test_package_api_list_endpoint_filter_by_purl_fields_ignores_case(self): | ||
for key, value in self.package_data.items(): | ||
# Skip non-purl fields | ||
if key not in ['type', 'namespace', 'name', 'version', 'qualifiers', 'subpath']: | ||
if key not in ['type', 'namespace', 'name']: | ||
continue | ||
|
||
response = self.client.get('/api/packages/?{}={}'.format(key, value.lower())) | ||
|
@@ -384,7 +384,7 @@ def test_package_api_retrieve_endpoint(self): | |
continue | ||
|
||
if key in ['type', 'namespace', 'name', 'version', 'qualifiers', 'subpath']: | ||
self.assertEqual(value.lower(), getattr(self.package, key)) | ||
self.assertEqual(value, getattr(self.package, key)) | ||
continue | ||
|
||
if key == 'history': | ||
|
@@ -640,7 +640,7 @@ def test_reindex_package(self): | |
self.assertEqual('error', self.scannableuri.index_error) | ||
self.assertEqual(self.scan_request_date, self.scannableuri.scan_request_date) | ||
response = self.client.get(f'/api/packages/{self.package.uuid}/reindex_package/') | ||
self.assertEqual('pkg:maven/sample/baz@90.12 has been queued for reindexing', response.data['status']) | ||
self.assertEqual('pkg:maven/sample/Baz@90.12 has been queued for reindexing', response.data['status']) | ||
self.scannableuri.refresh_from_db() | ||
self.assertEqual(True, self.scannableuri.rescan_uri) | ||
self.assertEqual(100, self.scannableuri.priority) | ||
|
@@ -664,7 +664,7 @@ def test_reindex_packages_basic(self): | |
self.assertEqual('error', self.scannableuri2.index_error) | ||
self.assertEqual(self.scan_request_date2, self.scannableuri2.scan_request_date) | ||
existing_purls = [ | ||
'pkg:maven/sample/baz@90.12', | ||
'pkg:maven/sample/Baz@90.12', | ||
'pkg:npm/example/[email protected]', | ||
] | ||
nonexistent_purls = [ | ||
|
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