Skip to content

Commit

Permalink
Merge pull request #16826 from mlschroe/master
Browse files Browse the repository at this point in the history
[backend] implement aggregation from remote _repository as package
  • Loading branch information
mlschroe authored Sep 9, 2024
2 parents 9ee6f7a + 0f9f26e commit 3d3fc12
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/backend/BSSched/BuildJob/Aggregate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,17 @@ sub check {

for my $apackid (@apackids) {
if ($apackid eq '_repository') {
return ('broken', 'aggregating from a remote _repository is not implemented yet') if $remoteprojs->{$aprojid};
push @blocked, "$aprp/$apackid"; # see prpfinished check above
if ($remoteprojs->{$aprojid}) {
return ('broken', 'need a binary filter for remote _repository aggregates') unless @{$aggregate->{'binary'} || []};
for (grep {$_} values %$ps) {
if ($_ eq 'scheduled' || $_ eq 'blocked' || $_ eq 'finished') {
push @blocked, "$aprp/$apackid";
last;
}
}
} else {
push @blocked, "$aprp/$apackid"; # see prpfinished check above
}
next;
}
my $code = $ps->{$apackid} || 'unknown';
Expand Down Expand Up @@ -275,7 +284,7 @@ sub check {
my $havecontainer;
if ($remoteprojs->{$aprojid}) {
my $bininfo = ($gbininfos{"$aprojid/$arepoid/$myarch"} || {})->{$apackid} || {};
for my $bin (sort {$a->{'filename'} cmp $b->{'filename'}} values %$bininfo) {
for my $bin (sort {($a->{'filename'} || '') cmp ($b->{'filename'} || '')} values %$bininfo) {
my $filename = $bin->{'filename'};
next unless $filename;
next unless $filename eq 'updateinfo.xml' || $filename =~ /\.(?:$binsufsre)$/ || $filename =~ /\.obsbinlnk$/;
Expand Down Expand Up @@ -417,6 +426,7 @@ sub build {
my $remoteproj = $remoteprojs->{$aprojid};
my @args = 'view=cpio';
push @args, 'noajax=1' if $remoteproj->{'partition'};
push @args, map {"binary=$_"} @{$aggregate->{'binary'}} if $apackid eq '_repository' && $aggregate->{'binary'};
my $param = {
'uri' => "$remoteproj->{'remoteurl'}/build/$remoteproj->{'remoteproject'}/$arepoid/$myarch/$apackid",
'receiver' => \&BSHTTP::cpio_receiver,
Expand Down

0 comments on commit 3d3fc12

Please sign in to comment.