diff --git a/src/elm/Api/Operations.elm b/src/elm/Api/Operations.elm index 96d62acb5..8581a5ab3 100644 --- a/src/elm/Api/Operations.elm +++ b/src/elm/Api/Operations.elm @@ -20,6 +20,8 @@ module Api.Operations exposing , enableRepo , expandPipelineConfig , finishAuthentication + , getAllBuildServices + , getAllBuildSteps , getBuild , getBuildGraph , getBuildServiceLog @@ -681,6 +683,31 @@ getBuildSteps baseUrl session options = |> withAuth session +{-| getAllBuildSteps : retrieves all steps for a build. +-} +getAllBuildSteps : + String + -> Session + -> + { a + | org : String + , repo : String + , build : String + } + -> Request Vela.Step +getAllBuildSteps baseUrl session options = + get baseUrl + (Api.Endpoint.Steps + (Just 1) + (Just 100) + options.org + options.repo + options.build + ) + Vela.decodeStep + |> withAuth session + + {-| getBuildServices : retrieves services for a build. -} getBuildServices : @@ -708,6 +735,31 @@ getBuildServices baseUrl session options = |> withAuth session +{-| getAllBuildServices : retrieves all services for a build. +-} +getAllBuildServices : + String + -> Session + -> + { a + | org : String + , repo : String + , build : String + } + -> Request Vela.Service +getAllBuildServices baseUrl session options = + get baseUrl + (Api.Endpoint.Services + (Just 1) + (Just 100) + options.org + options.repo + options.build + ) + Vela.decodeService + |> withAuth session + + {-| getBuildStepLog : retrieves a log for a step. -} getBuildStepLog : diff --git a/src/elm/Effect.elm b/src/elm/Effect.elm index b841ead73..5a89b5b36 100644 --- a/src/elm/Effect.elm +++ b/src/elm/Effect.elm @@ -9,7 +9,7 @@ module Effect exposing , sendCmd, sendMsg , pushRoute, replaceRoute, loadExternalUrl , map, toCmd - , addAlertError, addAlertSuccess, addDeployment, addFavorites, addOrgSecret, addRepoSchedule, addRepoSecret, addSharedSecret, alertsUpdate, approveBuild, cancelBuild, chownRepo, clearRedirect, deleteOrgSecret, deleteRepoSchedule, deleteRepoSecret, deleteSharedSecret, disableRepo, downloadFile, enableRepo, expandPipelineConfig, finishAuthentication, focusOn, getBuild, getBuildGraph, getBuildServiceLog, getBuildServices, getBuildStepLog, getBuildSteps, getCurrentUser, getCurrentUserShared, getDashboard, getOrgBuilds, getOrgRepos, getOrgSecret, getOrgSecrets, getPipelineConfig, getPipelineTemplates, getRepo, getRepoBuilds, getRepoBuildsShared, getRepoDeployments, getRepoHooks, getRepoHooksShared, getRepoSchedule, getRepoSchedules, getRepoSecret, getRepoSecrets, getSettings, getSharedSecret, getSharedSecrets, getWorkers, handleHttpError, logout, pushPath, redeliverHook, repairRepo, replacePath, replaceRouteRemoveTabHistorySkipDomFocus, restartBuild, setRedirect, setTheme, updateFavicon, updateFavorite, updateOrgSecret, updateRepo, updateRepoHooksShared, updateRepoSchedule, updateRepoSecret, updateSettings, updateSharedSecret, updateSourceReposShared + , addAlertError, addAlertSuccess, addDeployment, addFavorites, addOrgSecret, addRepoSchedule, addRepoSecret, addSharedSecret, alertsUpdate, approveBuild, cancelBuild, chownRepo, clearRedirect, deleteOrgSecret, deleteRepoSchedule, deleteRepoSecret, deleteSharedSecret, disableRepo, downloadFile, enableRepo, expandPipelineConfig, finishAuthentication, focusOn, getAllBuildServices, getAllBuildSteps, getBuild, getBuildGraph, getBuildServiceLog, getBuildServices, getBuildStepLog, getBuildSteps, getCurrentUser, getCurrentUserShared, getDashboard, getOrgBuilds, getOrgRepos, getOrgSecret, getOrgSecrets, getPipelineConfig, getPipelineTemplates, getRepo, getRepoBuilds, getRepoBuildsShared, getRepoDeployments, getRepoHooks, getRepoHooksShared, getRepoSchedule, getRepoSchedules, getRepoSecret, getRepoSecrets, getSettings, getSharedSecret, getSharedSecrets, getWorkers, handleHttpError, logout, pushPath, redeliverHook, repairRepo, replacePath, replaceRouteRemoveTabHistorySkipDomFocus, restartBuild, setRedirect, setTheme, updateFavicon, updateFavorite, updateOrgSecret, updateRepo, updateRepoHooksShared, updateRepoSchedule, updateRepoSecret, updateSettings, updateSharedSecret, updateSourceReposShared ) {-| @@ -796,6 +796,26 @@ getBuildSteps options = |> sendCmd +getAllBuildSteps : + { baseUrl : String + , session : Auth.Session.Session + , onResponse : Result (Http.Detailed.Error String) ( Http.Metadata, List Vela.Step ) -> msg + , org : String + , repo : String + , build : String + } + -> Effect msg +getAllBuildSteps options = + Api.tryAll + options.onResponse + (Api.Operations.getAllBuildSteps + options.baseUrl + options.session + options + ) + |> sendCmd + + getBuildServices : { baseUrl : String , session : Auth.Session.Session @@ -818,6 +838,26 @@ getBuildServices options = |> sendCmd +getAllBuildServices : + { baseUrl : String + , session : Auth.Session.Session + , onResponse : Result (Http.Detailed.Error String) ( Http.Metadata, List Vela.Service ) -> msg + , org : String + , repo : String + , build : String + } + -> Effect msg +getAllBuildServices options = + Api.tryAll + options.onResponse + (Api.Operations.getAllBuildServices + options.baseUrl + options.session + options + ) + |> sendCmd + + getBuildStepLog : { baseUrl : String , session : Auth.Session.Session diff --git a/src/elm/Pages/Org_/Repo_/Build_.elm b/src/elm/Pages/Org_/Repo_/Build_.elm index 91b751220..6546e87c2 100644 --- a/src/elm/Pages/Org_/Repo_/Build_.elm +++ b/src/elm/Pages/Org_/Repo_/Build_.elm @@ -195,7 +195,7 @@ init shared route () = , logFollow = 0 } , Effect.batch - [ Effect.getBuildSteps + [ Effect.getAllBuildSteps { baseUrl = shared.velaAPIBaseURL , session = shared.session , onResponse = @@ -206,8 +206,6 @@ init shared route () = |> Maybe.withDefault "false" |> (==) "false" } - , pageNumber = Nothing - , perPage = Just 100 , org = route.params.org , repo = route.params.repo , build = route.params.build @@ -625,12 +623,10 @@ update shared route msg model = runEffect = if isAnyStepRunning then - Effect.getBuildSteps + Effect.getAllBuildSteps { baseUrl = shared.velaAPIBaseURL , session = shared.session , onResponse = GetBuildStepsRefreshResponse - , pageNumber = Nothing - , perPage = Just 100 , org = route.params.org , repo = route.params.repo , build = route.params.build diff --git a/src/elm/Pages/Org_/Repo_/Build_/Services.elm b/src/elm/Pages/Org_/Repo_/Build_/Services.elm index 67249ab72..2933502d0 100644 --- a/src/elm/Pages/Org_/Repo_/Build_/Services.elm +++ b/src/elm/Pages/Org_/Repo_/Build_/Services.elm @@ -195,12 +195,10 @@ init shared route () = , logFollow = 0 } , Effect.batch - [ Effect.getBuildServices + [ Effect.getAllBuildServices { baseUrl = shared.velaAPIBaseURL , session = shared.session , onResponse = GetBuildServicesResponse - , pageNumber = Nothing - , perPage = Just 100 , org = route.params.org , repo = route.params.repo , build = route.params.build @@ -617,12 +615,10 @@ update shared route msg model = runEffect = if isAnyServiceRunning then - Effect.getBuildServices + Effect.getAllBuildServices { baseUrl = shared.velaAPIBaseURL , session = shared.session , onResponse = GetBuildServicesRefreshResponse - , pageNumber = Nothing - , perPage = Just 100 , org = route.params.org , repo = route.params.repo , build = route.params.build diff --git a/src/elm/Vela.elm b/src/elm/Vela.elm index 08c9bf11f..d7e91d96d 100644 --- a/src/elm/Vela.elm +++ b/src/elm/Vela.elm @@ -74,9 +74,11 @@ module Vela exposing , decodeSchedules , decodeSecret , decodeSecrets + , decodeService , decodeServices , decodeSettings , decodeSourceRepositories + , decodeStep , decodeSteps , decodeUser , decodeWorkers