Skip to content

Doug/add guardrails for missing attributes #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 11, 2025
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "hatchling.build"

[project]
name = "socketsecurity"
version = "2.1.0"
version = "2.1.2"
requires-python = ">= 3.10"
license = {"file" = "LICENSE"}
dependencies = [
Expand Down
2 changes: 1 addition & 1 deletion socketsecurity/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__author__ = 'socket.dev'
__version__ = '2.1.0'
__version__ = '2.1.2'
11 changes: 8 additions & 3 deletions socketsecurity/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from socketdev.org import Organization
from socketdev.repos import RepositoryInfo
from socketdev.settings import SecurityPolicyRule

import copy
from socketsecurity import __version__
from socketsecurity.core.classes import (
Alert,
Expand Down Expand Up @@ -628,11 +628,14 @@ def create_new_diff(
head_full_scan_id = None

if head_full_scan_id is None:
tmp_params = params
new_params = copy.deepcopy(params.__dict__)
new_params.pop('include_license_details')
tmp_params = FullScanParams(**new_params)
tmp_params.include_license_details = params.include_license_details
tmp_params.tmp = True
tmp_params.set_as_pending_head = False
tmp_params.make_default_branch = False
head_full_scan = self.create_full_scan(Core.empty_head_scan_file(), params)
head_full_scan = self.create_full_scan(Core.empty_head_scan_file(), tmp_params)
head_full_scan_id = head_full_scan.id

# Create new scan
Expand Down Expand Up @@ -796,6 +799,8 @@ def get_source_data(package: Package, packages: dict) -> list:
introduced_by = []
if package.direct:
manifests = ""
if not hasattr(package, "manifestFiles"):
return introduced_by
for manifest_data in package.manifestFiles:
manifest_file = manifest_data.get("file")
manifests += f"{manifest_file};"
Expand Down
Loading