Skip to content

Commit

Permalink
refactor(triggers): Gate calls to igor from orca (#2748)
Browse files Browse the repository at this point in the history
Now that echo handles augmenting triggers with build info, and that
manual triggers default to go through echo, all triggers should be
arriving in Orca with their build information already populated. We
should gate the logic in Orca to only run if it's not there.

We can't completely remove this logic yet because while manual
triggering via echo defaults to enabled, there's still a flag to
turn it off. Once that flag is deprecated, and we're confident that
all manual triggers (including any via the API) go through echo,
we can completely remove this block of code.

This commit also completely removes the populating of taggedImages,
which has not been used since #837.
  • Loading branch information
ezimanyi authored Mar 13, 2019
1 parent 9b95c39 commit cebc935
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,14 @@ class OperationsController {
}
}

@Deprecated
private void decorateBuildInfo(Map trigger) {
if (trigger.master && trigger.job && trigger.buildNumber) {
// Echo now adds build information to the trigger before sending it to Orca, and manual triggers now default to
// going through echo (and thus receive build information). We still need this logic to populate build info for
// manual triggers when the 'triggerViaEcho' deck feature flag is off, or to handle users still hitting the old
// API endpoint manually, but we should short-circuit if we already have build info.
if (trigger.master && trigger.job && trigger.buildNumber && !trigger.buildInfo) {
log.info("Populating build information in Orca for trigger {}.", trigger)
def buildInfo
try {
buildInfo = buildService.getBuild(trigger.buildNumber, trigger.master, trigger.job)
Expand Down Expand Up @@ -299,10 +305,6 @@ class OperationsController {
}
}
}
} else if (trigger?.registry && trigger?.repository && trigger?.tag) {
trigger.buildInfo = [
taggedImages: [[registry: trigger.registry, repository: trigger.repository, tag: trigger.tag]]
]
}
}

Expand Down

0 comments on commit cebc935

Please sign in to comment.