Skip to content

Unshallow repo after workspace is ready #6857

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

Merged
merged 1 commit into from
Nov 26, 2021
Merged

Unshallow repo after workspace is ready #6857

merged 1 commit into from
Nov 26, 2021

Conversation

jeanp413
Copy link
Member

@jeanp413 jeanp413 commented Nov 23, 2021

Description

Unshallows a repo automatically in the background

Related Issue(s)

Fixes #6796

How to test

  1. Open a workspace
  2. Check that after a few seconds(maybe minutes depending on the repo size) the repo has been unshallowed git rev-parse --is-shallow-repository

Release Notes

NONE

Documentation

@codecov
Copy link

codecov bot commented Nov 23, 2021

Codecov Report

Merging #6857 (739aec6) into main (a36fd97) will increase coverage by 18.10%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #6857       +/-   ##
===========================================
+ Coverage   19.04%   37.15%   +18.10%     
===========================================
  Files           2       19       +17     
  Lines         168     4578     +4410     
===========================================
+ Hits           32     1701     +1669     
- Misses        134     2743     +2609     
- Partials        2      134      +132     
Flag Coverage Δ
components-local-app-app-linux-amd64 ?
components-local-app-app-linux-arm64 ?
components-local-app-app-windows-386 ?
components-local-app-app-windows-amd64 ?
components-local-app-app-windows-arm64 ?
components-supervisor-app 37.15% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
components/supervisor/pkg/supervisor/supervisor.go 6.05% <0.00%> (ø)
components/local-app/pkg/auth/auth.go
components/local-app/pkg/auth/pkce.go
components/supervisor/pkg/dropwriter/dropwriter.go 73.46% <0.00%> (ø)
components/supervisor/pkg/ports/served-ports.go 80.00% <0.00%> (ø)
...mponents/supervisor/pkg/supervisor/notification.go 83.95% <0.00%> (ø)
components/supervisor/pkg/supervisor/tasks.go 58.56% <0.00%> (ø)
components/supervisor/pkg/ports/exposed-ports.go 0.00% <0.00%> (ø)
components/supervisor/pkg/terminal/service.go 32.38% <0.00%> (ø)
components/supervisor/pkg/ports/slirp4netns.go 0.00% <0.00%> (ø)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 915cd41...739aec6. Read the comment docs.

@aledbf
Copy link
Member

aledbf commented Nov 23, 2021

Unshallows a repo automatically in the background

I thought this idea was rejected when I proposed it in #6464

@jeanp413
Copy link
Member Author

jeanp413 commented Nov 24, 2021

Not sure why it was not included in the original PR but some of us (myself included) have been having issues with the shallow clone so we agreed to unshallow the repo (codespaces also unshallows in the background)

cmd := runAsGitpodUser(exec.Command("git", "fetch", "--depth", "20"))
var cmd *exec.Cmd
if cfg.isHeadless() {
cmd = runAsGitpodUser(exec.Command("git", "fetch", "--depth", "20"))
Copy link
Member

Choose a reason for hiding this comment

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

I think we can do without any fetching on prebuilds.

@svenefftinge
Copy link
Member

Unshallows a repo automatically in the background

I thought this idea was rejected when I proposed it in #6464

There has been discussions around pressure on always doing unshallow right after ready. Which made us think about more complex solutions (time-based, only certain cases, etc.). Also my analyzation of codespaces seems to have been wrong, as Jean Pierre found that they indeed just always do an unshallow after start. So, I think we should do the same here now as our current approach has negative effects as mentioned by Jean Pierre.

@roboquat roboquat added size/M and removed size/XS labels Nov 24, 2021
@jeanp413 jeanp413 force-pushed the jp/unshallow branch 2 times, most recently from 19771e5 to ee47366 Compare November 25, 2021 00:52
@jeanp413
Copy link
Member Author

jeanp413 commented Nov 25, 2021

/werft run

👍 started the job as gitpod-build-jp-unshallow.7

@akosyakov
Copy link
Member

akosyakov commented Nov 25, 2021

/werft run

👍 started the job as gitpod-build-jp-unshallow.9

@csweichel
Copy link
Contributor

We've just merged a fix for the broken chart. Please rebase which should solve the issue

@jeanp413
Copy link
Member Author

Ready for review cc @akosyakov

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

/lgtm

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: 7750ed822b8b487cb00897db665c9892677683a1

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akosyakov

Associated issue: #6796

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@roboquat roboquat merged commit 19b6154 into main Nov 26, 2021
@roboquat roboquat deleted the jp/unshallow branch November 26, 2021 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

shallow clone breaks git rebase, gitlens, timeline and other features
6 participants