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

Cache PullRequest Divergence #10914

Merged
merged 30 commits into from
Apr 14, 2020

Conversation

6543
Copy link
Member

@6543 6543 commented Apr 1, 2020

taken from #10905

@zeripath zeripath added this to the 1.12.0 milestone Apr 1, 2020
@zeripath zeripath added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Apr 1, 2020
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 1, 2020
services/pull/check.go Outdated Show resolved Hide resolved
services/pull/check.go Outdated Show resolved Hide resolved
@6543
Copy link
Member Author

6543 commented Apr 3, 2020

Tested Speed:
without: Page: 250ms Template: 105ms
cached: Page: 129ms Template: 93ms

Test setup:

  • created a new test repo with initialisazion
  • use webedit to edit a few lines to a new branch
  • create pull request
  • test page load speed of pull request

@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 Apr 4, 2020
@lafriks
Copy link
Member

lafriks commented Apr 4, 2020

Don't know why but tests fail

@6543

This comment has been minimized.

@6543

This comment has been minimized.

@6543
Copy link
Member Author

6543 commented Apr 8, 2020

@lafriks found reason 39e12ba

@codecov-io
Copy link

codecov-io commented Apr 8, 2020

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #10914   +/-   ##
=======================================
  Coverage   43.46%   43.47%           
=======================================
  Files         597      598    +1     
  Lines       84706    84774   +68     
=======================================
+ Hits        36820    36855   +35     
- Misses      43345    43380   +35     
+ Partials     4541     4539    -2     
Impacted Files Coverage Δ
models/migrations/migrations.go 3.50% <ø> (ø)
models/migrations/v136.go 0.00% <0.00%> (ø)
routers/repo/pull.go 34.10% <0.00%> (-0.40%) ⬇️
services/pull/pull.go 34.73% <47.82%> (+2.06%) ⬆️
models/pull.go 52.19% <70.00%> (+0.47%) ⬆️
services/pull/update.go 44.06% <0.00%> (-8.48%) ⬇️
models/issue.go 51.88% <0.00%> (+0.47%) ⬆️
modules/notification/webhook/webhook.go 40.20% <0.00%> (+0.58%) ⬆️
... and 3 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 cc4da79...0894c42. Read the comment docs.

@6543
Copy link
Member Author

6543 commented Apr 9, 2020

@lunny pleace look at code comments :)

@lafriks
Copy link
Member

lafriks commented Apr 10, 2020

Please resolve conflicts

@6543
Copy link
Member Author

6543 commented Apr 10, 2020

done

@6543
Copy link
Member Author

6543 commented Apr 13, 2020

@lunny do you have some time to look at it 🥺

routers/repo/pull.go Outdated Show resolved Hide resolved
@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 Apr 14, 2020
@6543
Copy link
Member Author

6543 commented Apr 14, 2020

ready to 🚀

@techknowlogick techknowlogick merged commit 10e2f29 into go-gitea:master Apr 14, 2020
@6543 6543 deleted the cache-pr-GetDiverging branch April 14, 2020 14:04
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
* Cache PullRequest Divergence

* only re-calc divergence if AddTestPullRequestTask() is exec

* migrate already open pulls

* finalize

* take care of closed&not-merged+deleted-branch pull requests

* fix nil pointer exeption

Signed-off-by: 6543 <[email protected]>

* try this

* no error its a warn

* init gitea-repositories-meta

* dont use gitDivergence type

* CI.restart()

* CI.restart()

* CI.restart()

* CI.restart()

* check IsUserAllowedToUpdate independend from CommitsBehind
@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/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants