From aab361ec50991221bec534b7c9cae5a263e43933 Mon Sep 17 00:00:00 2001 From: YuvHayun Date: Tue, 25 Feb 2025 10:22:40 +0200 Subject: [PATCH 1/4] fixed cases where validate mistake <> in msgs for colors --- .../BA126_content_item_is_deprecated_correctly.py | 4 ++-- .../DS_validators/DS101_is_valid_beta_description.py | 2 +- .../IT_validators/IT102_is_auto_extract_fields_valid.py | 4 ++-- .../PA_validators/PA102_should_pack_be_deprecated.py | 5 +++-- .../validators/PB_validators/PB104_deprecated_description.py | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/demisto_sdk/commands/validate/validators/BA_validators/BA126_content_item_is_deprecated_correctly.py b/demisto_sdk/commands/validate/validators/BA_validators/BA126_content_item_is_deprecated_correctly.py index 056c6873988..c791869447c 100644 --- a/demisto_sdk/commands/validate/validators/BA_validators/BA126_content_item_is_deprecated_correctly.py +++ b/demisto_sdk/commands/validate/validators/BA_validators/BA126_content_item_is_deprecated_correctly.py @@ -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 instead."' - '2. "Deprecated. No available replacement."' + '1. "Deprecated. Use CONTENT_ITEM_NAME instead."' + '2. "Deprecated. REASON No available replacement."' ) related_field = "description, comment" diff --git a/demisto_sdk/commands/validate/validators/DS_validators/DS101_is_valid_beta_description.py b/demisto_sdk/commands/validate/validators/DS_validators/DS101_is_valid_beta_description.py index 207398d8a73..4eb9866bfa5 100644 --- a/demisto_sdk/commands/validate/validators/DS_validators/DS101_is_valid_beta_description.py +++ b/demisto_sdk/commands/validate/validators/DS_validators/DS101_is_valid_beta_description.py @@ -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 (_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}" ) diff --git a/demisto_sdk/commands/validate/validators/IT_validators/IT102_is_auto_extract_fields_valid.py b/demisto_sdk/commands/validate/validators/IT_validators/IT102_is_auto_extract_fields_valid.py index 83fbfadd752..a2c81d70f98 100644 --- a/demisto_sdk/commands/validate/validators/IT_validators/IT102_is_auto_extract_fields_valid.py +++ b/demisto_sdk/commands/validate/validators/IT_validators/IT102_is_auto_extract_fields_valid.py @@ -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: "", ' + 'isExtractingAllIndicatorTypes: false, extractAsIsIndicatorTypeId: "INDICATOR_TYPE", ' "extractIndicatorTypesIDs: []\n" "3. To extract indicators from the field using regex: \n" 'isExtractingAllIndicatorTypes: false, extractAsIsIndicatorTypeId: "", ' - 'extractIndicatorTypesIDs: ["", ""]' + 'extractIndicatorTypesIDs: ["INDICATOR_TYPE1", "INDICATOR_TYPE2"]' ) related_field = "extractSettings" diff --git a/demisto_sdk/commands/validate/validators/PA_validators/PA102_should_pack_be_deprecated.py b/demisto_sdk/commands/validate/validators/PA_validators/PA102_should_pack_be_deprecated.py index 5e69506dbdc..4facdb1bcc2 100644 --- a/demisto_sdk/commands/validate/validators/PA_validators/PA102_should_pack_be_deprecated.py +++ b/demisto_sdk/commands/validate/validators/PA_validators/PA102_should_pack_be_deprecated.py @@ -25,8 +25,9 @@ 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 instead.'\n" - "2. 'Deprecated. No available replacement.'" + "1. 'Deprecated. Use PACK_NAME + instead.'\n" + "2. 'Deprecated. REASON No available replacement.'" ) fix_message = ( "Deprecated the pack {0}.\n" diff --git a/demisto_sdk/commands/validate/validators/PB_validators/PB104_deprecated_description.py b/demisto_sdk/commands/validate/validators/PB_validators/PB104_deprecated_description.py index c7882cede18..2458ab0399c 100644 --- a/demisto_sdk/commands/validate/validators/PB_validators/PB104_deprecated_description.py +++ b/demisto_sdk/commands/validate/validators/PB_validators/PB104_deprecated_description.py @@ -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 instead."\n' - '2. "Deprecated. No available replacement."' + '1. "Deprecated. Use PLAYBOOK_NAME instead."\n' + '2. "Deprecated. REASON No available replacement."' ) related_field = "description" is_auto_fixable = False From e1f9a17f5fc095702e24c22031ecbc6bc4b195c8 Mon Sep 17 00:00:00 2001 From: YuvHayun Date: Tue, 25 Feb 2025 10:23:22 +0200 Subject: [PATCH 2/4] added changelog --- .changelog/4834.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .changelog/4834.yml diff --git a/.changelog/4834.yml b/.changelog/4834.yml new file mode 100644 index 00000000000..336506c2a9e --- /dev/null +++ b/.changelog/4834.yml @@ -0,0 +1,4 @@ +changes: +- description: Fixed cases where validate mistake <> in msgs for colors + type: fix +pr_number: 4834 From 6d96f6fa956c2d7493ab9d5e78520e007f801636 Mon Sep 17 00:00:00 2001 From: YuvHayun Date: Tue, 25 Feb 2025 10:26:04 +0200 Subject: [PATCH 3/4] fixes --- .../PA_validators/PA102_should_pack_be_deprecated.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/demisto_sdk/commands/validate/validators/PA_validators/PA102_should_pack_be_deprecated.py b/demisto_sdk/commands/validate/validators/PA_validators/PA102_should_pack_be_deprecated.py index 4facdb1bcc2..894eb619280 100644 --- a/demisto_sdk/commands/validate/validators/PA_validators/PA102_should_pack_be_deprecated.py +++ b/demisto_sdk/commands/validate/validators/PA_validators/PA102_should_pack_be_deprecated.py @@ -25,8 +25,7 @@ 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" + "1. 'Deprecated. Use PACK_NAME instead.'\n" "2. 'Deprecated. REASON No available replacement.'" ) fix_message = ( From de04f9504a1166c283c0757eb0d1dcb720c2f153 Mon Sep 17 00:00:00 2001 From: YuvHayun Date: Tue, 25 Feb 2025 10:54:42 +0200 Subject: [PATCH 4/4] test fixes --- demisto_sdk/commands/validate/tests/PA_validators_test.py | 2 +- demisto_sdk/commands/validate/tests/PB_validators_test.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/demisto_sdk/commands/validate/tests/PA_validators_test.py b/demisto_sdk/commands/validate/tests/PA_validators_test.py index 47b7d7ecbd6..7f510904460 100644 --- a/demisto_sdk/commands/validate/tests/PA_validators_test.py +++ b/demisto_sdk/commands/validate/tests/PA_validators_test.py @@ -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 instead.'\n2. 'Deprecated. 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.'" ], ), ( diff --git a/demisto_sdk/commands/validate/tests/PB_validators_test.py b/demisto_sdk/commands/validate/tests/PB_validators_test.py index 388394c97e5..da4fc870403 100644 --- a/demisto_sdk/commands/validate/tests/PB_validators_test.py +++ b/demisto_sdk/commands/validate/tests/PB_validators_test.py @@ -277,14 +277,14 @@ def test_is_no_rolename(content_item, expected_result): ( create_playbook_object( paths=["deprecated", "description"], - values=[True, "Deprecated. Use instead."], + values=[True, "Deprecated. Use PLAYBOOK_NAME instead."], ), [], ), ( create_playbook_object( paths=["deprecated", "description"], - values=[True, "Deprecated. No available replacement."], + values=[True, "Deprecated. REASON No available replacement."], ), [], ), @@ -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 ' - 'instead."\n2. "Deprecated. No available replacement."', + 'all deprecated playbooks should follow one of the formats:\n1. "Deprecated. Use PLAYBOOK_NAME ' + 'instead."\n2. "Deprecated. REASON No available replacement."', ), ], )