From nobody Sat May 4 02:51:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588330727; cv=none; d=zohomail.com; s=zohoarc; b=XNmHqYsznxXdcFww1iNONXqVh3C+0O9a03Ub13giTfVQ4Y0ZcPDWLj/4XMOex5ES9wtv3YTm31eM4lszFFNFLBgvIHBdo88bv1kNVpAug2zm7Q3mUA56S8MO/e2zcCQi4JcPHzke75KMMBnyGuc5o2d6dn01WppfYNY0yp9b7tY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588330727; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=2C2xsAQOBMm0PMp9vAPZgR40MCf2jHZlaWbxz156Dww=; b=OxuyAYVmST6iWHQ9lq5n48UOj6bcE+RPaxaejwcwP0TUkbxp/nZ9O29qhhs5Ej9zeJBqogzmQqAR+5A+5uh+dPdtRJj/CA1JaYe/Ifeo5Onx1GCrfM5JjOFfOzpRWzELvw920pwpKeuAqKO/7z6HFt07d+wG1Mu8ZRggl9lHPZI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 158833072719118.962162902905902; Fri, 1 May 2020 03:58:47 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-507-YP-N8Ba9PSW4C4z-nR4MMw-1; Fri, 01 May 2020 06:58:43 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2EDD9107ACF2; Fri, 1 May 2020 10:58:38 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AFC762B4BD; Fri, 1 May 2020 10:58:37 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D98731809542; Fri, 1 May 2020 10:58:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 041AwZI4007698 for ; Fri, 1 May 2020 06:58:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id B04062B4BE; Fri, 1 May 2020 10:58:35 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.110.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF8762B4BD; Fri, 1 May 2020 10:58:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588330725; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=2C2xsAQOBMm0PMp9vAPZgR40MCf2jHZlaWbxz156Dww=; b=KN3enk+e2rt5ELvw9LfNwlnjySpVLUIxZXGZnW8jn89W1fnZMpDVrgeK8nO/TM4R6oK2yI +FgiKguXYvfq0l50GSu6kT5BvNBjSwLDc4m92r2K83eETV2D4812mrdw1fLo0sbqojzdff xoEUaKK1YaoYuT1iuAgsU87CTvSgyI4= X-MC-Unique: YP-N8Ba9PSW4C4z-nR4MMw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH] gitlab: convert to shared container for DCO check Date: Fri, 1 May 2020 11:58:30 +0100 Message-Id: <20200501105830.2225931-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This removes the locally maintained DCO checking script in favour of the shared containre image provided by libvirt-ci.git. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Andrea Bolognani --- .gitlab-ci.yml | 21 ++++----- scripts/require-dco.py | 99 ------------------------------------------ 2 files changed, 9 insertions(+), 111 deletions(-) delete mode 100755 scripts/require-dco.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 99e7b510c7..3752618b43 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -221,18 +221,15 @@ potfile: - libvirt.pot =20 =20 -# Check that all commits are signed-off for the DCO. Skip -# on master branch and -maint branches, since we only need -# to test developer's personal branches. -dco: +# Check that all commits are signed-off for the DCO. +# Skip on "libvirt" namespace, since we only need to run +# this test on developer's personal forks from which +# merge requests are submitted +check-dco: stage: prebuild - image: quay.io/libvirt/buildenv-libvirt-fedora-31:latest - before_script: - - *script_variables + image: registry.gitlab.com/libvirt/libvirt-ci/check-dco:master script: - - ./scripts/require-dco.py - only: - - branches + - /check-dco except: - - /^v.*-maint$/ - - master + variables: + - $CI_PROJECT_NAMESPACE =3D=3D 'libvirt' diff --git a/scripts/require-dco.py b/scripts/require-dco.py deleted file mode 100755 index ae94393319..0000000000 --- a/scripts/require-dco.py +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env python3 - -# require-dco.py: validate all commits are signed off -# -# Copyright (C) 2020 Red Hat, Inc. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library. If not, see -# . - -import os -import os.path -import sys -import subprocess - -cwd =3D os.getcwd() -reponame =3D os.path.basename(cwd) -repourl =3D "https://gitlab.com/libvirt/%s.git" % reponame - -subprocess.check_call(["git", "remote", "add", "dcocheck", repourl]) -subprocess.check_call(["git", "fetch", "dcocheck", "master"], - stdout=3Dsubprocess.DEVNULL, - stderr=3Dsubprocess.DEVNULL) - -ancestor =3D subprocess.check_output(["git", "merge-base", "dcocheck/maste= r", "HEAD"], - universal_newlines=3DTrue) - -ancestor =3D ancestor.strip() - -subprocess.check_call(["git", "remote", "rm", "dcocheck"]) - -errors =3D False - -print("\nChecking for 'Signed-off-by: NAME ' on all commits since %= s...\n" % ancestor) - -log =3D subprocess.check_output(["git", "log", "--format=3D%H %s", ancesto= r + "..."], - universal_newlines=3DTrue) - -if log =3D=3D "": - commits =3D [] -else: - commits =3D [[c[0:40], c[41:]] for c in log.strip().split("\n")] - -for sha, subject in commits: - - msg =3D subprocess.check_output(["git", "show", "-s", sha], - universal_newlines=3DTrue) - lines =3D msg.strip().split("\n") - - print("=F0=9F=94=8D %s %s" % (sha, subject)) - sob =3D False - for line in lines: - if "Signed-off-by:" in line: - sob =3D True - if "localhost" in line: - print(" =E2=9D=8C FAIL: bad email in %s" % line) - errors =3D True - - if not sob: - print(" =E2=9D=8C FAIL missing Signed-off-by tag") - errors =3D True - -if errors: - print(""" - -=E2=9D=8C ERROR: One or more commits are missing a valid Signed-off-By tag. - - -This project requires all contributors to assert that their contributions -are provided in compliance with the terms of the Developer's Certificate -of Origin 1.1 (DCO): - - https://developercertificate.org/ - -To indicate acceptance of the DCO every commit must have a tag - - Signed-off-by: REAL NAME - -This can be achieved by passing the "-s" flag to the "git commit" command. - -To bulk update all commits on current branch "git rebase" can be used: - - git rebase -i master -x 'git commit --amend --no-edit -s' - -""") - - sys.exit(1) - -sys.exit(0) --=20 2.25.4