Source

Target

Commits (13)
Showing with 159 additions and 95 deletions
Unless noted otherwise, the following 3-clause BSD-style license
applies to the scripts in this package:
Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
Contact: http://www.qt-project.org/legal
Copyright (C) 2015 The Qt Company Ltd.
Contact: http://www.qt.io/licensing/
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
......
GNU LESSER GENERAL PUBLIC LICENSE
The Qt Toolkit is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
Contact: http://www.qt-project.org/legal
The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
Contact: http://www.qt.io/licensing/
You may use, distribute and copy the Qt GUI Toolkit under the terms of
GNU Lesser General Public License version 2.1, which is displayed below.
......
GNU LESSER GENERAL PUBLIC LICENSE
The Qt Toolkit is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
Contact: http://www.qt-project.org/legal
The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
Contact: http://www.qt.io/licensing/
You may use, distribute and copy the Qt GUI Toolkit under the terms of
GNU Lesser General Public License version 3, which is displayed below.
......
......@@ -18,6 +18,7 @@ fregl=frederik
girishr=girish
guruz=mgoetz2
harryf=fernenge
iieklund=iknd
jasmacdon=macadder
jbache=bachewii
jbarron=jabarron
......
#!/bin/sh
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
# Contact: http://www.qt-project.org/legal
# Copyright (C) 2015 The Qt Company Ltd.
# Contact: http://www.qt.io/licensing/
#
# You may use this file under the terms of the 3-clause BSD license.
# See the file LICENSE from this package for details.
......
#!/usr/bin/perl
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
# Contact: http://www.qt-project.org/legal
# Copyright (C) 2015 The Qt Company Ltd.
# Contact: http://www.qt.io/licensing/
#
# You may use this file under the terms of the 3-clause BSD license.
# See the file LICENSE from this package for details.
......@@ -22,12 +22,11 @@ sub usage
Usage:
git gpush [opts] [[sha1/ref-from]:[ref-to]] [+<reviewer>] [=<CC user>] [-- <push opts>]
Pushes changes to Gerrit and adds reviewers and CC to the patch
sets
Pushes Changes to Gerrit and adds reviewers and CC to the PatchSets.
Description:
This script is used to push patch sets to Gerrit, and at the same
time add reviewers and CCs to the patch sets pushed.
This script is used to push PatchSets to Gerrit, and at the same
time add reviewers and CCs to the PatchSets pushed.
You can use email addresses, Gerrit usernames or aliases for the
name of the reviewers/CCs.
......@@ -50,11 +49,11 @@ Description:
Options:
-d, --draft
Mark the pushed changes as drafts. This switch is usually
unnecessary, as gpush will recognize WIP changes by subject.
Mark the pushed Changes as drafts. This switch is usually
unnecessary, as gpush will recognize WIP Changes by subject.
-p, --publish
Do not mark the pushed changes as drafts even if they have
Do not mark the pushed Changes as drafts even if they have
WIP markers.
-r, --remote
......@@ -97,8 +96,8 @@ Configuring Aliases:
list, in case a user uses multiple handles.
Copyright:
Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
Contact: http://www.qt-project.org/legal
Copyright (C) 2015 The Qt Company Ltd.
Contact: http://www.qt.io/licensing/
License:
You may use this file under the terms of the 3-clause BSD license.
......
#! /bin/sh
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
# Contact: http://www.qt-project.org/legal
# Copyright (C) 2015 The Qt Company Ltd.
# Contact: http://www.qt.io/licensing/
#
# You may use this file under the terms of the 3-clause BSD license.
# See the file LICENSE from this package for details.
......
#!/usr/bin/perl
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
# Contact: http://www.qt-project.org/legal
# Copyright (C) 2015 The Qt Company Ltd.
# Contact: http://www.qt.io/licensing/
#
# You may use this file under the terms of the 3-clause BSD license.
# See the file LICENSE from this package for details.
......
#!/usr/bin/perl
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
# Contact: http://www.qt-project.org/legal
# Copyright (C) 2015 The Qt Company Ltd.
# Contact: http://www.qt.io/licensing/
#
# You may use this file under the terms of the 3-clause BSD license.
# See the file LICENSE from this package for details.
......@@ -89,8 +89,8 @@ Examples:
$ git log -p ossis/master
Copyright:
Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
Contact: http://www.qt-project.org/legal
Copyright (C) 2015 The Qt Company Ltd.
Contact: http://www.qt.io/licensing/
License:
You may use this file under the terms of the 3-clause BSD license.
......
#! /usr/bin/perl
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
# Contact: http://www.qt-project.org/legal
# Copyright (C) 2015 The Qt Company Ltd.
# Contact: http://www.qt.io/licensing/
#
# You may use this file under the terms of the 3-clause BSD license.
# See the file LICENSE from this package for details.
......
......@@ -5,8 +5,8 @@
#
# Sets up the proper grafts for a Qt repository
#
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
# Contact: http://www.qt-project.org/legal
# Copyright (C) 2015 The Qt Company Ltd.
# Contact: http://www.qt.io/licensing/
#
####################################################################################################
......
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
:: Contact: http://www.qt-project.org/legal
:: Copyright (C) 2015 The Qt Company Ltd.
:: Contact: http://www.qt.io/licensing/
::
:: This file is part of the tools applications of the Qt Toolkit.
::
:: $QT_BEGIN_LICENSE:LGPL$
:: $QT_BEGIN_LICENSE:LGPL21$
:: Commercial License Usage
:: Licensees holding valid commercial Qt licenses may use this file in
:: accordance with the commercial license agreement provided with the
:: Software or, alternatively, in accordance with the terms contained in
:: a written agreement between you and Digia. For licensing terms and
:: conditions see http://qt.digia.com/licensing. For further information
:: use the contact form at http://qt.digia.com/contact-us.
:: a written agreement between you and The Qt Company. For licensing terms
:: and conditions see http://www.qt.io/terms-conditions. For further
:: information use the contact form at http://www.qt.io/contact-us.
::
:: GNU Lesser General Public License Usage
:: Alternatively, this file may be used under the terms of the GNU Lesser
:: General Public License version 2.1 as published by the Free Software
:: Foundation and appearing in the file LICENSE.LGPL included in the
:: packaging of this file. Please review the following information to
:: ensure the GNU Lesser General Public License version 2.1 requirements
:: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
::
:: In addition, as a special exception, Digia gives you certain additional
:: rights. These rights are described in the Digia Qt LGPL Exception
:: General Public License version 2.1 or version 3 as published by the Free
:: Software Foundation and appearing in the file LICENSE.LGPLv21 and
:: LICENSE.LGPLv3 included in the packaging of this file. Please review the
:: following information to ensure the GNU Lesser General Public License
:: requirements will be met: https://www.gnu.org/licenses/lgpl.html and
:: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
::
:: As a special exception, The Qt Company gives you certain additional
:: rights. These rights are described in The Qt Company LGPL Exception
:: version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
::
:: GNU General Public License Usage
:: Alternatively, this file may be used under the terms of the GNU
:: General Public License version 3.0 as published by the Free Software
:: Foundation and appearing in the file LICENSE.GPL included in the
:: packaging of this file. Please review the following information to
:: ensure the GNU General Public License version 3.0 requirements will be
:: met: http://www.gnu.org/copyleft/gpl.html.
::
::
:: $QT_END_LICENSE$
::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
......
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
# Contact: http://www.qt-project.org/legal
# Copyright (C) 2015 The Qt Company Ltd.
# Contact: http://www.qt.io/licensing/
#
# You may use this file under the terms of the 3-clause BSD license.
# See the file LICENSE from this package for details.
......
#!/usr/bin/perl
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
# Contact: http://www.qt-project.org/legal
# Copyright (C) 2015 The Qt Company Ltd.
# Contact: http://www.qt.io/licensing/
#
# You may use this file under the terms of the 3-clause BSD license.
# See the file LICENSE from this package for details.
......
#! /usr/bin/perl
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
# Contact: http://www.qt-project.org/legal
# Copyright (C) 2015 The Qt Company Ltd.
# Contact: http://www.qt.io/licensing/
#
# You may use this file under the terms of the 3-clause BSD license.
# See the file LICENSE from this package for details.
......
......@@ -2,8 +2,8 @@
#!/usr/bin/perl
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
# Contact: http://www.qt-project.org/legal
# Copyright (C) 2015 The Qt Company Ltd.
# Contact: http://www.qt.io/licensing/
#
# You may use this file under the terms of the 3-clause BSD license.
# See the file LICENSE from this package for details.
......
......@@ -3,8 +3,8 @@
#
# Helper script for Qt 5
#
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
# Contact: http://www.qt-project.org/legal
# Copyright (C) 2015 The Qt Company Ltd.
# Contact: http://www.qt.io/licensing/
#
####################################################################################################
......
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
:: Contact: http://www.qt-project.org/legal
:: Copyright (C) 2015 The Qt Company Ltd.
:: Contact: http://www.qt.io/licensing/
::
:: This file is part of the tools applications of the Qt Toolkit.
::
:: $QT_BEGIN_LICENSE:LGPL$
:: $QT_BEGIN_LICENSE:LGPL21$
:: Commercial License Usage
:: Licensees holding valid commercial Qt licenses may use this file in
:: accordance with the commercial license agreement provided with the
:: Software or, alternatively, in accordance with the terms contained in
:: a written agreement between you and Digia. For licensing terms and
:: conditions see http://qt.digia.com/licensing. For further information
:: use the contact form at http://qt.digia.com/contact-us.
:: a written agreement between you and The Qt Company. For licensing terms
:: and conditions see http://www.qt.io/terms-conditions. For further
:: information use the contact form at http://www.qt.io/contact-us.
::
:: GNU Lesser General Public License Usage
:: Alternatively, this file may be used under the terms of the GNU Lesser
:: General Public License version 2.1 as published by the Free Software
:: Foundation and appearing in the file LICENSE.LGPL included in the
:: packaging of this file. Please review the following information to
:: ensure the GNU Lesser General Public License version 2.1 requirements
:: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
::
:: In addition, as a special exception, Digia gives you certain additional
:: rights. These rights are described in the Digia Qt LGPL Exception
:: General Public License version 2.1 or version 3 as published by the Free
:: Software Foundation and appearing in the file LICENSE.LGPLv21 and
:: LICENSE.LGPLv3 included in the packaging of this file. Please review the
:: following information to ensure the GNU Lesser General Public License
:: requirements will be met: https://www.gnu.org/licenses/lgpl.html and
:: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
::
:: As a special exception, The Qt Company gives you certain additional
:: rights. These rights are described in The Qt Company LGPL Exception
:: version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
::
:: GNU General Public License Usage
:: Alternatively, this file may be used under the terms of the GNU
:: General Public License version 3.0 as published by the Free Software
:: Foundation and appearing in the file LICENSE.GPL included in the
:: packaging of this file. Please review the following information to
:: ensure the GNU General Public License version 3.0 requirements will be
:: met: http://www.gnu.org/copyleft/gpl.html.
::
::
:: $QT_END_LICENSE$
::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
......
#! /usr/bin/perl
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
# Contact: http://www.qt-project.org/legal
# Copyright (C) 2015 The Qt Company Ltd.
# Contact: http://www.qt.io/licensing/
#
# You may use this file under the terms of the 3-clause BSD license.
# See the file LICENSE from this package for details.
......@@ -43,6 +43,19 @@ use File::Path;
# excluded (optional)
# Space-separated list of exclusions of the form <project> or
# <project>:<branch>.
# maintainers (optional)
# Space-separated list of reviewers to add on "special occasions".
# watches (optional)
# Space-separated list of path watches. Each watch requires an own
# section named watches.<name> with the following keys:
# projects (default ".*")
# Regular expression specifying the projects to watch.
# files
# Regular expression specifying the filepaths to watch.
# message (optional)
# The message to post when this watch triggers.
# invite (optional)
# Space-separated list of reviewers to add when this watch triggers.
# verbose (default 0)
# Print progress/result messages.
......@@ -84,8 +97,23 @@ my $GIT_BASEDIR = getcfg 'gitbasedir';
my $GIT_DO_FETCH = getcfg 'gitdofetch';
my $WORKER = getcfg 'worker';
my %EXCLUDED_PROJECTS = map { $_ => 1 } split(/\s+/, getcfg('excluded', ""));
my @MAINTAINERS = split(/\s+/, getcfg('maintainers', ""));
my @WATCHES = split(/\s+/, getcfg('watches', ""));
my $verbose = getcfg 'verbose', 0;
my (%watch_projects, %watch_files, %watch_messages, %watch_invites);
for my $w (@WATCHES) {
my $p = $config{'watches.'.$w.'.projects'};
$watch_projects{$w} = defined($p) ? qr/^$p$/ : undef;
my $f = $config{'watches.'.$w.'.files'};
die "watches.$w.files not set.\n" if (!defined($f));
$watch_files{$w} = qr/^$f$/;
my $m = $config{'watches.'.$w.'.message'};
$watch_messages{$w} = defined($m) ? $m."\n\n" : "";
my $i = $config{'watches.'.$w.'.invite'};
$watch_invites{$w} = defined($i) ? [ split(/\s+/, $i) ] : [];
}
my $gerrit_rest;
if ($REST_HOST) {
use Gerrit::REST;
......@@ -116,6 +144,9 @@ sub process_commit($$$$$)
my $orig_project = $project;
$project =~ s,/$,,; # XXX Workaround QTQAINFRA-381
my ($score, $verdict);
my $message = "";
my $iswip = 0;
my @invite;
my $use_rest = 0;
if (defined($EXCLUDED_PROJECTS{$project}) || defined($EXCLUDED_PROJECTS{$project.":".$branch})) {
$verbose and print "===== ".strftime("%c", localtime(time()))." ===== excluding commit ".$ref." in ".$project."\n";
......@@ -153,6 +184,39 @@ sub process_commit($$$$$)
}
$verbose and print "===== ".strftime("%c", localtime(time()))." ===== fetched change\n";
}
my $subject;
my @watches;
for my $w (@WATCHES) {
my $wp = $watch_projects{$w};
push @watches, $w if (!defined($wp) || $project =~ $wp);
}
if (@watches) {
my @touched = `git show --pretty=\%s --name-only --ignore-submodules -C $rev`;
chop(@touched);
$subject = shift @touched;
shift @touched; # empty line
for my $w (@watches) {
for my $file (@touched) {
if ($file =~ $watch_files{$w}) {
$message .= $watch_messages{$w};
push @invite, @{$watch_invites{$w}};
last;
}
}
}
}
if (!defined($subject)) {
$subject = `git show --pretty=\%s -s $rev`;
chop($subject);
}
if ($subject =~ /\b(?:WIP|Wip|wip(?!\/))\b|\*{3}|^(?:squash|fixup)! |^(.)\1*$/) {
$iswip = 1;
$message = "Apparently pushing a Work In Progress\n\n".$message;
}
my $worker = $WORKER;
$worker =~ s/\@SHA1\@/$rev/g;
open VERDICT, $worker." 2>&1 |" or die "cannot run worker: ".$!;
......@@ -168,21 +232,23 @@ sub process_commit($$$$$)
if ($REST_HOST) {
if (length($verdict) > 50000) {
$verdict = "**** Worker produced an unreasonable amount of output. You should ask the bot maintainers for advice.";
push @invite, @MAINTAINERS;
} else {
$use_rest = 1;
$verdict = decode_json($verdict);
defined($verdict) or die "cannot decode verdict as JSON\n";
$$verdict{labels} = { 'Sanity-Review' => $score };
$$verdict{labels} = { 'Sanity-Review' => $score, 'Code-Review' => ($iswip ? -2 : 0) };
}
} else {
if (length($verdict) > 20000) {
$verdict = substr($verdict, 0, 20000)."\n\n**** Output truncated. Fix the problems above to get more output.\n";
}
$verdict =~ s/([\"\\\$\`])/\\$1/g; # ssh doesn`t properly quote the arguments for sh
$verdict =~ s/^\s+|\s+$//g;
}
}
if ($use_rest) {
if (defined($$verdict{message}) || length($message)) {
$$verdict{message} = $message.($$verdict{message} || "");
}
eval {
$gerrit_rest->POST("/changes/$number/revisions/$rev/review", $verdict);
};
......@@ -192,11 +258,17 @@ sub process_commit($$$$$)
return;
}
} else {
$verdict = $message.$verdict;
my @args = ();
# push @args, ("--project", $project);
push @args, ("--project", $orig_project); # XXX Workaround QTQAINFRA-381
push @args, ("--sanity-review", ($score > 0) ? "+".$score : $score);
push @args, ("--message", '"'.$verdict.'"') if (length($verdict));
push @args, ("--code-review", $iswip ? -2 : 0);
if (length($verdict)) {
$verdict =~ s/([\"\\\$\`])/\\$1/g; # ssh doesn`t properly quote the arguments for sh
$verdict =~ s/^\s+|\s+$//g;
push @args, ("--message", '"'.$verdict.'"');
}
if (system(@gerrit, "review", @args, $rev)) {
print "===== ".strftime("%c", localtime(time()))." ===== verdict NOT submitted\n";
printerr("Submission of verdict for ".$rev." (".$project."/".$ref.") failed");
......@@ -204,6 +276,14 @@ sub process_commit($$$$$)
}
}
$verbose and print "Submitted verdict for ".$rev." (".$project."/".$ref."): $score\n";
if (@invite) {
if (system(@gerrit, "set-reviewers", (map { ('-a', $_) } @invite), '--', $rev)) {
print "===== ".strftime("%c", localtime(time()))." ===== invitation FAILED\n";
printerr("Inviting reviewers to ".$rev." (".$project."/".$ref.") failed");
return;
}
$verbose and print "Invited @invite to ".$rev." (".$project."/".$ref.")\n";
}
}
$| = 1; # make STDOUT autoflush
......
#! /bin/sh
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
# Contact: http://www.qt-project.org/legal
# Copyright (C) 2015 The Qt Company Ltd.
# Contact: http://www.qt.io/licensing/
#
# You may use this file under the terms of the 3-clause BSD license.
# See the file LICENSE from this package for details.
......