Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lib/Hydra/Controller/User.pm
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ sub doEmailLogin {
my $allowed_domains = $c->config->{allowed_domains} // ($c->config->{persona_allowed_domains} // "");
if ($allowed_domains ne "") {
my $email_ok = 0;
my @domains = split ',', $allowed_domains;
my @domains = split /,/, $allowed_domains;
map { $_ =~ s/^\s*(.*?)\s*$/$1/ } @domains;

foreach my $domain (@domains) {
$email_ok = $email_ok || ((split '@', $email)[1] eq $domain);
$email_ok = $email_ok || ((split /@/, $email)[1] eq $domain);
}
error($c, "Your email address does not belong to a domain that is allowed to log in.\n")
unless $email_ok;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Hydra/Plugin/BazaarInput.pm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ sub fetchInput {
"nix-prefetch-bzr", $uri, $revision);
die "cannot check out Bazaar branch `$uri':\n$stderr" if $res;

($sha256, $storePath) = split ' ', $stdout;
($sha256, $storePath) = split / /, $stdout;

# FIXME: time window between nix-prefetch-bzr and addTempRoot.
$MACHINE_LOCAL_STORE->addTempRoot($storePath);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Hydra/Plugin/BitBucketPulls.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ sub fetchInput {
my ($self, $type, $name, $value, $project, $jobset) = @_;
return undef if $type ne "bitbucketpulls";
# TODO Allow filtering of some kind here?
(my $owner, my $repo) = split ' ', $value;
(my $owner, my $repo) = split / /, $value;
my $auth = $self->{config}->{bitbucket_authorization}->{$owner};
my %pulls;
my $ua = LWP::UserAgent->new();
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Hydra/Plugin/EmailNotification.pm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ sub buildFinished {

my $to = $build->jobset->emailoverride ne "" ? $build->jobset->emailoverride : $build->maintainers;

foreach my $address (split ",", ($to // "")) {
foreach my $address (split /,/, ($to // "")) {
$address = trim $address;

$addresses{$address} //= { builds => [] };
Expand Down
8 changes: 4 additions & 4 deletions src/lib/Hydra/Plugin/GitInput.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sub _isHash {

sub _parseValue {
my ($value) = @_;
my @parts = split ' ', $value;
my @parts = split / /, $value;
(my $uri, my $branch, my $deepClone) = @parts;
$branch = defined $branch ? $branch : "master";
my $options = {};
Expand All @@ -38,7 +38,7 @@ sub _parseValue {
$start_options = 2;
}
foreach my $option (@parts[$start_options .. $#parts]) {
(my $key, my $value) = split('=', $option);
(my $key, my $value) = split(/=/, $option);
$options->{$key} = $value;
}
return ($uri, $branch, $deepClone, $options);
Expand Down Expand Up @@ -214,7 +214,7 @@ sub fetchInput {
}

# FIXME: Don't use nix-prefetch-git.
($sha256, $storePath) = split ' ', grab(cmd => ["nix-prefetch-git", $clonePath, $revision], chomp => 1);
($sha256, $storePath) = split / /, grab(cmd => ["nix-prefetch-git", $clonePath, $revision], chomp => 1);

# FIXME: time window between nix-prefetch-git and addTempRoot.
$MACHINE_LOCAL_STORE->addTempRoot($storePath);
Expand Down Expand Up @@ -265,7 +265,7 @@ sub getCommits {

my $res = [];
foreach my $line (split /\n/, $out) {
my ($revision, $author, $email, $date) = split "\t", $line;
my ($revision, $author, $email, $date) = split /\t/, $line;
push @$res, { revision => $revision, author => decode("utf-8", $author), email => $email };
}

Expand Down
6 changes: 3 additions & 3 deletions src/lib/Hydra/Plugin/GithubPulls.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ sub _iterate {
$pulls->{$pull->{number}} = $pull;
}
# TODO Make Link header parsing more robust!!!
my @links = split ',', ($res->header("Link") // "");
my @links = split /,/, ($res->header("Link") // "");
my $next = "";
foreach my $link (@links) {
my ($url, $rel) = split ";", $link;
my ($url, $rel) = split /;/, $link;
if (trim($rel) eq 'rel="next"') {
$next = substr trim($url), 1, -1;
last;
Expand All @@ -47,7 +47,7 @@ sub fetchInput {
my ($self, $type, $name, $value, $project, $jobset) = @_;
return undef if $type ne "githubpulls";
# TODO Allow filtering of some kind here?
(my $owner, my $repo) = split ' ', $value;
(my $owner, my $repo) = split / /, $value;
my $auth = $self->{config}->{github_authorization}->{$owner};
my %pulls;
my $ua = LWP::UserAgent->new();
Expand Down
6 changes: 3 additions & 3 deletions src/lib/Hydra/Plugin/GithubRefs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ sub _iterate {
$refs->{$ref_name} = $ref;
}
# TODO Make Link header parsing more robust!!!
my @links = split ',', $res->header("Link");
my @links = split /,/, $res->header("Link");
my $next = "";
foreach my $link (@links) {
my ($url, $rel) = split ";", $link;
my ($url, $rel) = split /;/, $link;
if (trim($rel) eq 'rel="next"') {
$next = substr trim($url), 1, -1;
last;
Expand All @@ -99,7 +99,7 @@ sub fetchInput {
my ($self, $input_type, $name, $value, $project, $jobset) = @_;
return undef if $input_type ne "github_refs";

my ($owner, $repo, $type, $fut, $prefix) = split ' ', $value;
my ($owner, $repo, $type, $fut, $prefix) = split / /, $value;

my $auth = $self->{config}->{github_authorization}->{$owner};
my $githubEndpoint = $self->{config}->{github_endpoint} // "https://api.github.com";
Expand Down
6 changes: 3 additions & 3 deletions src/lib/Hydra/Plugin/GitlabPulls.pm
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ sub _iterate {
$pulls->{$pull->{iid}} = $pull;
}
# TODO Make Link header parsing more robust!!!
my @links = split ',', $res->header("Link");
my @links = split /,/, $res->header("Link");
my $next = "";
foreach my $link (@links) {
my ($url, $rel) = split ";", $link;
my ($url, $rel) = split /;/, $link;
if (trim($rel) eq 'rel="next"') {
$next = substr trim($url), 1, -1;
last;
Expand All @@ -65,7 +65,7 @@ sub fetchInput {
my ($self, $type, $name, $value, $project, $jobset) = @_;
return undef if $type ne "gitlabpulls";

(my $baseUrl, my $projectId) = split ' ', $value;
(my $baseUrl, my $projectId) = split / /, $value;
my $url = "$baseUrl/api/v4/projects/$projectId/merge_requests?per_page=100&state=opened";

my $accessToken = $self->{config}->{gitlab_authorization}->{$projectId};
Expand Down
8 changes: 4 additions & 4 deletions src/lib/Hydra/Plugin/MercurialInput.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sub supportedInputTypes {

sub _parseValue {
my ($value) = @_;
(my $uri, my $id) = split ' ', $value;
(my $uri, my $id) = split / /, $value;
$id = defined $id ? $id : "default";
return ($uri, $id);
}
Expand Down Expand Up @@ -60,7 +60,7 @@ sub fetchInput {
"hg", "log", "-r", $id, "--template", "{node} {rev} {branch}");
die "error getting branch and revision of $id from `$uri':\n$stderr" if $res1;

my ($revision, $revCount, $branch) = split ' ', $stdout;
my ($revision, $revCount, $branch) = split / /, $stdout;

my $storePath;
my $sha256;
Expand All @@ -81,7 +81,7 @@ sub fetchInput {
"nix-prefetch-hg", $clonePath, $revision);
die "cannot check out Mercurial repository `$uri':\n$stderr" if $res;

($sha256, $storePath) = split ' ', $stdout;
($sha256, $storePath) = split / /, $stdout;

# FIXME: time window between nix-prefetch-hg and addTempRoot.
$MACHINE_LOCAL_STORE->addTempRoot($storePath);
Expand Down Expand Up @@ -126,7 +126,7 @@ sub getCommits {
my $res = [];
foreach my $line (split /\n/, $out) {
if ($line ne "") {
my ($revision, $author, $email) = split "\t", $line;
my ($revision, $author, $email) = split /\t/, $line;
push @$res, { revision => $revision, author => $author, email => $email };
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Hydra/Plugin/PathInput.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sub _parseValue {
# The input is a local path or URL, optionally followed by a
# time period specified in seconds.
my ($config, $value) = @_;
my @parts = split ' ', $value;
my @parts = split / /, $value;
(my $uri, my $freq) = @parts;
# By default don't check a path more often than every 30 seconds,
# but the second path argument can change that value or the global
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Hydra/Plugin/RunCommand.pm
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ sub isBuildEligibleForDynamicRunCommand {
sub configSectionMatches {
my ($name, $project, $jobset, $job) = @_;

my @elems = split ':', $name;
my @elems = split /:/, $name;

die "invalid section name '$name'\n" if scalar(@elems) > 3;

Expand All @@ -103,7 +103,7 @@ sub configSectionMatches {

sub eventMatches {
my ($conf, $event) = @_;
for my $x (split " ", ($conf->{events} // "buildFinished")) {
for my $x (split / /, ($conf->{events} // "buildFinished")) {
return 1 if $x eq $event;
}
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Hydra/Plugin/SubversionInput.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sub fetchInput {
return undef if $type ne "svn" && $type ne "svn-checkout";

# Allow users to specify a revision number next to the URI.
my ($uri, $revision) = split ' ', $value;
my ($uri, $revision) = split / /, $value;

my $sha256;
my $storePath;
Expand Down
2 changes: 1 addition & 1 deletion t/queue-runner/notifications.t
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ subtest "Build: not substitutable, unsubstitutable" => sub {
subtest "Second notification: step_finished" => sub {
my ($channelName, $pid, $payload) = @{$dbh->func("pg_notifies")};
is($channelName, "step_finished", "The event is for the step finishing");
my ($buildId, $stepNr, $logFile) = split "\t", $payload;
my ($buildId, $stepNr, $logFile) = split /\t/, $payload;
is($buildId, $build->id, "The payload is the build's ID");
is($stepNr, 1, "The payload is the build's step number");
isnt($logFile, undef, "The log file is passed");
Expand Down
Loading