Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions scanpipe/migrations/0086_alter_codebaseresource_file_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 6.1.3 on 2026-11-23 12:21

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('scanpipe', '0085_origindetermination'),
]

operations = [
migrations.AlterField(
model_name='codebaseresource',
name='file_type',
field=models.TextField(blank=True, help_text='Descriptive file type for this resource.'),
),
]
3 changes: 1 addition & 2 deletions scanpipe/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2912,8 +2912,7 @@ class Type(models.TextChoices):
"See https://en.wikipedia.org/wiki/Media_type"
),
)
file_type = models.CharField(
max_length=1024,
file_type = models.TextField(
blank=True,
help_text=_("Descriptive file type for this resource."),
)
Expand Down
8 changes: 8 additions & 0 deletions scanpipe/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1707,6 +1707,14 @@ def test_scanpipe_codebase_resource_model_file_content(self):
line_count = len(resource.file_content.split("\n"))
self.assertEqual(101, line_count)

def test_scanpipe_codebase_resource_model_long_file_type(self):
file_type = "ELF 64-bit LSB shared object, " * 50
resource = self.project1.codebaseresources.create(
path="lib.so", file_type=file_type
)
resource.refresh_from_db()
self.assertEqual(file_type, resource.file_type)

def test_scanpipe_codebase_resource_model_has_parent_segment(self):
self.assertFalse(CodebaseResource.has_parent_segment("dir/file..txt"))
self.assertFalse(CodebaseResource.has_parent_segment("..dir/file"))
Expand Down
Loading