Skip to content

Commit

Permalink
Merge pull request #219 from gravitational/hugo/ignore-crds-file-check
Browse files Browse the repository at this point in the history
Ignore generated CRDs during size check
  • Loading branch information
hugoShaka authored Jan 25, 2024
2 parents 7a444b1 + d8451ae commit 18bac5c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bot/internal/bot/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package bot

import (
"context"
"regexp"
"strings"

"github.com/gravitational/trace"
Expand All @@ -28,6 +29,10 @@ import (
"github.com/gravitational/shared-workflows/bot/internal/review"
)

// isCRDRegex matches Teleport operator CRD file paths.
// Those files receive a special treatment as they're automatically generated.
var isCRDRegex = regexp.MustCompile(`.*/resources\.teleport\.dev_[[:alpha:]]+\.yaml$`)

// Client implements the GitHub API.
type Client interface {
// RequestReviewers is used to assign reviewers to a Pull Request.
Expand Down Expand Up @@ -265,7 +270,8 @@ func skipFileForSizeCheck(name string) bool {
strings.HasSuffix(name, "_pb.d.ts") ||
strings.HasSuffix(name, ".json") ||
strings.Contains(name, "webassets/") ||
strings.Contains(name, "vendor/")
strings.Contains(name, "vendor/") ||
isCRDRegex.MatchString(name)
}

func isReleaseBranch(branch string) bool {
Expand Down

0 comments on commit 18bac5c

Please sign in to comment.