[libvirt PATCH 0/2] ci: Some minor adjustments

After recent changes. Andrea Bolognani (2): ci: Restore information about Coverity integration ci: Avoid use of magic constants ci/README.rst | 22 ++++++++++++++++++++++ ci/util.py | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) -- 2.31.1

These were removed along with the outdated information on how to regenerate the Dockerfiles contained in the repository, but this part is still relevant. Reverts: 30856d2865122f82ec25c258c7cd2cceb52aa7a5 (partially) Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ci/README.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ci/README.rst b/ci/README.rst index 2a7d767227..6c6c6f95b3 100644 --- a/ci/README.rst +++ b/ci/README.rst @@ -63,3 +63,25 @@ repository as usual and you'll automatically get the additional CI coverage. .. _Cirrus CI: https://cirrus-ci.com/ .. _MinGW: http://mingw.org/ .. _cirrus-run: https://github.com/sio/cirrus-run/ + + +Coverity scan integration +========================= + +This will be used only by the main repository for master branch by running +scheduled pipeline in GitLab. + +The service is proved by `Coverity Scan`_ and requires that the project is +registered there to get free coverity analysis which we already have for +`libvirt project`_. + +To run the coverity job it requires two new variables: + + * ``COVERITY_SCAN_PROJECT_NAME``, containing the `libvirt project`_ + name. + + * ``COVERITY_SCAN_TOKEN``, token visible to admins of `libvirt project`_ + + +.. _Coverity Scan: https://scan.coverity.com/ +.. _libvirt project: https://scan.coverity.com/projects/libvirt -- 2.31.1

The value 3 is the length of the "ci-" prefix, which is present in the items returned by get_registry_images() but not in those returned by get_dockerfiles(). Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ci/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/util.py b/ci/util.py index d8be6631eb..f9f3c550db 100644 --- a/ci/util.py +++ b/ci/util.py @@ -68,10 +68,11 @@ def get_registry_stale_images(registry_uri: str, base_dir: str) -> Dict[str, int dockerfiles = get_dockerfiles(base_dir) images = get_registry_images(registry_uri) + name_prefix = "ci-" stale_images = {} for img in images: - if img["name"][3:] not in dockerfiles: + if img["name"][len(name_prefix):] not in dockerfiles: stale_images[img["name"]] = img["id"] return stale_images -- 2.31.1

On Fri, Sep 10, 2021 at 03:59:55PM +0200, Andrea Bolognani wrote:
The value 3 is the length of the "ci-" prefix, which is present in the items returned by get_registry_images() but not in those returned by get_dockerfiles().
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ci/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ci/util.py b/ci/util.py index d8be6631eb..f9f3c550db 100644 --- a/ci/util.py +++ b/ci/util.py @@ -68,10 +68,11 @@ def get_registry_stale_images(registry_uri: str, base_dir: str) -> Dict[str, int
dockerfiles = get_dockerfiles(base_dir) images = get_registry_images(registry_uri) + name_prefix = "ci-"
stale_images = {} for img in images: - if img["name"][3:] not in dockerfiles: + if img["name"][len(name_prefix):] not in dockerfiles: stale_images[img["name"]] = img["id"]
return stale_images -- 2.31.1
Reviewed-by: Beraldo Leal <bleal@redhat.com> -- Beraldo

On 9/10/21 3:59 PM, Andrea Bolognani wrote:
After recent changes.
Andrea Bolognani (2): ci: Restore information about Coverity integration ci: Avoid use of magic constants
ci/README.rst | 22 ++++++++++++++++++++++ ci/util.py | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-)
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Michal
participants (3)
-
Andrea Bolognani
-
Beraldo Leal
-
Michal Prívozník