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 showing issues in your repositories #18916

Merged
merged 14 commits into from
Mar 23, 2022
Merged

Conversation

Gusted
Copy link
Contributor

@Gusted Gusted commented Feb 26, 2022

  • Make a restriction on which issues can be shown based on if you the user or team has write permission to the repository.
  • Fixes a issue whereby you wouldn't see any associated issues with a specific team on a organization if you wasn't a member(fixed by zeroing the User{ID} in the options).
  • Resolves Opening an issue in another repo shows all of them as "in my repos" #18913

@fnetX My local test instance isn't that complex as codeberg's, so I could've missed a edge case. Could you test this PR and see if this fixes the issue?

- Make a restriction on which issues can be shown based on if you the
user or team has write permission to the repository.
- Fixes a issue whereby you wouldn't see any associated issues with a
specific team on a organisation if you wasn't a member(fixed by zeroing
the User{ID} in the options).
- Resolves go-gitea#18913
@lunny
Copy link
Member

lunny commented Feb 26, 2022

I don't think it will ask you have write permissions.

We can define what's your repositories. I think below are the conditions:
a. You owned repositories
b. You are the collaborators of the repositories
c. You are in a team which have read permission to the issue unit of the repositories

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 26, 2022
@Gusted
Copy link
Contributor Author

Gusted commented Feb 26, 2022

Yeah the current wording is bad, I've pushed a comment which makes the conditions more clearly.

@codecov-commenter
Copy link

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #18916   +/-   ##
=======================================
  Coverage        ?   46.65%           
=======================================
  Files           ?      854           
  Lines           ?   122602           
  Branches        ?        0           
=======================================
  Hits            ?    57196           
  Misses          ?    58514           
  Partials        ?     6892           
Impacted Files Coverage Δ
routers/web/user/home.go 64.13% <65.11%> (ø)
models/issue.go 54.34% <100.00%> (ø)

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 6d55a13...654261c. Read the comment docs.

@fnetX
Copy link
Contributor

fnetX commented Feb 26, 2022

My local test instance isn't that complex as codeberg's, so I could've missed a edge case. Could you test this PR and see if this fixes the issue?

Yeah probably, but it seemed to be reproducibly simply. I for myself can test this at latest Monday.

models/issue.go Show resolved Hide resolved
Copy link
Contributor

@fnetX fnetX left a comment

Choose a reason for hiding this comment

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

Tested on Codeberg.org, seems to do what it should :)

routers/web/user/home.go Outdated Show resolved Hide resolved
@zeripath
Copy link
Contributor

Are you able to fix conflicts?

@Gusted
Copy link
Contributor Author

Gusted commented Mar 23, 2022

Luckily not a big conflict.

@GiteaBot GiteaBot removed the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 23, 2022
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Mar 23, 2022
@6543
Copy link
Member

6543 commented Mar 23, 2022

🚀

@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 Mar 23, 2022
@6543 6543 merged commit a5f2894 into go-gitea:main Mar 23, 2022
6543 pushed a commit to 6543-forks/gitea that referenced this pull request Mar 23, 2022
- Make a restriction on which issues can be shown based on if you the user or team has write permission to the repository.
- Fixes a issue whereby you wouldn't see any associated issues with a specific team on a organization if you wasn't a member(fixed by zeroing the User{ID} in the options).
- Resolves go-gitea#18913
@6543 6543 added the backport/done All backports for this PR have been created label Mar 23, 2022
@6543
Copy link
Member

6543 commented Mar 23, 2022

-> #19191

6543 added a commit that referenced this pull request Mar 23, 2022
- Make a restriction on which issues can be shown based on if you the user or team has write permission to the repository.
- Fixes a issue whereby you wouldn't see any associated issues with a specific team on a organization if you wasn't a member(fixed by zeroing the User{ID} in the options).
- Resolves #18913

Co-authored-by: Gusted <williamzijl7@hotmail.com>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 24, 2022
* giteaofficial/main:
  Bump minimist from 1.2.5 to 1.2.6 (go-gitea#19194)
  Changelog for 1.16.5 (go-gitea#19189) (go-gitea#19192)
  Fix showing issues in your repositories (go-gitea#18916)
  Update issue_no_dependencies description (go-gitea#19112)
  Prevent redirect to Host (2) (go-gitea#19175)
  Prevent start panic due to missing DotEscape function
  Fix compare link in active feeds for new branch (go-gitea#19149)
  Redirect .wiki/* ui link to /wiki (go-gitea#18831)
  Try to prevent autolinking of displaynames by email readers (go-gitea#19169)
  Update HTTP status codes to modern codes (go-gitea#18063)
@Gusted Gusted deleted the fix-your-repo branch March 26, 2022 13:29
@zeripath zeripath mentioned this pull request Mar 27, 2022
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
- Make a restriction on which issues can be shown based on if you the user or team has write permission to the repository.
- Fixes a issue whereby you wouldn't see any associated issues with a specific team on a organization if you wasn't a member(fixed by zeroing the User{ID} in the options).
- Resolves go-gitea#18913
@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
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Opening an issue in another repo shows all of them as "in my repos"
7 participants