Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude silent items from release notes validation #4720

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changelog/4720.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- description: Exclude silent items from release notes validation.
type: feature
pr_number: 4720
8 changes: 6 additions & 2 deletions demisto_sdk/commands/validate/tests/RN_validators_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ def mock_is_missing_rn_validator(mocker):
]:
mocker.patch(
f"demisto_sdk.commands.validate.validators.RN_validators.{rn_validator}.should_skip_rn_check",
side_effect=lambda c: isinstance(c, TestPlaybook),
side_effect=lambda c: isinstance(c, TestPlaybook) or c.is_silent,
)
mocker.patch(
f"demisto_sdk.commands.validate.validators.RN_validators.{rn_validator}.was_rn_added",
Expand Down Expand Up @@ -691,7 +691,7 @@ def test_IsMissingReleaseNotes_for_api_module_dependents(
def test_IsMissingReleaseNoteEntries(mock_is_missing_rn_validator):
"""
Given:
- pack1 with a modified integration, a RM entry exists
- pack1 with a modified integration and silent playbook, a RN entry exists only for the integration
- pack2 with modified script, playbook and TPB, a RN entry exists only for the script
- pack3 with a modified script, a RN file does not exist
- pack4 with a new mapper, a RN exists
Expand All @@ -709,6 +709,9 @@ def test_IsMissingReleaseNoteEntries(mock_is_missing_rn_validator):
release_note_content=f"#### Integrations\n##### {integ.display_name}\n- Added x y z",
)
integ.pack = pack1
silent_playbook = create_playbook_object()
silent_playbook.is_silent = True
silent_playbook.pack = pack1

script1 = create_script_object()
playbook = create_playbook_object()
Expand Down Expand Up @@ -740,6 +743,7 @@ def test_IsMissingReleaseNoteEntries(mock_is_missing_rn_validator):
content_items = [
pack1,
integ,
silent_playbook,
pack2,
script1,
playbook,
Expand Down
3 changes: 3 additions & 0 deletions demisto_sdk/commands/validate/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ def should_skip_rn_check(content_item: ContentItem) -> bool:
- A modeling rule is considered modified if its XIF and schema files are modified
- A movement between packs is considered a modification
- Test content items shouldn't have RNs
- Silent content items shouldn't have RNs

Args:
content_item (ContentItem): A content item object
Expand All @@ -279,6 +280,8 @@ def should_skip_rn_check(content_item: ContentItem) -> bool:
"""
if isinstance(content_item, (TestPlaybook, TestScript)):
return True
if content_item.is_silent:
return True
if isinstance(content_item, Integration):
return (
not content_item.git_status and not content_item.description_file.git_status
Expand Down
Loading