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

[pre-commit] - split hooks with multi-processing #4130

Merged
merged 80 commits into from Mar 28, 2024

Conversation

GuyAfik
Copy link
Contributor

@GuyAfik GuyAfik commented Mar 12, 2024

Related Issues

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

Description

Before:

  • We ran all the hooks with multi-processing at the same time except the hooks which require docker execution before running.
  • We created a separate file for each docker hook / split hook.

With the new implementation:

  • All the hooks will be on the main file (only one file will be created)
  • Hooks which are split will run with multi-processing
  • The execution of the hooks will be in the same order where they are defined in the template
  • There is no need for the needs parameter anymore as we keep the hooks execution ordered.
  • Each prepare-hook implementation requires now to return all the created hook IDs for the original hooks.
  • Added support for the parallel key to determine whether a split hook should run in parallel or sequentially.

@GuyAfik GuyAfik marked this pull request as draft March 12, 2024 14:19
@GuyAfik GuyAfik changed the title [pre-commit] - fix hooks running with multi-processing [pre-commit] - split hooks execution when running with multip-processing Mar 12, 2024
@GuyAfik GuyAfik changed the title [pre-commit] - split hooks execution when running with multip-processing [pre-commit] - split hooks execution when running with multi-processing Mar 12, 2024
Copy link

Changelog(s) in markdown:

  • Fixed an issue where pre-commit command showed wrong hooks failing. #4130

@GuyAfik GuyAfik marked this pull request as ready for review March 14, 2024 09:03
@GuyAfik GuyAfik requested a review from ilaner March 14, 2024 11:19
Copy link
Contributor

@ilaner ilaner left a comment

Choose a reason for hiding this comment

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

good job! see small comments

demisto_sdk/commands/pre_commit/pre_commit_command.py Outdated Show resolved Hide resolved
demisto_sdk/commands/pre_commit/pre_commit_command.py Outdated Show resolved Hide resolved
Copy link

Changelog(s) in markdown:

  • Fixed an issue where pre-commit command showed wrong hooks failing. #4130
  • Added support for a new argument *parallel for each hook to determine whether a hook should that is split should run in parallel or not. #4130

Copy link

Changelog(s) in markdown:

  • Fixed an issue where pre-commit command showed wrong hooks failing. #4130
  • Added support for a new argument *parallel for each hook to determine whether a hook run in parallel or not. #4130

demisto_sdk/commands/pre_commit/README.md Outdated Show resolved Hide resolved
@GuyAfik GuyAfik merged commit 7bc8df3 into master Mar 28, 2024
23 checks passed
@GuyAfik GuyAfik deleted the pre_commit_fix_multiprocess branch March 28, 2024 13:06
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