Skip to content

Commit

Permalink
[backend] bring back the BUILD_UNCHANGED event for api build status t…
Browse files Browse the repository at this point in the history
…racking, but do not deliver it to hermes.
  • Loading branch information
adrianschroeter committed Nov 5, 2013
1 parent 296f016 commit 7a02381
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/api/app/models/event/build.rb
Expand Up @@ -16,3 +16,7 @@ class Event::BuildFail < Event::Build
self.description = 'Package has failed to build'
end

class Event::BuildUnchanged < Event::Build
self.raw_type = 'BUILD_UNCHANGED'
self.description = 'Package has succeeded building with unchanged result'
end
9 changes: 9 additions & 0 deletions src/api/test/fixtures/events.yml
Expand Up @@ -47,6 +47,15 @@ events_1067339513:
lock_version: 0
created_at: 2013-08-31 14:56:52.000000000 Z
updated_at: 2013-08-31 14:56:52.000000000 Z
events_1067339514:
id: 1067339514
eventtype: Event::BuildUnchanged
payload: '{"project":"HiddenProject","package":"pack","repository":"nada","arch":"i586","disturl":"obs://build.some.where/HiddenProject/nada/ee3a023192742ef3c4b2e3ea1cabec4f-pack","release":"2.1","file":"package.spec","versrel":"1.0-2","readytime":"1377958901","srcmd5":"ee3a023192742ef3c4b2e3ea1cabec4f","srcserver":"http://localhost:3200","rev":"2","revtime":"1377958895","job":"HiddenProject::nada::pack-ee3a023192742ef3c4b2e3ea1cabec4f","reason":"new
build","bcnt":"1","needed":"0","reposerver":"http://localhost:3201","verifymd5":"ee3a023192742ef3c4b2e3ea1cabec4f"}'
queued: 0
lock_version: 0
created_at: 2013-08-31 14:56:52.000000000 Z
updated_at: 2013-08-31 14:56:52.000000000 Z
events_1067339518:
id: 1067339518
eventtype: Event::RepoPublished
Expand Down
1 change: 1 addition & 0 deletions src/backend/bs_repserver
Expand Up @@ -1790,6 +1790,7 @@ sub putjob {

if ($cgi->{'code'} && $cgi->{'code'} eq 'unchanged') {
$jobstatus->{'result'} = 'unchanged';
notify('BUILD_UNCHANGED', $info);
} else {
notify($jobstatus->{'result'} eq 'succeeded' ? 'BUILD_SUCCESS' : 'BUILD_FAIL', $info);
}
Expand Down
2 changes: 2 additions & 0 deletions src/backend/plugins/notify_hermes.pm
Expand Up @@ -41,6 +41,8 @@ sub notify() {
my @args = ( "rm=notify" );

$type = "UNKNOWN" unless $type;
# we do not want to deliver UNCHANGED events to hermes
return if $type eq "BUILD_UNCHANGED";
# prepend something BS specific
my $prefix = $BSConfig::hermesnamespace || "OBS";
$type = "${prefix}_$type";
Expand Down

0 comments on commit 7a02381

Please sign in to comment.