Skip to content

Commit e8c668c

Browse files
committed
chore: merged migration / lint fixes
1 parent 3ce285b commit e8c668c

File tree

6 files changed

+31
-18
lines changed

6 files changed

+31
-18
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Generated by Django 5.2.4 on 2025-07-27 12:57
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("commons", "0017_settings_periodic_task_max_entries"),
10+
("commons", "0018_merge_20250512_1218"),
11+
]
12+
13+
operations = []

backend/application/core/services/assessment.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ def save_assessment(
7171
Assessment_Status.ASSESSMENT_STATUS_AUTO_APPROVED,
7272
):
7373
_update_observation(
74-
observation,
75-
new_severity,
76-
new_status,
77-
new_vex_justification,
78-
new_vex_remediations,
79-
new_risk_acceptance_expiry_date,
74+
observation=observation,
75+
new_severity=new_severity,
76+
new_status=new_status,
77+
new_vex_justification=new_vex_justification,
78+
new_vex_remediations=new_vex_remediations,
79+
new_risk_acceptance_expiry_date=new_risk_acceptance_expiry_date,
8080
)
8181

8282
create_observation_log(
@@ -106,6 +106,7 @@ def save_assessment(
106106

107107

108108
def _update_observation(
109+
*,
109110
observation: Observation,
110111
new_severity: Optional[str],
111112
new_status: Optional[str],
@@ -212,12 +213,12 @@ def assessment_approval(observation_log: Observation_Log, assessment_status: str
212213
Assessment_Status.ASSESSMENT_STATUS_AUTO_APPROVED,
213214
):
214215
_update_observation(
215-
observation_log.observation,
216-
observation_log.severity,
217-
observation_log.status,
218-
observation_log.vex_justification,
219-
observation_log.vex_remediations,
220-
observation_log.risk_acceptance_expiry_date,
216+
observation=observation_log.observation,
217+
new_severity=observation_log.severity,
218+
new_status=observation_log.status,
219+
new_vex_justification=observation_log.vex_justification,
220+
new_vex_remediations=observation_log.vex_remediations,
221+
new_risk_acceptance_expiry_date=observation_log.risk_acceptance_expiry_date,
221222
)
222223

223224
check_security_gate(observation_log.observation.product)

backend/application/core/services/observation_log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from application.core.models import Observation, Observation_Log
77

88

9-
def create_observation_log(
9+
def create_observation_log( # pylint: disable=too-many-arguments
1010
*,
1111
observation: Observation,
1212
severity: str,

backend/application/core/services/observations_bulk_actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
)
2828

2929

30-
def observations_bulk_assessment(
30+
def observations_bulk_assessment( # pylint: disable=too-many-arguments
3131
*,
3232
product: Optional[Product],
3333
new_severity: str,

backend/application/import_observations/parsers/cyclone_dx/parser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,7 @@ def parse_version(version: str) -> tuple[int, ...]:
271271
minor_diff = abs(v2[1] - v1[1])
272272
patch_diff = abs(v2[2] - v1[2])
273273
upgrade_impact_score = major_diff * 100 + minor_diff * 10 + patch_diff
274-
if upgrade_impact_score < lowest_impact_score:
275-
lowest_impact_score = upgrade_impact_score
274+
lowest_impact_score = min(lowest_impact_score, upgrade_impact_score)
276275
upgrade_impact_score = lowest_impact_score
277276

278277
observation = Observation(

backend/application/rules/services/rule_engine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self, product: Product):
5454

5555
self.product = product
5656

57-
def apply_rules_for_observation(self, observation: Observation) -> None:
57+
def apply_rules_for_observation(self, observation: Observation) -> None: # pylint: disable=too-many-branches
5858
if observation.current_status != Status.STATUS_OPEN:
5959
return
6060

@@ -181,7 +181,7 @@ def _check_regex(self, pattern: str, value: str) -> bool:
181181
compiled_pattern = re.compile(pattern, re.IGNORECASE)
182182
return compiled_pattern.match(value) is not None
183183

184-
def _write_observation_log(
184+
def _write_observation_log( # pylint: disable=too-many-arguments,too-many-branches
185185
self,
186186
*,
187187
observation: Observation,

0 commit comments

Comments
 (0)