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

Fix bundle creation #17079

Merged
merged 11 commits into from
Sep 25, 2021
Merged

Fix bundle creation #17079

merged 11 commits into from
Sep 25, 2021

Conversation

axifive
Copy link
Member

@axifive axifive commented Sep 17, 2021

Fix for added bundle download (#14538). git bundle create can only accept a reference:

2021/09/17 15:37:16 ...archiver/archiver.go:237:func1() [E] Archive &{1 master bundle 8c3a46a6fadf07e24199cf0fbf0fcb973cd5efb8} faild: unable to write archive: exit status 128 - fatal: Refusing to create empty bundle.

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
@axifive axifive changed the title fixed bundle creation Fix bundle creation Sep 17, 2021
@axifive axifive added type/bug pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! labels Sep 17, 2021
@codecov-commenter
Copy link

codecov-commenter commented Sep 17, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@623d2dd). Click here to learn what that means.
The diff coverage is 6.66%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #17079   +/-   ##
=======================================
  Coverage        ?   45.31%           
=======================================
  Files           ?      774           
  Lines           ?    86983           
  Branches        ?        0           
=======================================
  Hits            ?    39415           
  Misses          ?    41191           
  Partials        ?     6377           
Impacted Files Coverage Δ
modules/git/repo.go 42.34% <0.00%> (ø)
services/archiver/archiver.go 54.07% <33.33%> (ø)

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 623d2dd...6365921. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 17, 2021
Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
@zeripath
Copy link
Contributor

Instead of creating a branch in the real repo this should create a temporary repo with GIT_OBJECT_DIRECTORY set to the main repo and then you create your own branch as appropriate, then the whole temporary repo can be deleted at the end without having to worry about issues like what if a panic is called earlier.

We must not go around creating branches in real users repos. They will appear on the UI - even for a short amount of time - but the current code risks the temporary branch not being deleted at the end if there is an error.

@jolheiser
Copy link
Member

Another alternative, maybe we just don't offer bundle downloads for a commit? (If there's no simple way to provide them, that is)
I still personally think the majority of use-cases for bundles are the entire main branch/repo.

@axifive axifive marked this pull request as draft September 18, 2021 17:04
@axifive
Copy link
Member Author

axifive commented Sep 18, 2021

@jolheiser the way suggested by @zeripath looks quite simple

@axifive axifive marked this pull request as ready for review September 18, 2021 22:29
@axifive axifive added this to the 1.16.0 milestone Sep 19, 2021
@6543
Copy link
Member

6543 commented Sep 20, 2021

Why is it kind/breaking?

@axifive
Copy link
Member Author

axifive commented Sep 20, 2021

@6543 added multiple by mistake

@axifive axifive removed the pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! label Sep 20, 2021
Co-authored-by: Gwyneth Morgan <87623694+gwymor@users.noreply.github.com>
modules/git/repo.go Outdated Show resolved Hide resolved
axifive and others added 3 commits September 22, 2021 02:36
Co-authored-by: Gwyneth Morgan <gwymor@tilde.club>
Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 24, 2021
@6543 6543 added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Sep 25, 2021
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Sep 25, 2021
@lafriks lafriks merged commit 7e9bd20 into go-gitea:main Sep 25, 2021
@axifive axifive deleted the fix-bundle-download branch September 25, 2021 21:59
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants