Skip to content

Commit

Permalink
fix(build/ruleset): handle legacy PR ruleset for restarted build (#678)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecrupper authored Jul 21, 2022
1 parent 0740ca5 commit 5276264
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,15 @@ func RestartBuild(c *gin.Context) {
b.SetRuntime("")
b.SetDistribution("")

// update the PR event action if action was never set
// for backwards compatibility with pre-0.14 releases.
if b.GetEvent() == constants.EventPull && b.GetEventAction() == "" {
// technically, the action could have been opened or synchronize.
// will not affect behavior of the pipeline since we did not
// support actions for builds where this would be the case.
b.SetEventAction(constants.ActionOpened)
}

// set the parent equal to the restarted build number
b.SetParent(b.GetNumber())
// update the build numbers based off repo counter
Expand Down

0 comments on commit 5276264

Please sign in to comment.