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

Graph - reuse parse content dto, skip empty packs #4154

Merged
merged 24 commits into from Mar 21, 2024

Conversation

ilaner
Copy link
Contributor

@ilaner ilaner commented Mar 20, 2024

This fixes the following:

  • This will reuse the ContentDTO.from_path, so if the content was parsed in the sdk run, it will not parse
  • This will skip empty packs

fixes: https://jira-dc.paloaltonetworks.com/browse/CIAC-9717

demisto_sdk/commands/content_graph/parsers/repository.py Outdated Show resolved Hide resolved
logger.debug(
f'DEMISTO_SDK_GRAPH_FORCE_CREATE = {os.getenv("DEMISTO_SDK_GRAPH_FORCE_CREATE")}'
)
if os.getenv("DEMISTO_SDK_GRAPH_FORCE_CREATE") == "true":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put inside a variable and reuse it also in the line 76

demisto_sdk/commands/content_graph/objects/repository.py Outdated Show resolved Hide resolved
@@ -17,25 +18,41 @@
USE_MULTIPROCESSING = False # toggle this for better debugging


@lru_cache
def from_path(path: Path = CONTENT_PATH, packs_to_parse: Optional[Tuple[str]] = None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why isn't it a class method of ContentDTO?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I documented, for some reason I get cache miss whin it's in the class.

ilaner and others added 8 commits March 20, 2024 17:41
Co-authored-by: Guy Afik <53861351+GuyAfik@users.noreply.github.com>
Co-authored-by: Guy Afik <53861351+GuyAfik@users.noreply.github.com>
…misto/demisto-sdk into skip_graph_validation_on_old_validate
Copy link

Changelog(s) in markdown:

  • Fixes an issue in graph commands where empty pack folders were not being ignored. #4154

@ilaner ilaner merged commit e4b990e into master Mar 21, 2024
22 checks passed
@ilaner ilaner deleted the skip_graph_validation_on_old_validate branch March 21, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants