From bfb756199f48af25d54dc263f36050e867de1a3e Mon Sep 17 00:00:00 2001 From: Chelsea Mafrica Date: Fri, 15 Dec 2023 17:08:33 -0800 Subject: [PATCH 1/2] ci: Use static checks from kata repo for lib functions Change the two functions in lib.sh to use the static checks script from the kata containers repo instead of tests. Remove cloning the repo from these functions since we don't need it anymore. Leave these two functions because the document checking one may be used locally and the static checks one is called from the virtcontainers Makefile. Fixes #8681 Signed-off-by: Chelsea Mafrica --- ci/lib.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/lib.sh b/ci/lib.sh index 3dca29b7ec..6180d62bae 100644 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -5,6 +5,8 @@ set -o nounset +export kata_repo="github.com/kata-containers/kata-containers" +export kata_repo_dir="$GOPATH/src/$kata_repo" export tests_repo="${tests_repo:-github.com/kata-containers/tests}" export tests_repo_dir="$GOPATH/src/$tests_repo" export branch="${target_branch:-main}" @@ -39,20 +41,18 @@ clone_tests_repo() run_static_checks() { - clone_tests_repo # Make sure we have the targeting branch git remote set-branches --add origin "${branch}" git fetch -a - bash "$tests_repo_dir/.ci/static-checks.sh" "$@" + bash "$kata_repo_dir/tests/static-checks.sh" "$@" } run_docs_url_alive_check() { - clone_tests_repo # Make sure we have the targeting branch git remote set-branches --add origin "${branch}" git fetch -a - bash "$tests_repo_dir/.ci/static-checks.sh" --docs --all "github.com/kata-containers/kata-containers" + bash "$kata_repo_dir/tests/static-checks.sh" --docs --all "$kata_repo" } run_get_pr_changed_file_details() From b785ef96ec37713a34aaf00624ec39de2f44283b Mon Sep 17 00:00:00 2001 From: Chelsea Mafrica Date: Fri, 15 Dec 2023 17:13:02 -0800 Subject: [PATCH 2/2] docs: Change location of static checks script We now use the static checks script from the main kata containers repo and not the tests repo; update documentation to reflect this. Fixes #8681 Signed-off-by: Chelsea Mafrica --- docs/Licensing-strategy.md | 2 +- docs/presentations/unit-testing/kata-containers-unit-testing.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Licensing-strategy.md b/docs/Licensing-strategy.md index 618beb92b3..ffc87333eb 100644 --- a/docs/Licensing-strategy.md +++ b/docs/Licensing-strategy.md @@ -18,4 +18,4 @@ licensing and allows automated tooling to check the license of individual files. This SPDX licence identifier requirement is enforced by the -[CI (Continuous Integration) system](https://github.com/kata-containers/tests/blob/main/.ci/static-checks.sh). +[CI (Continuous Integration) system](https://github.com/kata-containers/kata-containers/blob/main/tests/static-checks.sh). diff --git a/docs/presentations/unit-testing/kata-containers-unit-testing.md b/docs/presentations/unit-testing/kata-containers-unit-testing.md index 52ea699a1a..44f7ea4b8a 100644 --- a/docs/presentations/unit-testing/kata-containers-unit-testing.md +++ b/docs/presentations/unit-testing/kata-containers-unit-testing.md @@ -213,7 +213,7 @@ If in doubt, look at the - As a non-privileged user. - As the `root` user (carefully!) -- Run the [static checker](https://github.com/kata-containers/tests/blob/main/.ci/static-checks.sh) +- Run the [static checker](https://github.com/kata-containers/kata-containers/blob/main/tests/static-checks.sh) on your changes. Checks formatting and many other things.