Skip to content

Commit

Permalink
added support to "isfetchassets" instead of "isfetcheventsandassets" …
Browse files Browse the repository at this point in the history
…flag (#3676)

* added support to isfetchassets instead of isfetcheventsandassets flag

* updated unittest
  • Loading branch information
merit-maita authored Sep 27, 2023
1 parent 1a0baa0 commit ecd2de4
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Fixed an issue where **upload** failed when trying to upload an indicator field.
* Updated the **update-content-graph** command to work with external repositories.
* Updated the **validate** command to work with external repositories when using the *--graph* flag.
* added support for `isfetchassets` flag in content graph

## 1.20.4
* Fixed an issue where using **prepare-content**, **upload**, **zip-packs** and **download** on machines with default encoding other than unicode caused errors.
Expand Down
2 changes: 1 addition & 1 deletion demisto_sdk/commands/common/schemas/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ mapping:
type: bool
isfetchevents:
type: bool
isfetcheventsandassets:
isfetchassets:
type: bool
longRunning:
type: bool
Expand Down
2 changes: 1 addition & 1 deletion demisto_sdk/commands/content_graph/objects/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def dump(self, *args) -> None:
class Integration(IntegrationScript, content_type=ContentType.INTEGRATION): # type: ignore[call-arg]
is_fetch: bool = Field(False, alias="isfetch")
is_fetch_events: bool = Field(False, alias="isfetchevents")
is_fetch_events_and_assets: bool = False
is_fetch_assets: bool = False
is_feed: bool = False
category: str
commands: List[Command] = []
Expand Down
10 changes: 2 additions & 8 deletions demisto_sdk/commands/content_graph/parsers/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ def __init__(
self.script_info: Dict[str, Any] = self.yml_data.get("script", {})
self.category = self.yml_data["category"]
self.is_fetch = self.script_info.get("isfetch", False)
self.is_fetch_events_and_assets = self.script_info.get(
"isfetcheventsandassets", False
)
# if the integration fetches assets, it fetches events as well
self.is_fetch_events = (
self.script_info.get("isfetchevents", False)
or self.is_fetch_events_and_assets
)
self.is_fetch_assets = self.script_info.get("isfetchassets", False)
self.is_fetch_events = self.script_info.get("isfetchevents", False)
self.is_feed = self.script_info.get("feed", False)
self.type = self.script_info.get("subtype") or self.script_info.get("type")
if self.type == "python":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,8 @@ def test_integration_parser(self, pack: Pack):
expected_fromversion="5.0.0",
expected_toversion=DEFAULT_CONTENT_ITEM_TO_VERSION,
)
assert model.is_fetch_events is True
assert model.is_fetch_events_and_assets is True
assert model.is_fetch_events is False
assert model.is_fetch_assets is True

def test_unified_integration_parser(self, pack: Pack):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ script:
required: false
isArray: false
defaultValue: "2020-01-01"
isfetcheventsandassets: true
isfetchassets: true
dockerimage: demisto/bs4:1.0.0.7863
tests:
- No tests

0 comments on commit ecd2de4

Please sign in to comment.