SLING-13253 - update-local-site: shallow-clone the site checkout - #48
Conversation
99c3ec8 to
847d161
Compare
279c7a3 to
f1bf432
Compare
f1bf432 to
b02081d
Compare
847d161 to
89cf373
Compare
b02081d to
a0b8671
Compare
89cf373 to
2558409
Compare
rombert
left a comment
There was a problem hiding this comment.
This looks like using shallow clone but otherwise it also has some fixes which should be lower in the stack? In the end I was sort of expecting a different stack
- 1 PR for making the site update work
- 1 PR for integrating it in the finalize command
- any other follow-up PRs for extra functionality on top of that (probably not needed)
2558409 to
a2d46be
Compare
a102953 to
281545c
Compare
|
Thanks @rombert — you were right that this PR mixed things up. Split as follows:
Both build independently (176 and 179 tests), so the two are reviewable on their own. On the wider point about the shape of the stack — 1 PR to make the site update work, 1 PR to integrate it into One mechanical snag: I could not set this PR's base to #50's branch, because the merged #47 and #40 pin the original stack and GitHub refuses to unstack it ( |
457ec07 to
70bad41
Compare
|
Also fixed the remaining concern from reviewing this branch: The shallow fetch is now only requested when the checkout is already shallow, so:
Covered both ways: a new test asserts a full checkout stays full after a refresh (confirmed to fail without the guard — "a full checkout must stay full"), and the existing shallow tests still assert the shallow checkout stays shallow. The README caveat is relaxed accordingly. |
70bad41 to
d59f659
Compare
The checkout is cloned inside the container, so unless it is pointed at a directory that outlives the run it is re-cloned every time - a full clone of sling-site is ~380MB of history against ~15MB of content. Only the tip of the published branch is ever needed: the content is edited and committed on top of it, never inspected historically. The clone is therefore shallow and single-branch, which brings it down to ~25MB, and the refresh fetch stays shallow so a reused checkout does not grow back into a full clone. Covered by a test that runs against a real JGit and two real local repositories rather than mocking git: it clones shallowly, refreshes, commits and pushes, so a JGit upgrade that breaks shallow fetches, or a server that refuses a push from a shallow clone, fails here rather than during a release.
d59f659 to
1e069ed
Compare
|



Stack: 2 of 2 — builds on #50. Review that first.
Reduced to just the shallow clone: the fixes that were mixed in here have moved down to #50, per review feedback.
The checkout is cloned inside the container, so unless it is pointed at a directory that outlives the run it is re-cloned every time — and a full clone of
sling-siteis ~380 MB of history against ~15 MB of content. Only the tip of the published branch is ever needed: the content is edited and committed on top of it, never inspected historically. The clone is therefore shallow and single-branch, and the refresh fetch stays shallow so a reused checkout does not grow back into a full clone.Measured against the real gitbox: 23 MB (8.2 MB
.git), one commit, 13 s, down from ~380 MB.Covered by a test running against a real JGit and two real local repositories rather than mocked git commands: it clones shallowly, refreshes, commits and pushes, so a JGit upgrade that breaks shallow fetches — or a server that refuses a push from a shallow clone — fails here rather than during a release.
Also validated end to end against a real past release (Event Impl 4.4.2): a shallow checkout, reverted to the pre-release state, produced a
downloads.tplbyte-identical to the human commit that released it (blobc44750814…), pushed from the shallow clone, with the junk from a deliberately wrong starting branch correctly discarded. The push went to a local repository standing in for gitbox.Verified: full build green (179 tests).
Review order: please look at #50 first — this PR is logically stacked on it, but GitHub will not let me change the base: the now-merged #47 and #40 pin the original stack (
Unstacking not allowed: Pull requests #47, #40 cannot be removed from this stack), so this one is locked tomaster.Until #50 merges, the diff here therefore shows both commits. Only the second one,
281545c(shallow clone), is what this PR is about;34b037ais #50. Once #50 lands, this shrinks to the shallow-clone commit alone.