hercules-ci-api 0.7.1.0 → 0.7.2.0
raw patch · 17 files changed
+241/−70 lines, 17 filesdep ~aesonPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: aeson
API changes (from Hackage documentation)
- Hercules.API.Projects: [projectJobs] :: ProjectsAPI auth f -> f :- (Summary "List all jobs in a project" :> (Description "A list of a project's revisions and their details and status." :> ("projects" :> (Capture' '[Required, Strict] "project" (Id Project) :> ("jobs" :> (auth :> Get '[JSON] [Job]))))))
- Hercules.API.Projects.Job: instance Control.DeepSeq.NFData Hercules.API.Projects.Job.JobPhase
- Hercules.API.Projects.Job: instance Control.DeepSeq.NFData Hercules.API.Projects.Job.JobStatus
- Hercules.API.Projects.Job: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Projects.Job.JobPhase
- Hercules.API.Projects.Job: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Projects.Job.JobStatus
- Hercules.API.Projects.Job: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Projects.Job.JobPhase
- Hercules.API.Projects.Job: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Projects.Job.JobStatus
- Hercules.API.Projects.Job: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Projects.Job.JobPhase
- Hercules.API.Projects.Job: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Projects.Job.JobStatus
- Hercules.API.Projects.Job: instance GHC.Base.Monoid Hercules.API.Projects.Job.JobStatus
- Hercules.API.Projects.Job: instance GHC.Base.Semigroup Hercules.API.Projects.Job.JobStatus
- Hercules.API.Projects.Job: instance GHC.Classes.Eq Hercules.API.Projects.Job.JobPhase
- Hercules.API.Projects.Job: instance GHC.Classes.Eq Hercules.API.Projects.Job.JobStatus
- Hercules.API.Projects.Job: instance GHC.Generics.Generic Hercules.API.Projects.Job.JobPhase
- Hercules.API.Projects.Job: instance GHC.Generics.Generic Hercules.API.Projects.Job.JobStatus
- Hercules.API.Projects.Job: instance GHC.Show.Show Hercules.API.Projects.Job.JobPhase
- Hercules.API.Projects.Job: instance GHC.Show.Show Hercules.API.Projects.Job.JobStatus
+ Hercules.API.Inputs.ImmutableGitInput: ImmutableGitInput :: Text -> Text -> Text -> Text -> Maybe SimpleRepo -> Maybe [SimpleJob] -> Maybe Text -> ImmutableGitInput
+ Hercules.API.Inputs.ImmutableGitInput: [historyURL] :: ImmutableGitInput -> Maybe Text
+ Hercules.API.Inputs.ImmutableGitInput: [httpURL] :: ImmutableGitInput -> Text
+ Hercules.API.Inputs.ImmutableGitInput: [jobs] :: ImmutableGitInput -> Maybe [SimpleJob]
+ Hercules.API.Inputs.ImmutableGitInput: [ref] :: ImmutableGitInput -> Text
+ Hercules.API.Inputs.ImmutableGitInput: [repo] :: ImmutableGitInput -> Maybe SimpleRepo
+ Hercules.API.Inputs.ImmutableGitInput: [rev] :: ImmutableGitInput -> Text
+ Hercules.API.Inputs.ImmutableGitInput: [sshURL] :: ImmutableGitInput -> Text
+ Hercules.API.Inputs.ImmutableGitInput: data ImmutableGitInput
+ Hercules.API.Inputs.ImmutableGitInput: instance Control.DeepSeq.NFData Hercules.API.Inputs.ImmutableGitInput.ImmutableGitInput
+ Hercules.API.Inputs.ImmutableGitInput: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Inputs.ImmutableGitInput.ImmutableGitInput
+ Hercules.API.Inputs.ImmutableGitInput: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Inputs.ImmutableGitInput.ImmutableGitInput
+ Hercules.API.Inputs.ImmutableGitInput: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Inputs.ImmutableGitInput.ImmutableGitInput
+ Hercules.API.Inputs.ImmutableGitInput: instance GHC.Classes.Eq Hercules.API.Inputs.ImmutableGitInput.ImmutableGitInput
+ Hercules.API.Inputs.ImmutableGitInput: instance GHC.Generics.Generic Hercules.API.Inputs.ImmutableGitInput.ImmutableGitInput
+ Hercules.API.Inputs.ImmutableGitInput: instance GHC.Show.Show Hercules.API.Inputs.ImmutableGitInput.ImmutableGitInput
+ Hercules.API.Inputs.ImmutableInput: GitInput :: ImmutableGitInput -> ImmutableInput
+ Hercules.API.Inputs.ImmutableInput: IgnoreMe :: () -> ImmutableInput
+ Hercules.API.Inputs.ImmutableInput: data ImmutableInput
+ Hercules.API.Inputs.ImmutableInput: instance Control.DeepSeq.NFData Hercules.API.Inputs.ImmutableInput.ImmutableInput
+ Hercules.API.Inputs.ImmutableInput: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Inputs.ImmutableInput.ImmutableInput
+ Hercules.API.Inputs.ImmutableInput: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Inputs.ImmutableInput.ImmutableInput
+ Hercules.API.Inputs.ImmutableInput: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Inputs.ImmutableInput.ImmutableInput
+ Hercules.API.Inputs.ImmutableInput: instance GHC.Classes.Eq Hercules.API.Inputs.ImmutableInput.ImmutableInput
+ Hercules.API.Inputs.ImmutableInput: instance GHC.Generics.Generic Hercules.API.Inputs.ImmutableInput.ImmutableInput
+ Hercules.API.Inputs.ImmutableInput: instance GHC.Show.Show Hercules.API.Inputs.ImmutableInput.ImmutableInput
+ Hercules.API.Paging: PagedResponse :: [a] -> Bool -> PagedResponse a
+ Hercules.API.Paging: [items] :: PagedResponse a -> [a]
+ Hercules.API.Paging: [more] :: PagedResponse a -> Bool
+ Hercules.API.Paging: data PagedResponse a
+ Hercules.API.Paging: instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Hercules.API.Paging.PagedResponse a)
+ Hercules.API.Paging: instance Data.Aeson.Types.FromJSON.FromJSON a => Data.Aeson.Types.FromJSON.FromJSON (Hercules.API.Paging.PagedResponse a)
+ Hercules.API.Paging: instance Data.Aeson.Types.ToJSON.ToJSON a => Data.Aeson.Types.ToJSON.ToJSON (Hercules.API.Paging.PagedResponse a)
+ Hercules.API.Paging: instance Data.Swagger.Internal.Schema.ToSchema a => Data.Swagger.Internal.Schema.ToSchema (Hercules.API.Paging.PagedResponse a)
+ Hercules.API.Paging: instance GHC.Classes.Eq a => GHC.Classes.Eq (Hercules.API.Paging.PagedResponse a)
+ Hercules.API.Paging: instance GHC.Generics.Generic (Hercules.API.Paging.PagedResponse a)
+ Hercules.API.Paging: instance GHC.Show.Show a => GHC.Show.Show (Hercules.API.Paging.PagedResponse a)
+ Hercules.API.Projects: PagedJobs :: PagedResponse Job -> PagedJobs
+ Hercules.API.Projects: ProjectResourceGroup :: (f :- (Summary "Retrieve information about jobs" :> ("jobs" :> (QueryParam' '[Optional, Description "Constrain the results by git ref, such as refs/heads/my-branch or HEAD"] "ref" Text :> (QueryParam' '[Optional, Description "Only return successful jobs, or only failed ones"] "success" Bool :> (QueryParam' '[Optional, Description "Return jobs that come \"after\" the provided id in the response order."] "offsetId" (Id Job) :> (auth :> Get '[JSON] PagedJobs))))))) -> (f :- (Summary "Get source information from the latest successful job/jobs satisfying the provided requirements." :> (Description "The job parameter can be omitted to require all jobs for a commit to succeed. This can have the unexpected effect of reverting when a change in the extraInputs causes a regression. So it is recommended to specify one or more jobs. Common examples are \"onPush.default\" for a pinned build or \"onPush.ci\" for a build using extraInputs to integrate continuously." :> ("source" :> (QueryParam' '[Optional, Description "Constrain the results by git ref, such as refs/heads/my-branch. Defaults to HEAD."] "ref" Text :> (QueryParams "jobs" Text :> (auth :> Get '[JSON] ImmutableGitInput))))))) -> ProjectResourceGroup auth f
+ Hercules.API.Projects: [byProjectId] :: ProjectsAPI auth f -> f :- Substitute ("projects" :> (Capture' '[Required, Strict] "projectId" (Id Project) :> Placeholder)) (ToServantApi (ProjectResourceGroup auth))
+ Hercules.API.Projects: [byProjectName] :: ProjectsAPI auth f -> f :- Substitute ("site" :> (Capture' '[Required, Strict] "site" (Name SourceHostingSite) :> ("account" :> (Capture' '[Required, Strict] "account" (Name Account) :> ("project" :> (Capture' '[Required, Strict] "project" (Name Project) :> Placeholder)))))) (ToServantApi (ProjectResourceGroup auth))
+ Hercules.API.Projects: [getJobSource] :: ProjectResourceGroup auth f -> f :- (Summary "Get source information from the latest successful job/jobs satisfying the provided requirements." :> (Description "The job parameter can be omitted to require all jobs for a commit to succeed. This can have the unexpected effect of reverting when a change in the extraInputs causes a regression. So it is recommended to specify one or more jobs. Common examples are \"onPush.default\" for a pinned build or \"onPush.ci\" for a build using extraInputs to integrate continuously." :> ("source" :> (QueryParam' '[Optional, Description "Constrain the results by git ref, such as refs/heads/my-branch. Defaults to HEAD."] "ref" Text :> (QueryParams "jobs" Text :> (auth :> Get '[JSON] ImmutableGitInput))))))
+ Hercules.API.Projects: [getJobs] :: ProjectResourceGroup auth f -> f :- (Summary "Retrieve information about jobs" :> ("jobs" :> (QueryParam' '[Optional, Description "Constrain the results by git ref, such as refs/heads/my-branch or HEAD"] "ref" Text :> (QueryParam' '[Optional, Description "Only return successful jobs, or only failed ones"] "success" Bool :> (QueryParam' '[Optional, Description "Return jobs that come \"after\" the provided id in the response order."] "offsetId" (Id Job) :> (auth :> Get '[JSON] PagedJobs))))))
+ Hercules.API.Projects: data ProjectResourceGroup auth f
+ Hercules.API.Projects: instance Control.DeepSeq.NFData Hercules.API.Projects.PagedJobs
+ Hercules.API.Projects: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Projects.PagedJobs
+ Hercules.API.Projects: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Projects.PagedJobs
+ Hercules.API.Projects: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Projects.PagedJobs
+ Hercules.API.Projects: instance GHC.Classes.Eq Hercules.API.Projects.PagedJobs
+ Hercules.API.Projects: instance GHC.Generics.Generic (Hercules.API.Projects.ProjectResourceGroup auth f)
+ Hercules.API.Projects: instance GHC.Generics.Generic Hercules.API.Projects.PagedJobs
+ Hercules.API.Projects: instance GHC.Show.Show Hercules.API.Projects.PagedJobs
+ Hercules.API.Projects: newtype PagedJobs
+ Hercules.API.Projects.Job: Config :: JobType
+ Hercules.API.Projects.Job: Legacy :: JobType
+ Hercules.API.Projects.Job: OnPush :: JobType
+ Hercules.API.Projects.Job: [extraInputs] :: Job -> Map Text ImmutableInput
+ Hercules.API.Projects.Job: [jobName] :: Job -> Maybe Text
+ Hercules.API.Projects.Job: [jobType] :: Job -> JobType
+ Hercules.API.Projects.Job: data JobType
+ Hercules.API.Projects.Job: instance Control.DeepSeq.NFData Hercules.API.Projects.Job.JobType
+ Hercules.API.Projects.Job: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Projects.Job.JobType
+ Hercules.API.Projects.Job: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Projects.Job.JobType
+ Hercules.API.Projects.Job: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Projects.Job.JobType
+ Hercules.API.Projects.Job: instance GHC.Classes.Eq Hercules.API.Projects.Job.JobType
+ Hercules.API.Projects.Job: instance GHC.Generics.Generic Hercules.API.Projects.Job.JobType
+ Hercules.API.Projects.Job: instance GHC.Show.Show Hercules.API.Projects.Job.JobType
+ Hercules.API.Projects.SimpleJob: Building :: JobPhase
+ Hercules.API.Projects.SimpleJob: Done :: JobPhase
+ Hercules.API.Projects.SimpleJob: Effects :: JobPhase
+ Hercules.API.Projects.SimpleJob: Evaluating :: JobPhase
+ Hercules.API.Projects.SimpleJob: Failure :: JobStatus
+ Hercules.API.Projects.SimpleJob: Pending :: JobStatus
+ Hercules.API.Projects.SimpleJob: Queued :: JobPhase
+ Hercules.API.Projects.SimpleJob: Success :: JobStatus
+ Hercules.API.Projects.SimpleJob: [phase] :: SimpleJob -> JobPhase
+ Hercules.API.Projects.SimpleJob: [status] :: SimpleJob -> JobStatus
+ Hercules.API.Projects.SimpleJob: data JobPhase
+ Hercules.API.Projects.SimpleJob: data JobStatus
+ Hercules.API.Projects.SimpleJob: instance Control.DeepSeq.NFData Hercules.API.Projects.SimpleJob.JobPhase
+ Hercules.API.Projects.SimpleJob: instance Control.DeepSeq.NFData Hercules.API.Projects.SimpleJob.JobStatus
+ Hercules.API.Projects.SimpleJob: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Projects.SimpleJob.JobPhase
+ Hercules.API.Projects.SimpleJob: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Projects.SimpleJob.JobStatus
+ Hercules.API.Projects.SimpleJob: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Projects.SimpleJob.JobPhase
+ Hercules.API.Projects.SimpleJob: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Projects.SimpleJob.JobStatus
+ Hercules.API.Projects.SimpleJob: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Projects.SimpleJob.JobPhase
+ Hercules.API.Projects.SimpleJob: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Projects.SimpleJob.JobStatus
+ Hercules.API.Projects.SimpleJob: instance GHC.Base.Monoid Hercules.API.Projects.SimpleJob.JobStatus
+ Hercules.API.Projects.SimpleJob: instance GHC.Base.Semigroup Hercules.API.Projects.SimpleJob.JobStatus
+ Hercules.API.Projects.SimpleJob: instance GHC.Classes.Eq Hercules.API.Projects.SimpleJob.JobPhase
+ Hercules.API.Projects.SimpleJob: instance GHC.Classes.Eq Hercules.API.Projects.SimpleJob.JobStatus
+ Hercules.API.Projects.SimpleJob: instance GHC.Generics.Generic Hercules.API.Projects.SimpleJob.JobPhase
+ Hercules.API.Projects.SimpleJob: instance GHC.Generics.Generic Hercules.API.Projects.SimpleJob.JobStatus
+ Hercules.API.Projects.SimpleJob: instance GHC.Show.Show Hercules.API.Projects.SimpleJob.JobPhase
+ Hercules.API.Projects.SimpleJob: instance GHC.Show.Show Hercules.API.Projects.SimpleJob.JobStatus
+ Hercules.API.Projects.SimpleProject: SimpleProject :: Id Project -> Name Project -> SimpleAccount -> Text -> Maybe Text -> Bool -> SimpleProject
+ Hercules.API.Projects.SimpleProject: [displayName] :: SimpleProject -> Text
+ Hercules.API.Projects.SimpleProject: [id] :: SimpleProject -> Id Project
+ Hercules.API.Projects.SimpleProject: [imageURL] :: SimpleProject -> Maybe Text
+ Hercules.API.Projects.SimpleProject: [isPublic] :: SimpleProject -> Bool
+ Hercules.API.Projects.SimpleProject: [name] :: SimpleProject -> Name Project
+ Hercules.API.Projects.SimpleProject: [owner] :: SimpleProject -> SimpleAccount
+ Hercules.API.Projects.SimpleProject: data SimpleProject
+ Hercules.API.Projects.SimpleProject: instance Control.DeepSeq.NFData Hercules.API.Projects.SimpleProject.SimpleProject
+ Hercules.API.Projects.SimpleProject: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Projects.SimpleProject.SimpleProject
+ Hercules.API.Projects.SimpleProject: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Projects.SimpleProject.SimpleProject
+ Hercules.API.Projects.SimpleProject: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Projects.SimpleProject.SimpleProject
+ Hercules.API.Projects.SimpleProject: instance GHC.Classes.Eq Hercules.API.Projects.SimpleProject.SimpleProject
+ Hercules.API.Projects.SimpleProject: instance GHC.Generics.Generic Hercules.API.Projects.SimpleProject.SimpleProject
+ Hercules.API.Projects.SimpleProject: instance GHC.Show.Show Hercules.API.Projects.SimpleProject.SimpleProject
+ Hercules.API.Repos.Repo: [defaultBranch] :: Repo -> Maybe Text
+ Hercules.API.Repos.Repo: [httpURL] :: Repo -> Text
+ Hercules.API.Repos.Repo: [sshURL] :: Repo -> Text
+ Hercules.API.Repos.SimpleRepo: SimpleRepo :: Id Repo -> Name Repo -> SimpleAccount -> Text -> Maybe Text -> Bool -> SimpleRepo
+ Hercules.API.Repos.SimpleRepo: [displayName] :: SimpleRepo -> Text
+ Hercules.API.Repos.SimpleRepo: [id] :: SimpleRepo -> Id Repo
+ Hercules.API.Repos.SimpleRepo: [imageURL] :: SimpleRepo -> Maybe Text
+ Hercules.API.Repos.SimpleRepo: [isPublic] :: SimpleRepo -> Bool
+ Hercules.API.Repos.SimpleRepo: [name] :: SimpleRepo -> Name Repo
+ Hercules.API.Repos.SimpleRepo: [owner] :: SimpleRepo -> SimpleAccount
+ Hercules.API.Repos.SimpleRepo: data SimpleRepo
+ Hercules.API.Repos.SimpleRepo: instance Control.DeepSeq.NFData Hercules.API.Repos.SimpleRepo.SimpleRepo
+ Hercules.API.Repos.SimpleRepo: instance Data.Aeson.Types.FromJSON.FromJSON Hercules.API.Repos.SimpleRepo.SimpleRepo
+ Hercules.API.Repos.SimpleRepo: instance Data.Aeson.Types.ToJSON.ToJSON Hercules.API.Repos.SimpleRepo.SimpleRepo
+ Hercules.API.Repos.SimpleRepo: instance Data.Swagger.Internal.Schema.ToSchema Hercules.API.Repos.SimpleRepo.SimpleRepo
+ Hercules.API.Repos.SimpleRepo: instance GHC.Classes.Eq Hercules.API.Repos.SimpleRepo.SimpleRepo
+ Hercules.API.Repos.SimpleRepo: instance GHC.Generics.Generic Hercules.API.Repos.SimpleRepo.SimpleRepo
+ Hercules.API.Repos.SimpleRepo: instance GHC.Show.Show Hercules.API.Repos.SimpleRepo.SimpleRepo
- Hercules.API: enterApiE :: forall k subapi api mode (a :: k). (GenericServant (api a) mode, GenericServant (subapi a) mode) => api a mode -> (api a mode -> ToServant (subapi a) mode) -> subapi a mode
+ Hercules.API: enterApiE :: forall {k} subapi api mode (a :: k). (GenericServant (api a) mode, GenericServant (subapi a) mode) => api a mode -> (api a mode -> ToServant (subapi a) mode) -> subapi a mode
- Hercules.API.Accounts: accountByAuth' :: (GenericMode f, Generic (subapi auth f), GServantProduct (Rep (subapi auth f)), (f :- ("accounts" :> ("me" :> (((Summary "Get the account." :> (auth :> Get '[JSON] Account)) :<|> (Summary "Get the account settings." :> ("settings" :> (auth :> Get '[JSON] AccountSettings)))) :<|> ((Summary "Update the account settings." :> ("settings" :> (ReqBody '[JSON] AccountSettingsPatch :> (auth :> Patch '[JSON] AccountSettings)))) :<|> (Summary "Disable all projects in the account." :> ("disable-all-projects" :> (auth :> Post '[JSON] Int)))))))) ~ GToServant (Rep (subapi auth f))) => AccountsAPI auth f -> subapi auth f
+ Hercules.API.Accounts: accountByAuth' :: (GenericMode mode, Generic (subapi a mode), GServantProduct (Rep (subapi a mode)), (mode :- ("accounts" :> ("me" :> (((Summary "Get the account." :> (a :> Get '[JSON] Account)) :<|> (Summary "Get the account settings." :> ("settings" :> (a :> Get '[JSON] AccountSettings)))) :<|> ((Summary "Update the account settings." :> ("settings" :> (ReqBody '[JSON] AccountSettingsPatch :> (a :> Patch '[JSON] AccountSettings)))) :<|> (Summary "Disable all projects in the account." :> ("disable-all-projects" :> (a :> Post '[JSON] Int)))))))) ~ GToServant (Rep (subapi a mode))) => AccountsAPI a mode -> subapi a mode
- Hercules.API.Accounts.SimpleAccount: SimpleAccount :: Id Account -> Text -> Text -> AccountType -> Text -> SimpleSite -> SimpleAccount
+ Hercules.API.Accounts.SimpleAccount: SimpleAccount :: Id Account -> Name Account -> Text -> AccountType -> Text -> SimpleSite -> SimpleAccount
- Hercules.API.Accounts.SimpleAccount: [name] :: SimpleAccount -> Text
+ Hercules.API.Accounts.SimpleAccount: [name] :: SimpleAccount -> Name Account
- Hercules.API.Projects: ProjectsAPI :: (f :- (Summary "List all projects owned by an account." :> ("accounts" :> (Capture' '[Required, Strict] "accountId" (Id Account) :> ("projects" :> (auth :> Get '[JSON] [Project])))))) -> (f :- (Summary "Find projects" :> ("projects" :> (QueryParam' '[Optional] "site" (Name SourceHostingSite) :> (QueryParam' '[Optional] "account" (Name Account) :> (QueryParam' '[Optional] "project" (Name Project) :> (auth :> Get '[JSON] [Project]))))))) -> (f :- (Summary "Create a new project." :> ("projects" :> (auth :> (ReqBody '[JSON] CreateProject :> Post '[JSON] (Id Project)))))) -> (f :- (Summary "Modify a project" :> ("projects" :> (Capture' '[Required, Strict] "projectId" (Id Project) :> (ReqBody '[JSON] PatchProject :> (auth :> Patch '[JSON] Project)))))) -> (f :- (Summary "Create a token for local effect execution" :> ("projects" :> (Capture' '[Required, Strict] "projectId" (Id Project) :> (auth :> ("create-user-effect-token" :> Post '[JSON] CreateUserEffectTokenResponse)))))) -> (f :- (Summary "List all jobs in a project" :> (Description "A list of a project's revisions and their details and status." :> ("projects" :> (Capture' '[Required, Strict] "project" (Id Project) :> ("jobs" :> (auth :> Get '[JSON] [Job]))))))) -> (f :- (Summary "Find jobs" :> ("jobs" :> (QueryParam' '[Optional, Description "Currently only \"github\" or omit entirely"] "site" (Name SourceHostingSite) :> (QueryParam' '[Optional, Description "Account name filter"] "account" (Name Account) :> (QueryParam' '[Optional, Description "Project name filter. Required if you want to retrieve all jobs"] "project" (Name Project) :> (QueryParam' '[Optional, Description "To get a specific job by index"] "index" Int :> (QueryParam' '[Optional, Description "Number of latest jobs to get, when project name is omitted. Range [1..50], default 10."] "latest" Int :> (auth :> Get '[JSON] [ProjectAndJobs]))))))))) -> (f :- (Summary "List all attributes in a job" :> (Description "A list of all attributes that have been produced as part of the evaluation of a job." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("evaluation" :> (auth :> Get '[JSON] EvaluationDetail))))))) -> (f :- (Summary "Find all failures in an evaluation's derivations" :> (Description "Returns all derivations that have failures in their dependency closures." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("derivations" :> ("failed" :> (auth :> Get '[JSON] Graph)))))))) -> (f :- (Summary "Create a new job like this job" :> (Description "The newly created job will be in the same project, have the same inputs but a new evaluation. The response has the newly created job." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("rerun" :> (QueryParam "rebuildFailures" Bool :> (auth :> Post '[JSON] Job)))))))) -> (f :- (Summary "Cancel the job and any work that becomes redundant" :> (Description "Some derivations may keep going, if referenced by active jobs." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("cancel" :> (auth :> Post '[JSON] NoContent))))))) -> (f :- (Summary "Read all recorded evaluation log entries" :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("evaluation" :> ("log" :> ("lines" :> (QueryParam' '[Required] "logId" (Id "log") :> (QueryParam' '[Optional] "iMin" Int :> (auth :> Get '[JSON] Log)))))))))) -> ProjectsAPI auth f
+ Hercules.API.Projects: ProjectsAPI :: (f :- Substitute ("projects" :> (Capture' '[Required, Strict] "projectId" (Id Project) :> Placeholder)) (ToServantApi (ProjectResourceGroup auth))) -> (f :- Substitute ("site" :> (Capture' '[Required, Strict] "site" (Name SourceHostingSite) :> ("account" :> (Capture' '[Required, Strict] "account" (Name Account) :> ("project" :> (Capture' '[Required, Strict] "project" (Name Project) :> Placeholder)))))) (ToServantApi (ProjectResourceGroup auth))) -> (f :- (Summary "List all projects owned by an account." :> ("accounts" :> (Capture' '[Required, Strict] "accountId" (Id Account) :> ("projects" :> (auth :> Get '[JSON] [Project])))))) -> (f :- (Summary "Find projects" :> ("projects" :> (QueryParam' '[Optional] "site" (Name SourceHostingSite) :> (QueryParam' '[Optional] "account" (Name Account) :> (QueryParam' '[Optional] "project" (Name Project) :> (auth :> Get '[JSON] [Project]))))))) -> (f :- (Summary "Create a new project." :> ("projects" :> (auth :> (ReqBody '[JSON] CreateProject :> Post '[JSON] (Id Project)))))) -> (f :- (Summary "Modify a project" :> ("projects" :> (Capture' '[Required, Strict] "projectId" (Id Project) :> (ReqBody '[JSON] PatchProject :> (auth :> Patch '[JSON] Project)))))) -> (f :- (Summary "Create a token for local effect execution" :> ("projects" :> (Capture' '[Required, Strict] "projectId" (Id Project) :> (auth :> ("create-user-effect-token" :> Post '[JSON] CreateUserEffectTokenResponse)))))) -> (f :- (Summary "Find jobs" :> ("jobs" :> (QueryParam' '[Optional, Description "Currently only \"github\" or omit entirely"] "site" (Name SourceHostingSite) :> (QueryParam' '[Optional, Description "Account name filter"] "account" (Name Account) :> (QueryParam' '[Optional, Description "Project name filter. Required if you want to retrieve all jobs"] "project" (Name Project) :> (QueryParam' '[Optional, Description "To get a specific job by index"] "index" Int :> (QueryParam' '[Optional, Description "Number of latest jobs to get, when project name is omitted. Range [1..50], default 10."] "latest" Int :> (auth :> Get '[JSON] [ProjectAndJobs]))))))))) -> (f :- (Summary "List all attributes in a job" :> (Description "A list of all attributes that have been produced as part of the evaluation of a job." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("evaluation" :> (auth :> Get '[JSON] EvaluationDetail))))))) -> (f :- (Summary "Find all failures in an evaluation's derivations" :> (Description "Returns all derivations that have failures in their dependency closures." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("derivations" :> ("failed" :> (auth :> Get '[JSON] Graph)))))))) -> (f :- (Summary "Create a new job like this job" :> (Description "The newly created job will be in the same project, have the same inputs but a new evaluation.\ \ The response has the newly created job." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("rerun" :> (QueryParam "rebuildFailures" Bool :> (auth :> Post '[JSON] Job)))))))) -> (f :- (Summary "Cancel the job and any work that becomes redundant" :> (Description "Some derivations may keep going, if referenced by active jobs." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("cancel" :> (auth :> Post '[JSON] NoContent))))))) -> (f :- (Summary "Read all recorded evaluation log entries" :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("evaluation" :> ("log" :> ("lines" :> (QueryParam' '[Required] "logId" (Id "log") :> (QueryParam' '[Optional] "iMin" Int :> (auth :> Get '[JSON] Log)))))))))) -> ProjectsAPI auth f
- Hercules.API.Projects: [jobRerun] :: ProjectsAPI auth f -> f :- (Summary "Create a new job like this job" :> (Description "The newly created job will be in the same project, have the same inputs but a new evaluation. The response has the newly created job." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("rerun" :> (QueryParam "rebuildFailures" Bool :> (auth :> Post '[JSON] Job)))))))
+ Hercules.API.Projects: [jobRerun] :: ProjectsAPI auth f -> f :- (Summary "Create a new job like this job" :> (Description "The newly created job will be in the same project, have the same inputs but a new evaluation.\ \ The response has the newly created job." :> ("jobs" :> (Capture' '[Required, Strict] "jobId" (Id Job) :> ("rerun" :> (QueryParam "rebuildFailures" Bool :> (auth :> Post '[JSON] Job)))))))
- Hercules.API.Projects.Job: Job :: Id Job -> Id Project -> Int64 -> Id Repo -> UTCTime -> Maybe UTCTime -> JobPhase -> Bool -> JobStatus -> JobStatus -> JobStatus -> JobStatus -> Id Evaluation -> GitCommitSource -> Maybe (Id Job) -> Maybe Int -> Maybe (Id Account) -> Maybe (Id Account) -> Bool -> Bool -> Job
+ Hercules.API.Projects.Job: Job :: Id Job -> Id Project -> Int64 -> Id Repo -> UTCTime -> Maybe UTCTime -> JobPhase -> Bool -> JobStatus -> JobStatus -> JobStatus -> JobStatus -> Id Evaluation -> GitCommitSource -> Map Text ImmutableInput -> JobType -> Maybe Text -> Maybe (Id Job) -> Maybe Int -> Maybe (Id Account) -> Maybe (Id Account) -> Bool -> Bool -> Job
- Hercules.API.Projects.SimpleJob: SimpleJob :: Id Job -> Project -> Int64 -> SimpleJob
+ Hercules.API.Projects.SimpleJob: SimpleJob :: Id "Job" -> SimpleProject -> Int64 -> JobStatus -> JobPhase -> SimpleJob
- Hercules.API.Projects.SimpleJob: [id] :: SimpleJob -> Id Job
+ Hercules.API.Projects.SimpleJob: [id] :: SimpleJob -> Id "Job"
- Hercules.API.Projects.SimpleJob: [project] :: SimpleJob -> Project
+ Hercules.API.Projects.SimpleJob: [project] :: SimpleJob -> SimpleProject
- Hercules.API.Repos.Repo: Repo :: Id Repo -> Id Account -> Text -> Text -> Text -> Maybe Text -> Bool -> Bool -> Bool -> Repo
+ Hercules.API.Repos.Repo: Repo :: Id Repo -> Id Account -> Text -> Text -> Text -> Maybe Text -> Bool -> Maybe Text -> Text -> Text -> Bool -> Bool -> Repo
Files
- CHANGELOG.md +11/−0
- hercules-ci-api.cabal +7/−2
- src/Hercules/API/Accounts/SimpleAccount.hs +1/−1
- src/Hercules/API/Agents/AgentSession.hs +0/−1
- src/Hercules/API/Attribute.hs +0/−1
- src/Hercules/API/Build/DerivationEvent.hs +10/−11
- src/Hercules/API/Effects/EffectEvent.hs +6/−7
- src/Hercules/API/Inputs/ImmutableGitInput.hs +18/−0
- src/Hercules/API/Inputs/ImmutableInput.hs +26/−0
- src/Hercules/API/Labels.hs +1/−2
- src/Hercules/API/Paging.hs +18/−0
- src/Hercules/API/Projects.hs +47/−9
- src/Hercules/API/Projects/Job.hs +18/−31
- src/Hercules/API/Projects/SimpleJob.hs +37/−5
- src/Hercules/API/Projects/SimpleProject.hs +21/−0
- src/Hercules/API/Repos/Repo.hs +3/−0
- src/Hercules/API/Repos/SimpleRepo.hs +17/−0
CHANGELOG.md view
@@ -5,6 +5,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.7.2.0] - 2022-03-15++### Added++ - Add getJobSource to resolve extraInputs in hci+ - `PagedResponse`+ - `SimpleProject`+ - `SimpleRepo`+ - `ImmutableGitInput`+ - `JobType`+ ## [0.7.1.0] - 2021-09-06 ### Added
hercules-ci-api.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.12 name: hercules-ci-api-version: 0.7.1.0+version: 0.7.2.0 synopsis: Hercules CI API definition with Servant homepage: https://github.com/hercules-ci/hercules-ci-agent#readme bug-reports: https://github.com/hercules-ci/hercules-ci-agent/issues@@ -60,6 +60,8 @@ Hercules.API.Evaluation.AttributeError Hercules.API.Evaluation.Evaluation Hercules.API.Health+ Hercules.API.Inputs.ImmutableGitInput+ Hercules.API.Inputs.ImmutableInput Hercules.API.Labels Hercules.API.Message Hercules.API.Organizations@@ -68,6 +70,7 @@ Hercules.API.Organizations.Organization Hercules.API.Organizations.PaymentLink Hercules.API.Orphans+ Hercules.API.Paging Hercules.API.Projects Hercules.API.Projects.CreateProject Hercules.API.Projects.CreateUserEffectTokenResponse@@ -75,9 +78,11 @@ Hercules.API.Projects.PatchProject Hercules.API.Projects.Project Hercules.API.Projects.SimpleJob+ Hercules.API.Projects.SimpleProject Hercules.API.Repos Hercules.API.Repos.Repo Hercules.API.Repos.RepoKey+ Hercules.API.Repos.SimpleRepo Hercules.API.Result Hercules.API.Servant.Status Hercules.API.SourceHostingSite.SimpleSite@@ -113,7 +118,7 @@ -fwarn-name-shadowing -fwarn-incomplete-patterns build-depends:- aeson+ aeson >= 2 , base >=4.7 && <5 , bytestring , containers
src/Hercules/API/Accounts/SimpleAccount.hs view
@@ -8,7 +8,7 @@ data SimpleAccount = SimpleAccount { id :: Id Account,- name :: Text,+ name :: Name Account, displayName :: Text, typ :: AccountType, imageURL :: Text,
src/Hercules/API/Agents/AgentSession.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DerivingStrategies #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Hercules.API.Agents.AgentSession where
src/Hercules/API/Attribute.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE StandaloneDeriving #-}-{-# LANGUAGE TypeApplications #-} module Hercules.API.Attribute where
src/Hercules/API/Build/DerivationEvent.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-}-{-# LANGUAGE DisambiguateRecordFields #-} {-# LANGUAGE DuplicateRecordFields #-} module Hercules.API.Build.DerivationEvent where@@ -32,16 +31,16 @@ toEncoding = genericToEncoding schemaCompatibleOptions eventTime :: DerivationEvent -> UTCTime-eventTime (Queued (DerivationEventQueued {time = t})) = t-eventTime (DependencyFailed (DerivationEventDependencyFailed {time = t})) = t-eventTime (Started (DerivationEventStarted {time = t})) = t-eventTime (Reset (DerivationEventReset {time = t})) = t-eventTime (Failed (DerivationEventFailed {time = t})) = t-eventTime (Succeeded (DerivationEventSucceeded {time = t})) = t-eventTime (Cancelled (DerivationEventCancelled {time = t})) = t-eventTime (Built (DerivationEventBuilt {time = t})) = t-eventTime (HasCancelled (DerivationEventHasCancelled {time = t})) = t-eventTime (HasCancelledForReset (DerivationEventHasCancelledForReset {time = t})) = t+eventTime (Queued DerivationEventQueued {time = t}) = t+eventTime (DependencyFailed DerivationEventDependencyFailed {time = t}) = t+eventTime (Started DerivationEventStarted {time = t}) = t+eventTime (Reset DerivationEventReset {time = t}) = t+eventTime (Failed DerivationEventFailed {time = t}) = t+eventTime (Succeeded DerivationEventSucceeded {time = t}) = t+eventTime (Cancelled DerivationEventCancelled {time = t}) = t+eventTime (Built DerivationEventBuilt {time = t}) = t+eventTime (HasCancelled DerivationEventHasCancelled {time = t}) = t+eventTime (HasCancelledForReset DerivationEventHasCancelledForReset {time = t}) = t data DerivationEventQueued = DerivationEventQueued { time :: UTCTime,
src/Hercules/API/Effects/EffectEvent.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-}-{-# LANGUAGE DisambiguateRecordFields #-} {-# LANGUAGE DuplicateRecordFields #-} module Hercules.API.Effects.EffectEvent where@@ -26,12 +25,12 @@ toEncoding = genericToEncoding schemaCompatibleOptions eventTime :: EffectEvent -> UTCTime-eventTime (Queued (EffectEventQueued {time = t})) = t-eventTime (DependencyFailed (EffectEventDependencyFailed {time = t})) = t-eventTime (Started (EffectEventStarted {time = t})) = t-eventTime (Failed (EffectEventFailed {time = t})) = t-eventTime (Succeeded (EffectEventSucceeded {time = t})) = t-eventTime (Cancelled (EffectEventCancelled {time = t})) = t+eventTime (Queued EffectEventQueued {time = t}) = t+eventTime (DependencyFailed EffectEventDependencyFailed {time = t}) = t+eventTime (Started EffectEventStarted {time = t}) = t+eventTime (Failed EffectEventFailed {time = t}) = t+eventTime (Succeeded EffectEventSucceeded {time = t}) = t+eventTime (Cancelled EffectEventCancelled {time = t}) = t data EffectEventQueued = EffectEventQueued { time :: UTCTime
+ src/Hercules/API/Inputs/ImmutableGitInput.hs view
@@ -0,0 +1,18 @@+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.Inputs.ImmutableGitInput where++import Hercules.API.Prelude+import Hercules.API.Projects.SimpleJob (SimpleJob)+import Hercules.API.Repos.SimpleRepo (SimpleRepo)++data ImmutableGitInput = ImmutableGitInput+ { rev :: Text,+ ref :: Text,+ sshURL :: Text,+ httpURL :: Text,+ repo :: Maybe SimpleRepo,+ jobs :: Maybe [SimpleJob],+ historyURL :: Maybe Text+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
+ src/Hercules/API/Inputs/ImmutableInput.hs view
@@ -0,0 +1,26 @@+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.Inputs.ImmutableInput where++import Data.Aeson+ ( FromJSON (parseJSON),+ ToJSON (toEncoding, toJSON),+ genericParseJSON,+ genericToEncoding,+ genericToJSON,+ )+import Hercules.API.Inputs.ImmutableGitInput+import Hercules.API.Prelude++data ImmutableInput+ = GitInput ImmutableGitInput+ | IgnoreMe ()+ deriving (Generic, Show, Eq, NFData, ToSchema)++instance FromJSON ImmutableInput where+ parseJSON = genericParseJSON schemaCompatibleOptions++instance ToJSON ImmutableInput where+ toJSON = genericToJSON schemaCompatibleOptions++ toEncoding = genericToEncoding schemaCompatibleOptions
src/Hercules/API/Labels.hs view
@@ -1,6 +1,5 @@ {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE TypeApplications #-} module Hercules.API.Labels where @@ -19,4 +18,4 @@ NamedSchema (Just "Labels") $ mempty & type_ ?~ SwaggerObject- & additionalProperties ?~ (AdditionalPropertiesAllowed True)+ & additionalProperties ?~ AdditionalPropertiesAllowed True
+ src/Hercules/API/Paging.hs view
@@ -0,0 +1,18 @@+{-# LANGUAGE DeriveAnyClass #-}+{-# LANGUAGE StandaloneDeriving #-}++module Hercules.API.Paging where++import Hercules.API.Prelude++-- To be used in newtypes only; otherwise the schema will have colliding+-- PagedResponse types.+data PagedResponse a = PagedResponse+ { -- | The items you requested, up to some limit.+ items :: [a],+ -- | Whether more items would be returned if it wasn't for the limit.+ more :: Bool+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON)++deriving instance ToSchema a => ToSchema (PagedResponse a)
src/Hercules/API/Projects.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveAnyClass #-} module Hercules.API.Projects where @@ -8,6 +9,8 @@ ) import qualified Hercules.API.Build.FailureGraph as FailureGraph import Hercules.API.Build.Log (Log)+import Hercules.API.Inputs.ImmutableGitInput (ImmutableGitInput)+import Hercules.API.Paging (PagedResponse) import Hercules.API.Prelude import Hercules.API.Projects.CreateProject ( CreateProject,@@ -27,8 +30,48 @@ import Servant.API import Servant.API.Generic +data ProjectResourceGroup auth f = ProjectResourceGroup+ { getJobs ::+ f :- Summary "Retrieve information about jobs"+ :> "jobs"+ :> QueryParam' '[Optional, Description "Constrain the results by git ref, such as refs/heads/my-branch or HEAD"] "ref" Text+ :> QueryParam' '[Optional, Description "Only return successful jobs, or only failed ones"] "success" Bool+ :> QueryParam' '[Optional, Description "Return jobs that come \"after\" the provided id in the response order."] "offsetId" (Id Job)+ :> auth+ :> Get '[JSON] PagedJobs,+ getJobSource ::+ f :- Summary "Get source information from the latest successful job/jobs satisfying the provided requirements."+ :> Description "The job parameter can be omitted to require all jobs for a commit to succeed. This can have the unexpected effect of reverting when a change in the extraInputs causes a regression. So it is recommended to specify one or more jobs. Common examples are \"onPush.default\" for a pinned build or \"onPush.ci\" for a build using extraInputs to integrate continuously."+ :> "source"+ :> QueryParam' '[Optional, Description "Constrain the results by git ref, such as refs/heads/my-branch. Defaults to HEAD."] "ref" Text+ :> QueryParams "jobs" Text+ :> auth+ :> Get '[JSON] ImmutableGitInput+ }+ deriving (Generic)+ data ProjectsAPI auth f = ProjectsAPI- { projectsByOwner ::+ { byProjectId ::+ f+ :- Substitute+ ( "projects"+ :> Capture' '[Required, Strict] "projectId" (Id Project)+ :> Placeholder+ )+ (ToServantApi (ProjectResourceGroup auth)),+ byProjectName ::+ f+ :- Substitute+ ( "site"+ :> Capture' '[Required, Strict] "site" (Name SourceHostingSite)+ :> "account"+ :> Capture' '[Required, Strict] "account" (Name Account)+ :> "project"+ :> Capture' '[Required, Strict] "project" (Name Project)+ :> Placeholder+ )+ (ToServantApi (ProjectResourceGroup auth)),+ projectsByOwner :: f :- Summary "List all projects owned by an account." :> "accounts" :> Capture' '[Required, Strict] "accountId" (Id Account)@@ -63,14 +106,6 @@ :> auth :> "create-user-effect-token" :> Post '[JSON] CreateUserEffectTokenResponse,- projectJobs ::- f :- Summary "List all jobs in a project"- :> Description "A list of a project's revisions and their details and status."- :> "projects"- :> Capture' '[Required, Strict] "project" (Id Project)- :> "jobs"- :> auth- :> Get '[JSON] [Job], findJobs :: f :- Summary "Find jobs" :> "jobs"@@ -132,3 +167,6 @@ :> Get '[JSON] Log } deriving (Generic)++newtype PagedJobs = PagedJobs (PagedResponse Job)+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
src/Hercules/API/Projects/Job.hs view
@@ -1,13 +1,20 @@ {-# LANGUAGE DeriveAnyClass #-} -module Hercules.API.Projects.Job where+module Hercules.API.Projects.Job+ ( module Hercules.API.Projects.Job,+ JobStatus (..),+ JobPhase (..),+ )+where import Hercules.API.Accounts.Account (Account) import Hercules.API.Evaluation.Evaluation ( Evaluation, )+import Hercules.API.Inputs.ImmutableInput (ImmutableInput) import Hercules.API.Prelude import Hercules.API.Projects.Project (Project)+import Hercules.API.Projects.SimpleJob (JobPhase (..), JobStatus (..)) import Hercules.API.Repos.Repo (Repo) data Job = Job@@ -25,6 +32,10 @@ effectsStatus :: JobStatus, evaluationId :: Id Evaluation, source :: GitCommitSource,+ -- | This is only correct when querying a single Job.+ extraInputs :: Map Text ImmutableInput,+ jobType :: JobType,+ jobName :: Maybe Text, rerunOf :: Maybe (Id Job), rerunOfIndex :: Maybe Int, startedBy :: Maybe (Id Account),@@ -34,6 +45,12 @@ } deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema) +data JobType+ = Config+ | Legacy+ | OnPush+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)+ data GitCommitSource = GitCommitSource { revision :: Text, ref :: Text,@@ -43,36 +60,6 @@ link :: Text } deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)--data JobPhase- = Queued- | Evaluating- | Building- | Effects- | Done- deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)--data JobStatus- = Pending- | Failure- | Success- deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)---- | Whichever is "worse": 'Failure' wins out, otherwise 'Pending' wins out, otherwise all are 'Success'.-instance Semigroup JobStatus where- Failure <> _ = Failure- _ <> Failure = Failure- Pending <> _ = Pending- _ <> Pending = Pending- Success <> Success = Success---- | @mappend@: Whichever is "worse": 'Failure' wins out, otherwise 'Pending' wins out, otherwise all are 'Success'.------ @mempty@: 'Success'-instance Monoid JobStatus where- mappend = (<>)-- mempty = Success data ProjectAndJobs = ProjectAndJobs { project :: Project,
src/Hercules/API/Projects/SimpleJob.hs view
@@ -1,14 +1,46 @@+{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-} module Hercules.API.Projects.SimpleJob where import Hercules.API.Prelude-import Hercules.API.Projects.Job (Job)-import Hercules.API.Projects.Project (Project)+import Hercules.API.Projects.SimpleProject (SimpleProject) data SimpleJob = SimpleJob- { id :: Id Job,- project :: Project,- index :: Int64+ { id :: Id "Job",+ project :: SimpleProject,+ index :: Int64,+ status :: JobStatus,+ phase :: JobPhase } deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)++data JobPhase+ = Queued+ | Evaluating+ | Building+ | Effects+ | Done+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)++data JobStatus+ = Pending+ | Failure+ | Success+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)++-- | Whichever is "worse": 'Failure' wins out, otherwise 'Pending' wins out, otherwise all are 'Success'.+instance Semigroup JobStatus where+ Failure <> _ = Failure+ _ <> Failure = Failure+ Pending <> _ = Pending+ _ <> Pending = Pending+ Success <> Success = Success++-- | @mappend@: Whichever is "worse": 'Failure' wins out, otherwise 'Pending' wins out, otherwise all are 'Success'.+--+-- @mempty@: 'Success'+instance Monoid JobStatus where+ mappend = (<>)++ mempty = Success
+ src/Hercules/API/Projects/SimpleProject.hs view
@@ -0,0 +1,21 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.Projects.SimpleProject where++import Hercules.API.Accounts.SimpleAccount (SimpleAccount)+import Hercules.API.Prelude+import Hercules.API.Projects.Project (Project)++data SimpleProject = SimpleProject+ { id :: Id Project,+ name :: Name Project,+ owner :: SimpleAccount,+ displayName :: Text,+ imageURL :: Maybe Text,+ -- | True if no authorization is required for retrieving basic+ -- information about a project, such as its existence, name,+ -- job statuses etc.+ isPublic :: Bool+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)
src/Hercules/API/Repos/Repo.hs view
@@ -14,6 +14,9 @@ displayName :: Text, imageURL :: Maybe Text, isPublic :: Bool,+ defaultBranch :: Maybe Text,+ httpURL :: Text,+ sshURL :: Text, -- | An installed repo is one that Hercules has permission to. -- -- A non-installed repo is one that is only visible because of the
+ src/Hercules/API/Repos/SimpleRepo.hs view
@@ -0,0 +1,17 @@+{-# LANGUAGE DeriveAnyClass #-}++module Hercules.API.Repos.SimpleRepo where++import Hercules.API.Accounts.SimpleAccount (SimpleAccount)+import Hercules.API.Prelude+import Hercules.API.Repos.Repo (Repo)++data SimpleRepo = SimpleRepo+ { id :: Id Repo,+ name :: Name Repo,+ owner :: SimpleAccount,+ displayName :: Text,+ imageURL :: Maybe Text,+ isPublic :: Bool+ }+ deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON, ToSchema)