Skip to content

Commit

Permalink
Skip label rule evaluation in container exectution
Browse files Browse the repository at this point in the history
  • Loading branch information
wsan3 committed Jun 13, 2024
1 parent f69ce12 commit aef0237
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions pipeline/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,32 +152,21 @@ func (c *Container) Execute(r *RuleData) (bool, error) {
if c == nil {
return false, nil
}
// skip evaluating path in ruleset
//
// the compiler is the component responsible for
// choosing whether a container will run based
// off the files changed for a build

// Skip evaluating path, comment, and label in ruleset,
// as the worker lacks necessary rule data.
//
// the worker doesn't have any record of
// what files changed for a build so we
// should "skip" evaluating what the
// user provided for the path element
// The compiler determines whether a container will run based on
// these rules.
c.Ruleset.If.Path = []string{}
c.Ruleset.Unless.Path = []string{}

// skip evaluating comment in ruleset
//
// the compiler is the component responsible for
// choosing whether a container will run based
// off the PR comment matching the pipeline comment
//
// the worker doesn't have any record of
// the PR comment so we
// should "skip" evaluating what the
// user provided for the PR comment
c.Ruleset.If.Comment = []string{}
c.Ruleset.Unless.Comment = []string{}

c.Ruleset.If.Label = []string{}
c.Ruleset.Unless.Label = []string{}

// check if the build is in a running state
if strings.EqualFold(r.Status, constants.StatusRunning) {
// treat the ruleset status as success
Expand Down

0 comments on commit aef0237

Please sign in to comment.