Skip to content

Commit

Permalink
feat(notifier): Handle missing repository information
Browse files Browse the repository at this point in the history
Do not require repository information to be present, but invoke
`OrtRunService` to return fallback data if it is missing. That way the
Notifier can be executed for ORT runs in which the Analyzer has
failed.

Signed-off-by: Oliver Heger <[email protected]>
  • Loading branch information
oheger-bosch committed May 7, 2024
1 parent 79a7adc commit e6c6858
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ internal class NotifierOrtResultGenerator(
* Generate an [OrtResult] from the given [ortRun] object based on the given [notifierJob].
*/
fun generateOrtResult(ortRun: OrtRun, notifierJob: NotifierJob): OrtResult {
val repository = ortRunService.getOrtRepositoryInformation(ortRun)
val repository = ortRunService.getOrtRepositoryInformation(ortRun, failIfMissing = false)
val resolvedConfiguration = ortRunService.getResolvedConfiguration(ortRun)
val analyzerRun = ortRunService.getAnalyzerRunForOrtRun(ortRun.id)
val advisorRun = ortRunService.getAdvisorRunForOrtRun(ortRun.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ private class ResultGeneratorTestHelper {
every { getAdvisorRunForOrtRun(ORT_RUN_ID) } returns advisorRun
every { getAnalyzerRunForOrtRun(ORT_RUN_ID) } returns analyzerRun
every { getEvaluatorRunForOrtRun(ORT_RUN_ID) } returns evaluatorRun
every { getOrtRepositoryInformation(ortRun) } returns repository
every { getOrtRepositoryInformation(ortRun, failIfMissing = false) } returns repository
every { getOrtRun(ORT_RUN_ID) } returns ortRun
every { getNotifierJob(NOTIFIER_JOB_ID) } returns notifierJob
every { getResolvedConfiguration(ortRun) } returns resolvedConfig
Expand Down

0 comments on commit e6c6858

Please sign in to comment.