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

Support commitMatcher for app kinds other than K8sApp #4966

Open
t-kikuc opened this issue Jun 12, 2024 · 1 comment
Open

Support commitMatcher for app kinds other than K8sApp #4966

t-kikuc opened this issue Jun 12, 2024 · 1 comment
Labels
kind/enhancement New feature or request

Comments

@t-kikuc
Copy link
Member

t-kikuc commented Jun 12, 2024

What would you like to be added:

Support commitMatcher for CloudRunApp, TerraformApp, ECSApp, and LambdaApp.

Why is this needed:

Currently, commitMatcher is only supported for K8sApp as below:

  • K8sApp:

    // This deployment is triggered by a commit with the intent to perform pipeline.
    // Commit Matcher will be ignored when triggered by a command.
    if p := cfg.CommitMatcher.Pipeline; p != "" && in.Trigger.Commander == "" {
    pipelineRegex, err := in.RegexPool.Get(p)
    if err != nil {
    err = fmt.Errorf("failed to compile commitMatcher.pipeline(%s): %w", p, err)
    return out, err
    }
    if pipelineRegex.MatchString(in.Trigger.Commit.Message) {
    out.SyncStrategy = model.SyncStrategy_PIPELINE
    out.Stages = buildProgressivePipeline(cfg.Pipeline, autoRollback, time.Now())
    out.Summary = fmt.Sprintf("Sync progressively because the commit message was matching %q", p)
    return out, err
    }
    }
    // This deployment is triggered by a commit with the intent to synchronize.
    // Commit Matcher will be ignored when triggered by a command.
    if s := cfg.CommitMatcher.QuickSync; s != "" && in.Trigger.Commander == "" {
    syncRegex, err := in.RegexPool.Get(s)
    if err != nil {
    err = fmt.Errorf("failed to compile commitMatcher.sync(%s): %w", s, err)
    return out, err
    }
    if syncRegex.MatchString(in.Trigger.Commit.Message) {
    out.SyncStrategy = model.SyncStrategy_QUICK_SYNC
    out.Stages = buildQuickSyncPipeline(autoRollback, time.Now())
    out.Summary = fmt.Sprintf("Quick sync by applying all manifests because the commit message was matching %q", s)
    return out, err
    }
    }

  • ECSApp: does not have such logic. (CloudRun, Lambda, Terraform too)
    https://github.com/pipe-cd/pipecd/blob/master/pkg/app/piped/planner/ecs/ecs.go

[IMO] Such logic should be placed in the common planner.go, not platform-specific files.

@t-kikuc t-kikuc added the kind/enhancement New feature or request label Jun 12, 2024
@t-kikuc
Copy link
Member Author

t-kikuc commented Jun 12, 2024

I found the docs is correct. commitMatcher exists only in KubernetesApp

image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
Status: 📋 New
Development

No branches or pull requests

1 participant