Skip to content

Commit

Permalink
fixed cases where validate mistake <> in msgs for colors (#4834)
Browse files Browse the repository at this point in the history
* fixed cases where validate mistake <> in msgs for colors

* added changelog

* fixes

* test fixes
  • Loading branch information
YuvHayun authored Feb 25, 2025
1 parent e88f4d7 commit 9ed26cd
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .changelog/4834.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- description: Fixed cases where validate mistake <> in msgs for colors
type: fix
pr_number: 4834
2 changes: 1 addition & 1 deletion demisto_sdk/commands/validate/tests/PA_validators_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ def test_IsValidUseCasesValidator_fix():
[],
1,
[
"The Pack HelloWorld should be deprecated, as all its content items are deprecated.\nThe name of the pack in the pack_metadata.json should end with (Deprecated).\nThe description of the pack in the pack_metadata.json should be one of the following formats:\n1. 'Deprecated. Use <PACK_NAME> instead.'\n2. 'Deprecated. <REASON> No available replacement.'"
"The Pack HelloWorld should be deprecated, as all its content items are deprecated.\nThe name of the pack in the pack_metadata.json should end with (Deprecated).\nThe description of the pack in the pack_metadata.json should be one of the following formats:\n1. 'Deprecated. Use PACK_NAME instead.'\n2. 'Deprecated. REASON No available replacement.'"
],
),
(
Expand Down
8 changes: 4 additions & 4 deletions demisto_sdk/commands/validate/tests/PB_validators_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,14 @@ def test_is_no_rolename(content_item, expected_result):
(
create_playbook_object(
paths=["deprecated", "description"],
values=[True, "Deprecated. Use <PLAYBOOK_NAME> instead."],
values=[True, "Deprecated. Use PLAYBOOK_NAME instead."],
),
[],
),
(
create_playbook_object(
paths=["deprecated", "description"],
values=[True, "Deprecated. <REASON> No available replacement."],
values=[True, "Deprecated. REASON No available replacement."],
),
[],
),
Expand All @@ -294,8 +294,8 @@ def test_is_no_rolename(content_item, expected_result):
values=[True, "Not a valid description"],
),
"The deprecated playbook 'Detonate File - JoeSecurity V2' has invalid description.\nThe description of "
'all deprecated playbooks should follow one of the formats:\n1. "Deprecated. Use <PLAYBOOK_NAME> '
'instead."\n2. "Deprecated. <REASON> No available replacement."',
'all deprecated playbooks should follow one of the formats:\n1. "Deprecated. Use PLAYBOOK_NAME '
'instead."\n2. "Deprecated. REASON No available replacement."',
),
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class IsDeprecatedCorrectlyValidator(BaseValidator[ContentTypes]):
)
error_message = (
"The description of all deprecated {0} should follow one of the formats:"
'1. "Deprecated. Use <CONTENT_ITEM_NAME> instead."'
'2. "Deprecated. <REASON> No available replacement."'
'1. "Deprecated. Use CONTENT_ITEM_NAME instead."'
'2. "Deprecated. REASON No available replacement."'
)
related_field = "description, comment"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class IsValidBetaDescriptionValidator(BaseValidator[ContentTypes]):
rationale = "Need a disclaimer for beta integrations."
error_message = (
f"No beta disclaimer note was found. "
f"Please make sure the description file (<integration_name>_description.md)"
f"Please make sure the description file (integration_name_description.md)"
f" includes the beta disclaimer note. "
f"Add the following to the detailed description:\n{BETA_INTEGRATION_DISCLAIMER}"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class IncidentTypeValidAutoExtractFieldsValidator(BaseValidator[ContentTypes]):
'isExtractingAllIndicatorTypes: true, extractAsIsIndicatorTypeId: "", '
"extractIndicatorTypesIDs: []\n"
"2. To extract the incident field to a specific indicator without using regex: \n"
'isExtractingAllIndicatorTypes: false, extractAsIsIndicatorTypeId: "<INDICATOR_TYPE>", '
'isExtractingAllIndicatorTypes: false, extractAsIsIndicatorTypeId: "INDICATOR_TYPE", '
"extractIndicatorTypesIDs: []\n"
"3. To extract indicators from the field using regex: \n"
'isExtractingAllIndicatorTypes: false, extractAsIsIndicatorTypeId: "", '
'extractIndicatorTypesIDs: ["<INDICATOR_TYPE1>", "<INDICATOR_TYPE2>"]'
'extractIndicatorTypesIDs: ["INDICATOR_TYPE1", "INDICATOR_TYPE2"]'
)
related_field = "extractSettings"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class ShouldPackBeDeprecatedValidator(BaseValidator[ContentTypes]):
"The Pack {0} should be deprecated, as all its content items are deprecated.\n"
"The name of the pack in the pack_metadata.json should end with (Deprecated).\n"
"The description of the pack in the pack_metadata.json should be one of the following formats:\n"
"1. 'Deprecated. Use <PACK_NAME> instead.'\n"
"2. 'Deprecated. <REASON> No available replacement.'"
"1. 'Deprecated. Use PACK_NAME instead.'\n"
"2. 'Deprecated. REASON No available replacement.'"
)
fix_message = (
"Deprecated the pack {0}.\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class DeprecatedDescriptionValidator(BaseValidator[ContentTypes]):
error_message = (
"The deprecated playbook '{playbook_name}' has invalid description.\n"
"The description of all deprecated playbooks should follow one of the formats:\n"
'1. "Deprecated. Use <PLAYBOOK_NAME> instead."\n'
'2. "Deprecated. <REASON> No available replacement."'
'1. "Deprecated. Use PLAYBOOK_NAME instead."\n'
'2. "Deprecated. REASON No available replacement."'
)
related_field = "description"
is_auto_fixable = False
Expand Down

0 comments on commit 9ed26cd

Please sign in to comment.