Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4859 from alrs/pipeline-dropped-errs
Browse files Browse the repository at this point in the history
internal/server/boltdbstate: fix dropped errors
  • Loading branch information
briancain committed Jul 25, 2023
2 parents 918df22 + e3a1429 commit e0c7de3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/server/boltdbstate/pipeline_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ func (s *State) PipelineRunGetByJobId(ctx context.Context, jobId string) (*pb.Pi
var result *pb.PipelineRun
err := s.db.View(func(dbTxn *bolt.Tx) error {
job, err := s.jobById(dbTxn, jobId)
if err != nil {
return err
}
if job.Pipeline == nil {
err = status.Errorf(codes.FailedPrecondition, "no pipeline run associated with job %q", job)
return err
Expand All @@ -117,6 +120,9 @@ func (s *State) PipelineRunGetByJobId(ctx context.Context, jobId string) (*pb.Pi
},
}
p, err := s.pipelineGet(dbTxn, memTxn, ref)
if err != nil {
return err
}
result, err = s.pipelineRunGet(dbTxn, memTxn, p.Id, job.Pipeline.RunSequence)
return err
})
Expand All @@ -135,6 +141,9 @@ func (s *State) PipelineRunGet(ctx context.Context, ref *pb.Ref_Pipeline, seq ui
var result *pb.PipelineRun
err := s.db.View(func(dbTxn *bolt.Tx) error {
p, err := s.pipelineGet(dbTxn, memTxn, ref)
if err != nil {
return err
}
result, err = s.pipelineRunGet(dbTxn, memTxn, p.Id, seq)
return err
})
Expand Down

0 comments on commit e0c7de3

Please sign in to comment.