Skip to content

Commit

Permalink
Merge pull request #1586 from jenkins-x/runifchangedtest
Browse files Browse the repository at this point in the history
reenable manual trigger despite run_if_changed not matching
  • Loading branch information
jenkins-x-bot authored Dec 20, 2023
2 parents 6f18e6a + f60e8c1 commit b8bcc60
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions pkg/config/job/presubmit.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ func (p Presubmit) ShouldRun(baseRef string, changes ChangedFilesProvider, force
}

// Evaluate regex expressions before checking if pre-submit jobs are always supposed to run
if determined, shouldRun, err := p.RegexpChangeMatcher.ShouldRun(changes); err != nil {
return false, err
} else if determined {
return shouldRun, nil
if !forced {
if determined, shouldRun, err := p.RegexpChangeMatcher.ShouldRun(changes); err != nil {
return false, err
} else if determined {
return shouldRun, nil
}
}

// TODO temporary disable RequireRun
Expand Down
4 changes: 2 additions & 2 deletions pkg/plugins/trigger/generic-comment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ func TestHandleGenericComment(t *testing.T) {
name: "explicit /test for RunIfChanged job that doesn't need to run",

Author: "trusted-member",
Body: "/test pull-jeb",
Body: "/test jeb",
State: "open",
IsPR: true,
Presubmits: map[string][]job.Presubmit{
Expand All @@ -729,7 +729,7 @@ func TestHandleGenericComment(t *testing.T) {
},
},
},
ShouldBuild: false,
ShouldBuild: true,
},
{
name: "/test all of run_if_changed job that has passed and needs to run",
Expand Down

0 comments on commit b8bcc60

Please sign in to comment.