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

Move git update-server-info to hooks #12826

Merged
merged 5 commits into from
Oct 13, 2020

Conversation

zeripath
Copy link
Contributor

As mentioned in #10133 - update-server-info doesn't really belong in the running gitea process but in the hook during its update.

This PR moves this call to the hook directly.

We should consider whether this git method is actually still necessary as routers/repo/http.go:616:getInfoRefs appears to run this command anyway.

Signed-off-by: Andrew Thornton [email protected]

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath zeripath added the type/enhancement An improvement of existing functionality label Sep 13, 2020
@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2020

Codecov Report

Merging #12826 into master will increase coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #12826   +/-   ##
=======================================
  Coverage   42.62%   42.62%           
=======================================
  Files         672      672           
  Lines       73785    73784    -1     
=======================================
+ Hits        31448    31449    +1     
- Misses      37247    37250    +3     
+ Partials     5090     5085    -5     
Impacted Files Coverage Δ
cmd/hook.go 0.00% <0.00%> (ø)
services/repository/push.go 58.33% <ø> (+0.40%) ⬆️
modules/util/timer.go 42.85% <0.00%> (-42.86%) ⬇️
modules/indexer/stats/db.go 43.47% <0.00%> (-26.09%) ⬇️
modules/indexer/stats/queue.go 64.70% <0.00%> (-11.77%) ⬇️
modules/git/utils.go 73.77% <0.00%> (-3.28%) ⬇️
services/mailer/mail.go 54.83% <0.00%> (-1.08%) ⬇️
models/gpg_key.go 53.33% <0.00%> (-0.58%) ⬇️
modules/git/repo.go 46.19% <0.00%> (-0.51%) ⬇️
modules/notification/mail/mail.go 34.48% <0.00%> (ø)
... and 8 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 5e1c51c...bf6ecc2. 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 13, 2020
@zeripath zeripath added this to the 1.13.0 milestone Oct 5, 2020
Copy link
Member

@6543 6543 left a comment

Choose a reason for hiding this comment

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

update-server-info is cheep to execute ...

@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 Oct 10, 2020
@codecov-io
Copy link

Codecov Report

Merging #12826 into master will increase coverage by 0.08%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12826      +/-   ##
==========================================
+ Coverage   42.41%   42.50%   +0.08%     
==========================================
  Files         673      673              
  Lines       74114    74113       -1     
==========================================
+ Hits        31436    31499      +63     
+ Misses      37581    37491      -90     
- Partials     5097     5123      +26     
Impacted Files Coverage Δ
cmd/hook.go 0.00% <0.00%> (ø)
services/repository/push.go 56.65% <ø> (+0.33%) ⬆️
modules/indexer/stats/queue.go 64.70% <0.00%> (-11.77%) ⬇️
modules/indexer/stats/db.go 43.47% <0.00%> (-8.70%) ⬇️
modules/git/utils.go 73.77% <0.00%> (-3.28%) ⬇️
services/pull/check.go 47.69% <0.00%> (-2.31%) ⬇️
models/error.go 34.34% <0.00%> (-1.02%) ⬇️
modules/git/repo.go 46.19% <0.00%> (-0.51%) ⬇️
services/pull/pull.go 40.78% <0.00%> (ø)
services/mailer/mail.go 55.91% <0.00%> (+1.07%) ⬆️
... and 7 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 9066d09...f555620. Read the comment docs.

@lunny
Copy link
Member

lunny commented Oct 11, 2020

But HTTP protocol push will miss that update?

@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 Oct 13, 2020
@lunny
Copy link
Member

lunny commented Oct 13, 2020

But HTTP protocol push will miss that update?

@zeripath

Copy link
Member

@techknowlogick techknowlogick left a comment

Choose a reason for hiding this comment

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

blocking per @lunny Question.

@zeripath
Copy link
Contributor Author

No it won't - http push always runs the hooks too.

This is simply running update-server-info as part of post-receive (the modern equivalent of post-update where it is supposed to be run)

@lunny lunny dismissed techknowlogick’s stale review October 13, 2020 16:23

The problem is resolved.

@lunny lunny merged commit 2d75d6f into go-gitea:master Oct 13, 2020
@zeripath zeripath deleted the update-server-info-in-hook branch October 13, 2020 19:37
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
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. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants