Skip to content

Commit 3af1c2e

Browse files
committed
Merge branch 'validate_csv' of https://github.com/splunk/contentctl into validate_csv
2 parents 289c3ec + bb40c5b commit 3af1c2e

File tree

5 files changed

+12
-79
lines changed

5 files changed

+12
-79
lines changed

contentctl/actions/detection_testing/GitService.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,19 @@ def getChanges(self, target_branch:str)->List[Detection]:
111111
raise Exception(f"More than 1 Lookup reference the modified CSV file '{decoded_path}': {[l.file_path for l in matched ]}")
112112
else:
113113
updatedLookup = matched[0]
114+
elif decoded_path.suffix == ".mlmodel":
115+
# Detected a changed .mlmodel file. However, since we do not have testing for these detections at
116+
# this time, we will ignore this change.
117+
updatedLookup = None
118+
119+
114120
else:
115-
raise Exception(f"Error getting lookup object for file {str(decoded_path)}")
121+
raise Exception(f"Detected a changed file in the lookups/ directory '{str(decoded_path)}'.\n"
122+
"Only files ending in .csv, .yml, or .mlmodel are supported in this "
123+
"directory. This file must be removed from the lookups/ directory.")
116124

117-
if updatedLookup not in updated_lookups:
118-
# It is possible that both th CSV and YML have been modified for the same lookup,
125+
if updatedLookup is not None and updatedLookup not in updated_lookups:
126+
# It is possible that both the CSV and YML have been modified for the same lookup,
119127
# and we do not want to add it twice.
120128
updated_lookups.append(updatedLookup)
121129

contentctl/actions/new_content.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def buildDetection(self)->dict[str,Any]:
3232
answers['status'] = "production" #start everything as production since that's what we INTEND the content to become
3333
answers['description'] = 'UPDATE_DESCRIPTION'
3434
file_name = answers['name'].replace(' ', '_').replace('-','_').replace('.','_').replace('/','_').lower()
35-
answers['kind'] = answers['detection_kind']
3635
answers['search'] = answers['detection_search'] + ' | `' + file_name + '_filter`'
3736
del answers['detection_search']
3837
answers['how_to_implement'] = 'UPDATE_HOW_TO_IMPLEMENT'

contentctl/templates/app_template/default/app.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ build = 16367
88

99
[triggers]
1010
reload.analytic_stories = simple
11-
reload.usage_searches = simple
1211
reload.use_case_library = simple
1312
reload.correlationsearches = simple
1413
reload.analyticstories = simple

contentctl/templates/app_template/default/usage_searches.conf

Lines changed: 0 additions & 73 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "contentctl"
3-
version = "4.1.3"
3+
version = "4.1.4"
44
description = "Splunk Content Control Tool"
55
authors = ["STRT <[email protected]>"]
66
license = "Apache 2.0"

0 commit comments

Comments
 (0)