Skip to content

Commit e192a25

Browse files
authored
Merge pull request #75 from abnamro/2030291-bug-fix-save-findings
[#2030291] Handled scenario when comment is none and release v1.0.3
2 parents 53e0732 + 3826f17 commit e192a25

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-9
lines changed

components/resc-backend/setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[metadata]
22
name = resc_backend
33
description = Repository Scanner - Backend
4-
version = 1.0.2
4+
version = 1.0.3
55
author = ABN AMRO
66
author_email = resc@nl.abnamro.com
77
url = https://github.com/ABNAMRO/repository-scanner

components/resc-backend/src/resc_backend/db/model/finding.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def __init__(self, rule_name, file_path, line_number, commit_id, commit_message,
4848

4949
@staticmethod
5050
def create_from_finding(finding):
51+
sanitized_comment = html.escape(finding.comment) if finding.comment else finding.comment
5152
db_finding = DBfinding(
5253
rule_name=finding.rule_name,
5354
file_path=finding.file_path,
@@ -58,7 +59,7 @@ def create_from_finding(finding):
5859
commit_timestamp=finding.commit_timestamp,
5960
author=finding.author,
6061
status=finding.status,
61-
comment=html.escape(finding.comment),
62+
comment=sanitized_comment,
6263
event_sent_on=finding.event_sent_on,
6364
branch_id=finding.branch_id
6465
)

components/resc-backend/src/resc_backend/resc_web_service/crud/finding.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323

2424

2525
def update_finding(db_connection: Session, finding_id: int, finding: finding_schema.FindingUpdate):
26+
sanitized_comment = html.escape(finding.comment) if finding.comment else finding.comment
2627
db_finding = db_connection.query(model.DBfinding).filter_by(id_=finding_id).first()
2728
db_finding.status = finding.status
28-
db_finding.comment = html.escape(finding.comment)
29+
db_finding.comment = sanitized_comment
2930
db_connection.commit()
3031
db_connection.refresh(db_finding)
3132
return db_finding
@@ -58,8 +59,9 @@ def audit_finding(db_connection: Session, db_finding: finding_schema.FindingRead
5859
:return: FindingRead
5960
The output will contain the findings that was updated
6061
"""
62+
sanitized_comment = html.escape(comment) if comment else comment
6163
db_finding.status = status
62-
db_finding.comment = html.escape(comment)
64+
db_finding.comment = sanitized_comment
6365

6466
db_connection.commit()
6567
db_connection.refresh(db_finding)

components/resc-frontend/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "resc-frontend",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"author": "ABN AMRO Bank",
55
"description": "Repository Scanner Frontend",
66
"repository": {

components/resc-vcs-scanner/setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[metadata]
22
name = resc_vcs_scanner
33
description = Repository Scanner - Version Control System - Scanner
4-
version = 1.0.2
4+
version = 1.0.3
55
author = ABN AMRO
66
author_email = resc@nl.abnamro.com
77
url = https://github.com/ABNAMRO/repository-scanner

components/resc-vcs-scraper/setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[metadata]
22
name = resc_vcs_scraper
33
description = Repository Scanner - Version Control System - Scraper
4-
version = 1.0.2
4+
version = 1.0.3
55
author = ABN AMRO
66
author_email = resc@nl.abnamro.com
77
url = https://github.com/ABNAMRO/repository-scanner

deployment/kubernetes/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ description: A Helm chart for the Repository Scanner
44

55
type: application
66

7-
version: 1.0.2
7+
version: 1.0.3
88

9-
appVersion: "1.0.2"
9+
appVersion: "1.0.3"
1010

1111
dependencies:
1212
- name: resc-vcs-instances

0 commit comments

Comments
 (0)