Skip to content

Commit

Permalink
Put Prod into review automatically, too. (#183)
Browse files Browse the repository at this point in the history
Fixes #182
  • Loading branch information
jcjones authored Oct 21, 2020
1 parent 67ca945 commit d477ea1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ccadb2OneCRL/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ func (u *Updater) Update() error {
Then(u.UpdateRecordsWithBugID()).
Then(u.PutStagingIntoReview()).
Then(u.PushToProduction()).
Then(u.PutProductionIntoReview()).
AutoRollbackOnError(true).
AutoClose(true).
Commit()
Expand Down Expand Up @@ -639,6 +640,14 @@ func (u *Updater) PushToProduction() transaction.Transactor {
})
}

func (u *Updater) PutProductionIntoReview() transaction.Transactor {
return transaction.NewTransaction().WithCommit(func() error {
return errors.WithStack(u.production.ToReview(ProductionCollection()))
}).WithRollback(func(_ error) error {
return errors.WithStack(u.production.ToRollBack(ProductionCollection()))
})
}

func (u *Updater) BlastEmails(intersection *onecrl.Set) {
bugIDs := make(map[int]bool, 0)
builder := strings.Builder{}
Expand Down

0 comments on commit d477ea1

Please sign in to comment.