8000 Issues overview should not show issues from archived repos by eneuschild · Pull Request #13220 · go-gitea/gitea · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Issues overview should not show issues from archived repos #13220

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

Merged
merged 42 commits into from
Jan 13, 2021

Conversation

eneuschild
Copy link
Contributor

Context

I'd like to fix #13171.

As discussed there, I feel some refactoring is in order in the function user.Issues().
Following @zeripath's advice, I'm starting with some comments throughout the function.


Stylistic question

There are 4 routes that call the functionuser.Issues():

  • /issues
  • /pulls
  • /org/{orgID}/issues
  • /org/{orgID}/pulls

Since the function then painstakingly distinguishes between those four cases, wouldn't it be nicer to have four separate functions as entrypoints, that first do their respective things and then call a (new) function containing the code they have in common?

@codecov-io
Copy link
codecov-io commented Oct 20, 2020

Codecov Report

Merging #13220 (2992f54) into master (74a0481) will decrease coverage by 0.00%.
The diff coverage is 53.53%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13220      +/-   ##
==========================================
- Coverage   41.79%   41.79%   -0.01%     
==========================================
  Files         744      744              
  Lines       79538    79620      +82     
==========================================
+ Hits        33246    33278      +32     
- Misses      40818    40860      +42     
- Partials     5474     5482       +8     
Impacted Files Coverage Δ
models/org.go 70.58% <0.00%> (-1.93%) ⬇️
routers/user/home.go 59.70% <50.69%> (-0.30%) ⬇️
models/user.go 53.85% <75.86%> (-0.68%) ⬇️
models/issue.go 57.19% <100.00%> (+0.18%) ⬆️
routers/routes/macaron.go 93.22% <100.00%> (+0.02%) ⬆️
modules/util/timer.go 42.85% <0.00%> (-42.86%) ⬇️
modules/secret/secret.go 66.66% <0.00%> (-7.41%) ⬇️
modules/indexer/stats/db.go 56.00% <0.00%> (-4.00%) ⬇️
models/repo_permission.go 74.31% <0.00%> (-2.76%) ⬇️
modules/git/repo_commit_nogogit.go 63.33% <0.00%> (-1.67%) ⬇️
... 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 9659808...2992f54. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 20, 2020
@eneuschild
Copy link
Contributor Author
eneuschild commented Oct 22, 2020

It seemed like a good idea to me to pull (--rebase) master into this branch, which I did.
Obviously, this is making things messy and was probably wrong.

If it was wrong, I'd rather throw this PR away and start a new one.


Sorry about this, I'm still rather new to github. :(

@6543
Copy link
Member
6543 commented Oct 22, 2020

@eneuschild the best way to update a pull with changes from master is:

  1. fetch/pull upstream-master to your local repo
  2. merge master into your feature branch git merge --no-ff master

this way you dont have to force push <- witch make reviews inconvinient & you dont see all the commits from master here in this branch :)

@6543
Copy link
Member
6543 commented Oct 22, 2020

@eneuschild if you already messed up ... the best thing is a rebase and force push then

  1. fetch upstream master
  2. git rebase master issue_13171
  3. git push -f own issue_13171

@6543
Copy link
Member
6543 commented Oct 22, 2020

@eneuschild the best way to update a pull with changes from master is:
1. fetch/pull upstream-master to your local repo
2. merge master into your feature branch git merge --no-ff master
...

the "Update Branch" button on github is doing the same thing - but dont forget to pull to your local repo afterwards before commiting new stuff :)

Copy link
Contributor Author
@eneuschild eneuschild left a comment

Choose a reason for hiding this comment

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

@eneuschild the best way to update a pull with changes from master is:

  1. fetch/pull upstream-master to your local repo
  2. merge master into your feature branch git merge --no-ff master
    ...

the "Update Branch" button on github is doing the same thing - but dont forget to pull to your local repo afterwards before commiting new stuff :)

Alrighty, thank you!