Skip to content

Commit

Permalink
Tag files that are whitedouts
Browse files Browse the repository at this point in the history
Signed-off-by: Varsha U N <[email protected]>

Signed-off-by: Varsha U N <[email protected]>

Signed-off-by: Varsha U N <[email protected]>

Signed-off-by: Varsha U N <[email protected]>
  • Loading branch information
VarshaUN committed Jan 12, 2025
1 parent 53700eb commit a8b28da
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions scanpipe/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2609,6 +2609,16 @@ class Type(models.TextChoices):
)

objects = CodebaseResourceQuerySet.as_manager()
labels = TaggableManager(through=UUIDTaggedItem, ordering=["name"])

@staticmethod
def is_white_out_file(file_path):
return file_path.endswith(".whiteout")

def tag_white_out_files(self):
if self.is_white_out_file(self.path):
self.labels.add("white-out")
self.save()

class Meta:
indexes = [
Expand Down
5 changes: 3 additions & 2 deletions scanpipe/pipes/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@
Resolve packages from manifest, lockfile, and SBOM.
"""


def resolve_manifest_resources(resource, package_registry):
def resolve_manifest_resources(resource,package_registry):
"""Get package data from resource."""
packages = get_packages_from_manifest(resource.location, package_registry) or []

for package_data in packages:
package_data["codebase_resources"] = [resource]

resource.tag_white_out_files()

return packages


Expand Down

0 comments on commit a8b28da

Please sign in to comment.