Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore generated CRDs during size check #219

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Changes from all commits
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
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
Loading