Skip to content

Commit 5a1b344

Browse files
committed
Complete terminology rename from TRUE_POSITIVE/FALSE_POSITIVE to ISSUE/NON_ISSUE
1 parent 5624399 commit 5a1b344

26 files changed

+195
-199
lines changed

config/default_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ CONFIG_H_PATH: ""
2020
COMPILE_COMMANDS_JSON_PATH: ""
2121
SERVICE_ACCOUNT_JSON_PATH: ""
2222

23-
USE_KNOWN_FALSE_POSITIVE_FILE: true
23+
USE_KNOWN_NON_ISSUES_FILE: true
2424
CALCULATE_RAGAS_METRICS: false
2525
WRITE_RESULTS_INCLUDE_NON_FINAL: true
2626

deploy/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ TK := tkn --context $(CONTEXT)
1212

1313
# Pipeline parameters (overrideable on the CLI):
1414
REPO_REMOTE_URL ?= source/code/url
15-
NON_ISSUES_URL ?= false/positives/url
15+
NON_ISSUES_URL ?= non/issues/url
1616

1717
LLM_URL ?= http://<<please-set-llm-url>>
1818
LLM_MODEL_NAME ?= llm-model

deploy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ make all PROJECT_NAME="systemd" \
121121
PROJECT_VERSION="257-9" \
122122
REPO_REMOTE_URL="https://download.devel.redhat.com/brewroot/vol/rhel-10/packages/systemd/257/9.el10/src/systemd-257-9.el10.src.rpm" \
123123
INPUT_REPORT_FILE_PATH="https://docs.google.com/spreadsheets/d/1NPGmERBsSTdHjQK2vEocQ-PvQlRGGLMds02E_RGF8vY/export?format=csv" \
124-
NON_ISSUES_URL="https://gitlab.cee.redhat.com/osh/known-false-positives/-/raw/master/systemd/ignore.err"
124+
NON_ISSUES_URL="https://gitlab.cee.redhat.com/osh/known-non-issues/-/raw/master/systemd/ignore.err"
125125
```
126126

127127
### 6. Step-by-Step Alternative

deploy/tekton/pipeline.yaml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ spec:
5151
type: string
5252
description: "Optional GDrive SA file name"
5353
default: "service_account.json"
54-
- name: USE_KNOWN_FALSE_POSITIVE_FILE
55-
type: string
56-
description: "Whether to use known false positive file for filtering (true/false)"
57-
default: "true"
5854
workspaces:
5955
- name: shared-workspace
6056
- name: gitlab-token-ws
@@ -89,23 +85,23 @@ spec:
8985
- name: source-workspace
9086
workspace: shared-workspace
9187

92-
- name: fetch-false-positives
88+
- name: fetch-non-issues
9389
runAfter:
9490
- prepare-source
9591
taskRef:
96-
name: fetch-false-positives
92+
name: fetch-non-issues
9793
params:
9894
- name: NON_ISSUES_URL
9995
value: "$(params.NON_ISSUES_URL)"
10096
workspaces:
101-
- name: false-positives-workspace
97+
- name: non-issues-workspace
10298
workspace: shared-workspace
10399
- name: gitlab-token-ws
104100
workspace: gitlab-token-ws
105101

106102
- name: execute-ai-analysis
107103
runAfter:
108-
- fetch-false-positives
104+
- fetch-non-issues
109105
taskRef:
110106
name: execute-ai-analysis
111107
params:
@@ -134,7 +130,7 @@ spec:
134130
workspaces:
135131
- name: source-workspace
136132
workspace: shared-workspace
137-
- name: false-positives-workspace
133+
- name: non-issues-workspace
138134
workspace: shared-workspace
139135
- name: llm-credentials-ws
140136
workspace: llm-credentials-ws

deploy/tekton/tasks/execute_sast_ai_workflow.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ spec:
3939
default: "true"
4040
workspaces:
4141
- name: source-workspace
42-
- name: false-positives-workspace
42+
- name: non-issues-workspace
4343
- name: llm-credentials-ws
4444
- name: google-sa-json-ws
4545
- name: cache-workspace
@@ -54,7 +54,7 @@ spec:
5454
- name: REPO_LOCAL_PATH
5555
value: "$(params.REPO_LOCAL_PATH)"
5656
- name: KNOWN_NON_ISSUES_FILE_PATH
57-
value: "$(workspaces.false-positives-workspace.path)/ignore.err"
57+
value: "$(workspaces.non-issues-workspace.path)/ignore.err"
5858
- name: USE_KNOWN_NON_ISSUES_FILE
5959
value: "$(params.USE_KNOWN_NON_ISSUES_FILE)"
6060
- name: INPUT_REPORT_FILE_PATH

deploy/tekton/tasks/fetch_false_positives.yaml renamed to deploy/tekton/tasks/fetch_non_issues.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
apiVersion: tekton.dev/v1
22
kind: Task
33
metadata:
4-
name: fetch-false-positives
4+
name: fetch-non-issues
55
spec:
66
params:
77
- name: NON_ISSUES_URL
88
type: string
99
description: "Optional GitLab URL containing known non-issues"
1010
workspaces:
11-
- name: false-positives-workspace
11+
- name: non-issues-workspace
1212
description: "Workspace to store the downloaded ignore.err"
1313
- name: gitlab-token-ws
1414
description: "Optional secret mount for GitLab token (if needed)"
1515
optional: true
1616
steps:
17-
- name: fetch-false-positives
17+
- name: fetch-non-issues
1818
image: curlimages/curl:latest
1919
script: |
2020
#!/usr/bin/env sh
2121
set -euo pipefail
2222
FP_URL="$(params.NON_ISSUES_URL)"
2323
if [ -z "$FP_URL" ]; then
24-
echo "No falsePositivesUrl provided; skipping fetch..."
24+
echo "No nonIssuesUrl provided; skipping fetch..."
2525
exit 0
2626
fi
2727
@@ -30,14 +30,14 @@ spec:
3030
if [ -f "$TOKEN_FILE" ]; then
3131
GITLAB_TOKEN=$(cat "$TOKEN_FILE")
3232
echo "GitLab token found. Fetching file with authentication..."
33-
curl --retry 3 --retry-delay 5 -k -H "PRIVATE-TOKEN: $GITLAB_TOKEN" -fL "$FP_URL" -o "$(workspaces.false-positives-workspace.path)/ignore.err" \
33+
curl --retry 3 --retry-delay 5 -k -H "PRIVATE-TOKEN: $GITLAB_TOKEN" -fL "$FP_URL" -o "$(workspaces.non-issues-workspace.path)/ignore.err" \
3434
|| (echo "Error: Could not fetch non-issues file with token." && exit 1)
3535
else
3636
echo "No GitLab token file found; attempting unauthenticated fetch..."
37-
curl --retry 3 --retry-delay 5 -k -fL "$FP_URL" -o "$(workspaces.false-positives-workspace.path)/ignore.err" \
37+
curl --retry 3 --retry-delay 5 -k -fL "$FP_URL" -o "$(workspaces.non-issues-workspace.path)/ignore.err" \
3838
|| (echo "Error: Could not fetch non-issues file unauthenticated." && exit 1)
3939
fi
40-
if [ -f "$(workspaces.false-positives-workspace.path)/ignore.err" ]; then
40+
if [ -f "$(workspaces.non-issues-workspace.path)/ignore.err" ]; then
4141
echo "Success"
4242
exit 0
4343
else

deploy/tekton/tasks/validate_urls.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spec:
2525
echo "Validating source code URL: $(params.REPO_REMOTE_URL)"
2626
curl -ksSfL "$(params.REPO_REMOTE_URL)" || (echo "Error: Source code URL is invalid" && exit 1)
2727
28-
- name: validate-false-positives-url
28+
- name: validate-non-issues-url
2929
image: curlimages/curl:latest
3030
script: |
3131
#!/usr/bin/env sh

src/ExcelWriter.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -263,38 +263,38 @@ def write_results_table(workbook, worksheet, evaluation_summary):
263263
worksheet.merge_range("A1:B1", "Human Results", cell_formatting(workbook, "#4f8df1"))
264264
worksheet.write(1, 0, f"Verified {ISSUES_TITLE}", cell_formatting(workbook, "#bfbfbf"))
265265
worksheet.write(
266-
1, 1, len(evaluation_summary.actual_true_positives), cell_formatting(workbook, "#ffffff")
266+
1, 1, len(evaluation_summary.actual_issues), cell_formatting(workbook, "#ffffff")
267267
)
268268
worksheet.write(2, 0, f"Verified {NON_ISSUES_TITLE}", cell_formatting(workbook, "#bfbfbf"))
269269
worksheet.write(
270-
2, 1, len(evaluation_summary.actual_false_positives), cell_formatting(workbook, "#ffffff")
270+
2, 1, len(evaluation_summary.actual_non_issues), cell_formatting(workbook, "#ffffff")
271271
)
272272

273273
worksheet.merge_range("C1:D1", "AI Results", cell_formatting(workbook, "#4f8df1"))
274274
worksheet.write(1, 2, f"Predicted {ISSUES_TITLE}", cell_formatting(workbook, "#bfbfbf"))
275275
worksheet.write(
276-
1, 3, len(evaluation_summary.predicted_true_positives), cell_formatting(workbook, "#ffffff")
276+
1, 3, len(evaluation_summary.predicted_issues), cell_formatting(workbook, "#ffffff")
277277
)
278278
worksheet.write(2, 2, f"Predicted {NON_ISSUES_TITLE}", cell_formatting(workbook, "#bfbfbf"))
279279
worksheet.write(
280280
2,
281281
3,
282-
len(evaluation_summary.predicted_false_positives),
282+
len(evaluation_summary.predicted_non_issues),
283283
cell_formatting(workbook, "#ffffff"),
284284
)
285285

286286

287287
def write_confusion_matrix(workbook, worksheet, evaluation_summary):
288288
worksheet.merge_range("A8:A9", "Human Results", cell_formatting(workbook, "#00b903"))
289-
worksheet.write(7, 1, "Actual False Positives", cell_formatting(workbook, "#bfbfbf"))
289+
worksheet.write(7, 1, "Actual Non Issues", cell_formatting(workbook, "#bfbfbf"))
290290
worksheet.write(7, 2, evaluation_summary.tp, cell_formatting(workbook, "#28A745"))
291-
worksheet.write(8, 1, "Actual True Positives", cell_formatting(workbook, "#bfbfbf"))
291+
worksheet.write(8, 1, "Actual Issues", cell_formatting(workbook, "#bfbfbf"))
292292
worksheet.write(8, 2, evaluation_summary.fp, cell_formatting(workbook, "#FF0000"))
293293

294294
worksheet.merge_range("C6:D6", "AI Results", cell_formatting(workbook, "#4f8df1"))
295-
worksheet.write(6, 2, "Predicted False Positives", cell_formatting(workbook, "#bfbfbf"))
295+
worksheet.write(6, 2, "Predicted Non Issues", cell_formatting(workbook, "#bfbfbf"))
296296
worksheet.write(7, 3, evaluation_summary.fn, cell_formatting(workbook, "#FF0000"))
297-
worksheet.write(6, 3, "Predicted True Positives", cell_formatting(workbook, "#bfbfbf"))
297+
worksheet.write(6, 3, "Predicted Issues", cell_formatting(workbook, "#bfbfbf"))
298298
worksheet.write(8, 3, evaluation_summary.tn, cell_formatting(workbook, "#28A745"))
299299

300300

@@ -320,42 +320,42 @@ def write_model_performance(workbook, worksheet, evaluation_summary, METRICS_STA
320320
def write_table_key(workbook, worksheet, KEY_START_ROW):
321321
worksheet.write(KEY_START_ROW, 0, "Table Key:", workbook.add_format({"bold": 1}))
322322
worksheet.write(
323-
KEY_START_ROW + 1, 0, "Verified True Positives =", workbook.add_format({"bold": 1})
323+
KEY_START_ROW + 1, 0, "Verified Issues =", workbook.add_format({"bold": 1})
324324
)
325325
worksheet.write(
326326
KEY_START_ROW + 1,
327327
1,
328-
"Human verified as a real issue (true positive)",
328+
"Human verified as a real issue (issues)",
329329
workbook.add_format({"italic": 1}),
330330
)
331331

332332
worksheet.write(
333-
KEY_START_ROW + 2, 0, "Verified False Positives =", workbook.add_format({"bold": 1})
333+
KEY_START_ROW + 2, 0, "Verified Non Issues =", workbook.add_format({"bold": 1})
334334
)
335335
worksheet.write(
336336
KEY_START_ROW + 2,
337337
1,
338-
"Human verified as not a real issue (false positive)",
338+
"Human verified as not a real issue (non issues)",
339339
workbook.add_format({"italic": 1}),
340340
)
341341

342342
worksheet.write(
343-
KEY_START_ROW + 3, 0, "Predicted True Positives =", workbook.add_format({"bold": 1})
343+
KEY_START_ROW + 3, 0, "Predicted Issues =", workbook.add_format({"bold": 1})
344344
)
345345
worksheet.write(
346346
KEY_START_ROW + 3,
347347
1,
348-
"AI Predicted as a real issue (true positive)",
348+
"AI Predicted as a real issue (issues)",
349349
workbook.add_format({"italic": 1}),
350350
)
351351

352352
worksheet.write(
353-
KEY_START_ROW + 4, 0, "Predicted False Positives =", workbook.add_format({"bold": 1})
353+
KEY_START_ROW + 4, 0, "Predicted Non Issues =", workbook.add_format({"bold": 1})
354354
)
355355
worksheet.write(
356356
KEY_START_ROW + 4,
357357
1,
358-
"AI Predicted as not a real issue (false positive)",
358+
"AI Predicted as not a real issue (non issues)",
359359
workbook.add_format({"italic": 1}),
360360
)
361361

src/FilterKnownIssues.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def get_relevant_known_issues(self, finding_trace: str, issue_type: str) -> list
4141
known_issues.append(
4242
KnownNonIssue(
4343
error_trace=doc.page_content,
44-
reason_of_false_positive=doc.metadata.get("reason_of_false_positive", ""),
44+
reason_of_non_issue=doc.metadata.get("reason_of_non_issue", ""),
4545
issue_type=doc.metadata.get("issue_type", ""),
4646
issue_cwe=doc.metadata.get("issue_cwe"),
4747
similarity_score=None,
@@ -99,9 +99,9 @@ def create_known_issue_retriever(main_process: LLMService, config: Config) -> Kn
9999
Returns:
100100
KnownIssueRetriever: A known issue retriever.
101101
"""
102-
text_false_positives = read_known_errors_file(config.KNOWN_NON_ISSUES_FILE_PATH)
102+
text_non_issues = read_known_errors_file(config.KNOWN_NON_ISSUES_FILE_PATH)
103103
known_issue_db = main_process.vector_service.create_known_issues_vector_store(
104-
text_false_positives, main_process.embedding_llm
104+
text_non_issues, main_process.embedding_llm
105105
)
106106
known_issue_retriever = KnownIssueRetriever(known_issue_db, config.SIMILARITY_ERROR_THRESHOLD)
107107
return known_issue_retriever
@@ -116,7 +116,7 @@ def convert_similar_known_issues_to_filter_known_error_context(resp) -> str:
116116
context_list += KNOWN_NON_ISSUES_TEMPLATES["FILTER_CONTEXT_TEMPLATE"].format(
117117
index=index,
118118
error_trace=known_issue.error_trace,
119-
reason=known_issue.reason_of_false_positive,
119+
reason=known_issue.reason_of_non_issue,
120120
)
121121
return context_list
122122

@@ -139,7 +139,7 @@ def convert_similar_issues_to_examples_context_string(
139139
formatted_context += KNOWN_NON_ISSUES_TEMPLATES["EXAMPLE_MULTILINE_TEMPLATE"].format(
140140
number=example_number,
141141
error_trace=known_issue.error_trace,
142-
reason=known_issue.reason_of_false_positive,
142+
reason=known_issue.reason_of_non_issue,
143143
issue_type=known_issue.issue_type,
144144
issue_cwe=known_issue.issue_cwe,
145145
)

src/Utils/file_utils.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,28 +55,28 @@ def get_human_verified_results_local_excel(filename):
5555

5656
df.columns = df.columns.str.strip().str.lower()
5757
expected_issue_id = "issue id"
58-
expected_false_positive = "false positive?"
58+
expected_non_issue = "non issue?"
5959

6060
if expected_issue_id not in df.columns:
6161
raise KeyError(
6262
f"Expected column '{expected_issue_id}' not found in the file. \
6363
Found columns: {list(df.columns)}"
6464
)
65-
if expected_false_positive not in df.columns:
65+
if expected_non_issue not in df.columns:
6666
raise KeyError(
67-
f"Expected column '{expected_false_positive}' not found in the file. \
67+
f"Expected column '{expected_non_issue}' not found in the file. \
6868
Found columns: {list(df.columns)}"
6969
)
7070

71-
ground_truth = dict(zip(df[expected_issue_id], df[expected_false_positive]))
71+
ground_truth = dict(zip(df[expected_issue_id], df[expected_non_issue]))
7272
logger.info(f"Successfully loaded ground truth from {filename}")
7373
return ground_truth
7474

7575

7676
def get_human_verified_results_google_sheet(service_account_file_path, google_sheet_url):
7777
"""
7878
Reads a Google Sheet and creates a ground truth dictionary,
79-
based on the 'False Positive?' column.
79+
based on the 'Non Issue?' column.
8080
8181
NOTE: Assumes the data is in the first sheet (sheet name doesn't matter),
8282
and that if human-verified data is filled, it is filled for all rows.
@@ -90,17 +90,17 @@ def get_human_verified_results_google_sheet(service_account_file_path, google_sh
9090
rows = sheet.get_all_records()
9191

9292
# Create ground truth dict in case of human verified data already filled in the google sheet
93-
if rows[0].get("False Positive?"):
93+
if rows[0].get("Non Issue?"):
9494
ground_truth = {}
9595
for idx, row in enumerate(rows, start=1): # start=1 to get def1, def2, ...
96-
is_false_positive = row.get("False Positive?", "").strip().lower()
97-
if is_false_positive.lower() not in ALL_VALID_OPTIONS:
96+
is_non_issue = row.get("Non Issue?", "").strip().lower()
97+
if is_non_issue.lower() not in ALL_VALID_OPTIONS:
9898
logger.warning(
99-
f"Warning: def{idx} has invalid value '{is_false_positive}' \
100-
in 'False Positive?' column."
99+
f"Warning: def{idx} has invalid value '{is_non_issue}' \
100+
in 'Non Issue?' column."
101101
)
102102

103-
ground_truth[f"def{idx}"] = is_false_positive
103+
ground_truth[f"def{idx}"] = is_non_issue
104104

105105
else:
106106
ground_truth = None

0 commit comments

Comments
 (0)