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

enhance: default fetch depth to 1 if none provided #90

Merged
merged 1 commit into from
Dec 7, 2021

Conversation

dtanner
Copy link
Contributor

@dtanner dtanner commented Dec 1, 2021

@dtanner dtanner requested a review from a team as a code owner December 1, 2021 17:38
@codecov
Copy link

codecov bot commented Dec 1, 2021

Codecov Report

Merging #90 (5db6f62) into master (faafd58) will decrease coverage by 1.97%.
The diff coverage is 81.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #90      +/-   ##
==========================================
- Coverage   50.47%   48.50%   -1.98%     
==========================================
  Files           6        6              
  Lines         420      400      -20     
==========================================
- Hits          212      194      -18     
+ Misses        197      196       -1     
+ Partials       11       10       -1     
Impacted Files Coverage Δ
cmd/vela-git/main.go 0.00% <0.00%> (ø)
cmd/vela-git/plugin.go 54.54% <33.33%> (-0.86%) ⬇️
cmd/vela-git/command.go 100.00% <100.00%> (ø)

Copy link
Contributor

@jbrockopp jbrockopp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dtanner thanks for the contribution!

qq: Do we consider this a breaking change?

To be clear, I'm not against this proposed change. I'm asking for my own understanding.

@jbrockopp jbrockopp changed the title default fetch depth to 1 if none provided enhance: default fetch depth to 1 if none provided Dec 2, 2021
@dtanner
Copy link
Contributor Author

dtanner commented Dec 2, 2021

@dtanner thanks for the contribution!

qq: Do we consider this a breaking change?

To be clear, I'm not against this proposed change. I'm asking for my own understanding.

Good question. Technically I think yes it could be considered a breaking change because it's possible someone is relying on it. Realistically I don't think it is though. i.e. I don't know of a situation where you need full depth for a CI/CD build.

@jbrockopp
Copy link
Contributor

@dtanner yeah I think that's a fair summary!

I think we'll want to make sure we update the next Vela release notes with this information 👍

What are your thoughts on additionally setting an explicit default for the depth parameter?

&cli.StringFlag{
EnvVars: []string{"PARAMETER_DEPTH", "GIT_DEPTH"},
FilePath: "/vela/parameters/git/depth,/vela/secrets/git/depth",
Name: "build.depth",
Usage: "enables fetching the repository with the specified depth",
},

Right now, with the code you added, the plugin implicitly defaults to 1 for the depth if none is provided.

What I'm proposing is to keep that code you've added but also set an explicit default of 1 for that parameter:

 &cli.StringFlag{ 
 	EnvVars:  []string{"PARAMETER_DEPTH", "GIT_DEPTH"}, 
 	FilePath: "/vela/parameters/git/depth,/vela/secrets/git/depth", 
 	Name:     "build.depth", 
 	Usage:    "enables fetching the repository with the specified depth",
 	Value:    "1",
 },

@dtanner
Copy link
Contributor Author

dtanner commented Dec 2, 2021

Sure - defaulting the parameter sounds like a good addition as well.

@dtanner dtanner force-pushed the feat/default-depth-1 branch from 87ec799 to 5db6f62 Compare December 6, 2021 17:19
@dtanner
Copy link
Contributor Author

dtanner commented Dec 6, 2021

@jbrockopp check out the latest rev and lemmeno what you think

@dtanner dtanner merged commit 6bc27f0 into master Dec 7, 2021
@dtanner dtanner deleted the feat/default-depth-1 branch December 7, 2021 19:39
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

Successfully merging this pull request may close these issues.

Default fetch and clone depth to 1
3 participants