-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
feat: add depth flag #16064
feat: add depth flag #16064
Conversation
5ca3a38
to
746debc
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #16064 +/- ##
==========================================
+ Coverage 44.95% 49.55% +4.59%
==========================================
Files 355 269 -86
Lines 47917 46645 -1272
==========================================
+ Hits 21541 23114 +1573
+ Misses 23571 21258 -2313
+ Partials 2805 2273 -532 ☔ View full report in Codecov by Sentry. |
bd0c6c1
to
1c1a5ed
Compare
964af87
to
f118d53
Compare
@crenshaw-dev could help me to get to the finish line with this one? |
@yordis the code looks to be in good shape. We probably need some docs. I'd also really like to see how this behaves on a large, active monorepo over time. I am curious if the shallow fetch is going to cause inefficient storage and slowly fill up the repo server. |
We should synchronize communication with the community, it should, in theory, be faster download and cheaper storage ...
Where should I add it? |
AFAIU the issue is that it's more expensive with shallow clones (see #5467 and its linked issues) |
Hey peeps, what is the resolution here? |
I think documentation should be added both of these places:
Yep. I'm not a git expert, but I could definitely imagine "shallow clone" meaning "fresh copy stored with every pull." A fresh copy might not be as light to download or as easy to store as the diff between the current commit and the previous commit. In other words, we need someone to run this code on a large, frequently-updated monorepo for at least a few days and compare repo-server behavior to the same monorepo fetched without |
@crenshaw-dev do you mind giving me a hand with the docs? Honestly I am getting stuck with it, I would appreciate if you can help me with it and I get to learn from you. |
What is the status of #14272 btw? It seems as if this would be a preferable solution (in most cases) |
I am gonna go back to #14272 since they are some caveats I need to make sure it works:
So, I knew how to get the |
I think they each have their use case. Honestly curious to use them together for a repo that I have. |
@yordis We can test on this repo. It's not a super large repo but it has 10k commits so the shallow clone is ideal. https://github.com/aperture-sci/DevOps It's also updated several times a day. |
@todaywasawesome any support to validate the feature will help us, especially if it is being done in close to production usage |
Hey folks, are you still interested in taking this feature? From what I can tell, it will be a matter of time before people ask to pass this flag due to the nature of wrapping But it is not up to me; I would appreciate any resolution regarding what needs to happen with this PR. |
I think this is the next step towards getting this merged. Until we can confirm that setting the depth flag doesn't blow up storage due to inefficient local repo maintenance, I don't think we should merge it. |
@yordis I'm setting some time for myself to come back and work on this is the next few weeks. |
246dff8
to
095683d
Compare
I rebased, hopefully still working fine |
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
any news? |
🤷🏻 |
I think we still need evidence that enabling this doesn't blow up storage for a given repo over time. |
Putting this here for reference from other places: Sparse and shallow git repos are common requests for monorepos. People are accustomed to using these features in CI pipelines. But these settings are much easier to get right in CI pipelines because you throw away the clone when you're done with it. Argo CD maintains a persistent clone on the repo-server, allowing concurrent access to the same clone until the repo-server restarts. When managing a persistent clone, you have to handle cases which would be safe to ignore for a throw-away clone. For example:
The concurrency concerns are different depending on whether you configure depth/paths at the app level or the repo level. If at the repo level, you're less likely to encounter races, but it's still possible. |
Specific to this PR: does any depth besides "1" ever make sense for Argo CD's use case? |
Hi! Just for awareness, trying with In our case, we are using a mono-repo with thousands of commits per week. For context, we did the next change here to test the impact: func (m *nativeGitClient) fetch(revision string) error {
var err error
if revision != "" {
err = m.runCredentialedCmd("fetch", "origin", revision, "--tags", "--force", "--prune", "--depth=1")
} else {
err = m.runCredentialedCmd("fetch", "origin", "--tags", "--force", "--prune", "--depth=1")
}
return err
} |
Consolidating conversation here: #11198 |
No description provided.