Skip to content

Commit

Permalink
ObsRsync: Consistently expand status URL
Browse files Browse the repository at this point in the history
  • Loading branch information
kalikiana committed Jan 10, 2024
1 parent b5e992e commit ef5286d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion lib/OpenQA/WebAPI/Plugin/ObsRsync/Controller/Gru.pm
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,15 @@ sub run {
return $self->render(json => {message => 'queue full'}, status => QUEUE_FULL)
if ($results->{total} >= $queue_limit);

$app->gru->enqueue('obs_rsync_run', {project => $project, url => $helper->project_status_url}, {priority => 100});
# XXX: see ObsRsync.pm _get_api_dirty_status_url
# need split eventual batch and repository in project name
my $url = $helper->project_status_url;
# ($project, undef) = $helper->split_alias($project);
# my $package = $helper->get_api_package($project);
# ($project, undef) = $helper->split_repo($project);
$url =~ s/%%PROJECT/$project/g;

$app->gru->enqueue('obs_rsync_run', {project => $project, url => $url}, {priority => 100});

return $self->render(json => {message => 'queued'}, status => QUEUED) if $has_active_job; # uncoverable statement
return $self->render(json => {message => 'started'}, status => STARTED);
Expand Down
2 changes: 1 addition & 1 deletion t/ui/27-plugin_obs_rsync_obs_status.t
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ $t->get_ok('/admin/obs_rsync/queue')->status_is(200, 'jobs list')->content_like(
->content_unlike(qr/\bactive\b/)->content_like(qr/Proj1/)->content_like(qr/Proj2/)->content_unlike(qr/Proj3/);

$t->get_ok('/admin/obs_rsync/')->status_is(200, 'project list')->content_like(qr/published/)->content_like(qr/dirty/)
->content_like(qr/publishing/);
->content_like(qr/publishing/)->content_like(qr/$host\build\/Proj?/);

subtest 'build service ssh authentication' => sub {
is($helper->is_status_dirty('ProjWithAuth'), 1, 're-authenticate with ssh auth');
Expand Down

0 comments on commit ef5286d

Please sign in to comment.