The Wayback Machine - https://web.archive.org/web/20220217185834/https://github.com/go-gitea/gitea/pull/14538
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

Add bundle download for repository #14538

Merged
merged 6 commits into from Aug 24, 2021
Merged

Add bundle download for repository #14538

merged 6 commits into from Aug 24, 2021

Conversation

@jolheiser
Copy link
Member

@jolheiser jolheiser commented Feb 1, 2021

This PR adds another download type for repositories, bundle.

This currently always bundles using --all, since I'd imagine it's almost always more useful to have the entire repo history.

In the future, bundling could be considered for backups since they are standalone repositories, more or less.

One thing that I couldn't seem to shake when writing this, it seems like the bundle file refused to copy correctly unless I closed the file after creation (and subsequently re-opened to allow the io.Copy).
Please let me know if I missed something silly. 🙂

Signed-off-by: jolheiser <[email protected]>
@jolheiser jolheiser added this to the 1.15.0 milestone Feb 1, 2021
@techknowlogick techknowlogick removed this from the 1.15.0 milestone Jun 15, 2021
@techknowlogick techknowlogick added this to the 1.16.0 milestone Jun 15, 2021
@jolheiser jolheiser mentioned this pull request Jul 14, 2021
@lunny
Copy link
Member

@lunny lunny commented Aug 18, 2021

Please resolve the conflicts.

jolheiser added 3 commits Aug 23, 2021
# Conflicts:
#	routers/web/repo/repo.go
#	services/archiver/archiver.go
#	templates/repo/home.tmpl
Signed-off-by: jolheiser <[email protected]>
Signed-off-by: jolheiser <[email protected]>
@jolheiser
Copy link
Member Author

@jolheiser jolheiser commented Aug 23, 2021

This should be ready to test again.

  1. Sorry for the unrelated changes, I'm not sure whether GoLand or gofmt is responsible for the build tags (my guess is the former), but they have been duplicated because the old style has been deprecated in favor of //go:build
  2. Due to bundles needing to be written to a file (rather than to stdout), I had to re-add code to temporarily store them until they could be piped out to the caller.

@lunny
Copy link
Member

@lunny lunny commented Aug 23, 2021

Since .zip and .tar.gz will only include current branch codes, it's confusing that this will bundle --all. Maybe add two menu items, one is for current branch another is --all.

Signed-off-by: jolheiser <[email protected]>
@jolheiser
Copy link
Member Author

@jolheiser jolheiser commented Aug 24, 2021

Alright, this now downloads a bundle at the current branch/commit.

After merging, I will follow up with a PR that adds the --all bundle to repo settings, as it's more of a complete backup option.

@codecov-commenter
Copy link

@codecov-commenter codecov-commenter commented Aug 24, 2021

Codecov Report

Merging #14538 (6800427) into main (1cd4a3b) will decrease coverage by 0.00%.
The diff coverage is 17.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #14538      +/-   ##
==========================================
- Coverage   45.50%   45.49%   -0.01%     
==========================================
  Files         762      762              
  Lines       85940    85973      +33     
==========================================
+ Hits        39108    39117       +9     
- Misses      40521    40546      +25     
+ Partials     6311     6310       -1     
Impacted Files Coverage Δ
cmd/embedded_stub.go 0.00% <ø> (ø)
modules/auth/pam/pam_stub.go 0.00% <ø> (ø)
modules/git/blob_nogogit.go 61.19% <ø> (ø)
modules/git/commit_info_nogogit.go 60.60% <ø> (ø)
modules/git/last_commit_cache_nogogit.go 35.84% <ø> (ø)
modules/git/notes_nogogit.go 71.42% <ø> (ø)
modules/git/parse_nogogit.go 56.32% <ø> (ø)
modules/git/pipeline/lfs_nogogit.go 0.00% <ø> (ø)
modules/git/repo.go 43.31% <0.00%> (-4.40%) ⬇️
modules/git/repo_archive.go 0.00% <0.00%> (ø)
... and 29 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 d22cb60...6800427. Read the comment docs.

lunny
lunny approved these changes Aug 24, 2021
@jolheiser jolheiser merged commit 648464b into go-gitea:main Aug 24, 2021
2 checks passed
@jolheiser jolheiser deleted the bundle branch Aug 24, 2021
@axifive axifive mentioned this pull request Sep 17, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants