-
Notifications
You must be signed in to change notification settings - Fork 950
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
Batched & parallel support for cfn-lint, eslint, gitleaks #4088
Conversation
Just wonder why this gets a linter error, was assigning the internal counter back to variable
while
has no linter error. Both evaluated as expected in bash. If cannot be solved maybe I will hardcode the FILE_TYPE there |
I think I will leave the python toolchain later, but adding gitleaks parallelized (gitleaks does not support batch, only parallel is possible) One small note for gitleaks parallel version only output the information related to the detected leaks, i. e.
parallel version does not output
because when parallel, it is not possible to relate the above message to the file which generates it. However this can be justified by the fact that these messages are kind of not informative even when run in serial
The number returned at the end of super-linter is still correct, equals to serial run. |
Sorry for messing with linter errors, have checked locally against this for latest commit
|
Hi, would like to follow up on how to proceed with testing and moving towards merging the PR. This issue features a new code path, that is slightly incompatible (as in exact char-by-char output diff sense), enabled by setting EXPERIMENTAL_BATCH_WORKER to true, it seem current CI won’t cover this path unless also test with this env set. |
This pull request has been automatically marked as stale because it has not had recent activity. If you think this pull request should stay open, please remove the If you're a maintainer, you can stop the bot to mark this issue as stale in the future by adding the |
Please block a while for refactoring some code to improve tracability |
b4cb9a2
to
55882bc
Compare
55882bc
to
55d5c2d
Compare
is good now, refactor using named pipe to get rid of redirection hell. all 3 linter's file is just ~60 line now. |
As an aside, I guess someone might use non-default linter output format, e.g. json/xml if the linter supports it. Serial implementation relies on return value of linter running one file, and is format agnostic. Parallel is format agnostic with no batching, fully compatible with previous implementation, Batching on the other hand, combines linter errors from multiple files, linter return value has no clear meaning for most linter. |
approved ci workflows, awaiting results. |
Can we update permissions on the file to be executable?
|
sure will look at linter error and fix it
…On Sat, 28 Oct 2023 at 9:52 AM, Zack Koppert ***@***.***> wrote:
Can we update permissions on the file to be executable?
Error:
File:[/github/workspace/lib/functions/experimental-batch-workers/base.sh]
is not executable
—
Reply to this email directly, view it on GitHub
<#4088 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE6YIWF2KCPCTGN2DTXMYFDYBRQMPAVCNFSM6AAAAAAW7ZSAVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBTGY3DANZUGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Proposal to fix
Currently planned to provide implementation for
Use cases includes
Proposed Changes
Batched and parallel linting for use case involving large number of files.
$LINTER_COMMAND FILE1 FILE2 FILE3 ....
instead of$LINTER_COMMAND FILE
looping over all filesnprocs
are run in parallelAs for most parallelization, this patch does not reproduce exact output of serial version
To enable this experimental worker, set env
EXPERIMENTAL_BATCH_WORKER
totrue
In order to mimic serial behavior as closely as possible, the implementation
[ERROR] ERRORS FOUND in JAVASCRIPT_ES:[123]
) as serial version when super-linter is completedCurrent ERROR output on serial version cannot be recovered, since
Performance comparison
A figure is provided only for eslint on a repo that I have on hand
Test 1: 429 files contains linter error (not warning) artificially introduced (mainly
react/*
rules that was turned off for the project)7 min 21 sec
14 sec
(it is not necessary to parallel, still under 30s without parallel)Test 2: No artificially introduced error (0 error, several warnings)
7 min 4 sec
5 sec
For the experimental implementation, majority of the performance issue is in bash-script implemented output parser to calculate number of error files, it is not too bad anyway.
Readiness Checklist
Author/Contributor
Reviewing Maintainer
breaking
if this is a large fundamental changeautomation
,bug
,documentation
,enhancement
,infrastructure
, orperformance