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

allow custom git clone flags during a plugin checkout #1839

Open
scriptnull opened this issue Nov 18, 2022 · 1 comment
Open

allow custom git clone flags during a plugin checkout #1839

scriptnull opened this issue Nov 18, 2022 · 1 comment

Comments

@scriptnull
Copy link

Is your feature request related to a problem? Please describe.
In all our jobs, the first thing to be executed is the "Preparing plugins" section which clones the git repos of plugins that we use for that step.

But the git clone of a plugin repo is adding a lot of log lines (to report the progress of the clone) which often adds noise to our build logs. We would ideally like to suppress these logs by doing a git clone --quiet instead.

Describe the solution you'd like
I would like to add a new config to the agent - something like plguins-git-clone-flags (BUILDKITE_PLUGINS_GIT_CLONE_FLAGS) and make use of that config while cloning the plugin repo here:

args := []string{"clone", "-v"}
if b.GitSubmodules {
// "--recursive" was added in Git 1.6.5, and is an alias to
// "--recurse-submodules" from Git 2.13.
args = append(args, "--recursive")
}
args = append(args, "--", repo, ".")
// Plugin clones shouldn't use custom GitCloneFlags
err = roko.NewRetrier(
roko.WithMaxAttempts(3),
roko.WithStrategy(roko.Constant(2*time.Second)),
).Do(func(r *roko.Retrier) error {
return b.shell.Run(ctx, "git", args...)
})
if err != nil {
return nil, err
}

Describe alternatives you've considered
None

Additional context
This is how our build logs look when the plugin is cloned for the first time. (a sample of first few lines, but imagine 500+ more lines like this)
image

Having this config option would help is in avoiding these lines in our build logs.

@scriptnull
Copy link
Author

I am willing to open a pull request for this if someone from the buildkite team could tell me if it is okay to add the above-proposed config option 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant