Throw error when job run is skipped due to max_concurrent_runs (#257)

Tested manually:

Before we did not have get any errors/logs and silently failed in this
case

```
shreyas.goenka@THW32HFW6T job-output % bricks bundle run foo
Error: run skipped: Skipping this run because the limit of 1 maximum concurrent runs has been reached.
```
This commit is contained in:
shreyas-goenka 2023-03-21 13:17:15 +01:00 committed by GitHub
parent 66ca9ec266
commit 4ac2e33def
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -190,6 +190,10 @@ func (r *jobRunner) Run(ctx context.Context, opts *Options) error {
if err != nil {
return err
}
if run.State.LifeCycleState == jobs.RunLifeCycleStateSkipped {
log.Infof(ctx, "Run was skipped!")
return fmt.Errorf("run skipped: %s", run.State.StateMessage)
}
switch run.State.ResultState {
// The run was canceled at user request.