Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(build/ruleset): handle legacy PR ruleset for restarted build
  • Loading branch information
ecrupper committed Jul 21, 2022
commit b9a2b12690b36d5ee909547e2359174eb64c6df1
8 changes: 8 additions & 0 deletions api/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,14 @@ func RestartBuild(c *gin.Context) {
b.SetRuntime("")
b.SetDistribution("")

// update the PR event if action was never set
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