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

shellcheck: use a new version of run-shellcheck.sh #182

Merged
merged 10 commits into from
Aug 26, 2024

Conversation

kdudka
Copy link
Member

@kdudka kdudka commented Aug 12, 2024

... initially developed for Konflux CI. The updated version runs more processes of shellcheck in parallel, each of them with a strictly set timeout (by default 30s of wall-clock time).

Related: https://issues.redhat.com/browse/OSH-655
Resolves: https://issues.redhat.com/browse/OSH-733

@kdudka kdudka self-assigned this Aug 12, 2024
scripts/run-shellcheck.sh Fixed Show fixed Hide fixed
scripts/run-shellcheck.sh Fixed Show fixed Hide fixed
scripts/run-shellcheck.sh Fixed Show fixed Hide fixed
py/plugins/shellcheck.py Show resolved Hide resolved
py/plugins/shellcheck.py Fixed Show fixed Hide fixed
kdudka added a commit to kdudka/csmock that referenced this pull request Aug 12, 2024
... to configure maximum amount of wall-clock time taken by a single
shellcheck process

Related: https://issues.redhat.com/browse/OSH-655
Closes: csutils#182
kdudka added a commit to kdudka/csmock that referenced this pull request Aug 12, 2024
... to configure maximum amount of wall-clock time taken by a single
shellcheck process

Related: https://issues.redhat.com/browse/OSH-655
Closes: csutils#182
kdudka added a commit to kdudka/csmock that referenced this pull request Aug 13, 2024
... to configure maximum amount of wall-clock time taken by a single
shellcheck process

Related: https://issues.redhat.com/browse/OSH-655
Closes: csutils#182
kdudka added a commit to kdudka/csmock that referenced this pull request Aug 13, 2024
... to configure maximum amount of wall-clock time taken by a single
shellcheck process

Related: https://issues.redhat.com/browse/OSH-655
Closes: csutils#182
scripts/run-shellcheck.sh Fixed Show fixed Hide fixed
kdudka added a commit to kdudka/csmock that referenced this pull request Aug 13, 2024
... to configure maximum amount of wall-clock time taken by a single
shellcheck process

Related: https://issues.redhat.com/browse/OSH-655
Closes: csutils#182
kdudka added a commit to kdudka/csmock that referenced this pull request Aug 13, 2024
... so that we get equivalent scan results to the old version
of the shellcheck plug-in.

Related: https://issues.redhat.com/browse/OSH-655
Closes: csutils#182
kdudka added a commit to kdudka/csmock that referenced this pull request Aug 13, 2024
... so that we get equivalent scan results to the old version
of the shellcheck plug-in.

Related: https://issues.redhat.com/browse/OSH-655
Closes: csutils#182
@kdudka kdudka marked this pull request as ready for review August 13, 2024 13:14
kdudka added a commit to kdudka/csmock that referenced this pull request Aug 13, 2024
... so that we get equivalent scan results to the old version
of the shellcheck plug-in.

Related: https://issues.redhat.com/browse/OSH-655
Closes: csutils#182
kdudka added a commit to kdudka/csmock that referenced this pull request Aug 26, 2024
... so that we get equivalent scan results to the old version
of the shellcheck plug-in.

Related: https://issues.redhat.com/browse/OSH-655
Closes: csutils#182
@kdudka kdudka requested review from jamacku and lzaoral August 26, 2024 08:15
scripts/run-shellcheck.sh Outdated Show resolved Hide resolved
scripts/run-shellcheck.sh Outdated Show resolved Hide resolved
scripts/run-shellcheck.sh Outdated Show resolved Hide resolved
scripts/run-shellcheck.sh Outdated Show resolved Hide resolved
scripts/run-shellcheck.sh Outdated Show resolved Hide resolved
scripts/run-shellcheck.sh Outdated Show resolved Hide resolved
kdudka added a commit to kdudka/csmock that referenced this pull request Aug 26, 2024
... so that we get equivalent scan results to the old version
of the shellcheck plug-in.

Related: https://issues.redhat.com/browse/OSH-655
Closes: csutils#182
... initially developed for Konflux CI.  The updated version runs more
processes of `shellcheck` in parallel, each of them with a strictly set
timeout (currently 30s of wall-clock time).

Related: https://issues.redhat.com/browse/OSH-655
Resolves: https://issues.redhat.com/browse/OSH-733
... so that we get equivalent scan results as if we scanned all scripts
at once.

Related: https://issues.redhat.com/browse/OSH-655
... so that we get equivalent scan results as if we scanned all scripts
at once.

Related: https://issues.redhat.com/browse/OSH-655
... to configure maximum amount of wall-clock time taken by a single
shellcheck process

Related: https://issues.redhat.com/browse/OSH-655
... to configure maximum number of scripts scanned by a single
shellcheck process

Related: https://issues.redhat.com/browse/OSH-655
kdudka added a commit to kdudka/csmock that referenced this pull request Aug 26, 2024
... so that we get equivalent scan results to the old version
of the shellcheck plug-in.

Related: https://issues.redhat.com/browse/OSH-655
Closes: csutils#182
@kdudka kdudka requested a review from lzaoral August 26, 2024 14:24
Copy link
Member

@lzaoral lzaoral left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you, @kdudka.

py/plugins/shellcheck.py Outdated Show resolved Hide resolved
@lzaoral
Copy link
Member

lzaoral commented Aug 26, 2024

@kdudka What about adding a simple ShellCheck test to CI?

diff --git a/tests/simple_build/shellcheck.fmf b/tests/simple_build/shellcheck.fmf
new file mode 100644
index 0000000..f73f614
--- /dev/null
+++ b/tests/simple_build/shellcheck.fmf
@@ -0,0 +1,11 @@
+summary: Test analysis using GCC analyzer
+test: ./test.sh
+framework: beakerlib
+environment:
+      TEST_PACKAGE: dracut
+      TEST_TOOL: shellcheck
+component:
+  - csmock
+recommend:
+  - csmock
+duration: 1h

Copy link
Member

@jamacku jamacku left a comment

Choose a reason for hiding this comment

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

LGTM

kdudka added a commit to kdudka/csmock that referenced this pull request Aug 26, 2024
... so that we get equivalent scan results to the old version
of the shellcheck plug-in.  Also remove the filter for `note`
events, which were specific to the `gcc` output of ShellCheck.

Related: https://issues.redhat.com/browse/OSH-655
Closes: csutils#182
@kdudka
Copy link
Member Author

kdudka commented Aug 26, 2024

@lzaoral Thanks! I have added the test in c09d8f8.

@lzaoral
Copy link
Member

lzaoral commented Aug 26, 2024

@kdudka The following patch should fix the test failures on C9S hosts:

diff --git a/tests/simple_build/test.sh b/tests/simple_build/test.sh
index 9c0106e..3e684da 100755
--- a/tests/simple_build/test.sh
+++ b/tests/simple_build/test.sh
@@ -7,6 +7,10 @@ TEST_PACKAGE="${TEST_PACKAGE:-}"
 TEST_TOOL="${TEST_TOOL:-}"
 TEST_USER="csmock"

+# Add CS Koji
+BEAKERLIB_rpm_fetch_base_url+=( "https://kojihub.stream.centos.org/kojifiles/packages/" )
+BEAKERLIB_rpm_packageinfo_base_url+=( "https://kojihub.stream.centos.org/koji/" )
+
 rlJournalStart
     rlPhaseStartSetup
         # use the latest csutils in the Testing Farm

kdudka and others added 2 commits August 26, 2024 18:12
... so that we get equivalent scan results to the old version
of the shellcheck plug-in.  Also remove the filter for `note`
events, which were specific to the `gcc` output of ShellCheck.

Related: https://issues.redhat.com/browse/OSH-655
@kdudka
Copy link
Member Author

kdudka commented Aug 26, 2024

Thanks for review and testing!

@kdudka kdudka closed this in 51430de Aug 26, 2024
@kdudka kdudka merged commit 51430de into csutils:main Aug 26, 2024
40 checks passed
@kdudka kdudka deleted the shellcheck branch August 26, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants