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

Archived repos visible on issues overview page #13171

Closed
2 of 7 tasks
tinxx opened this issue Oct 16, 2020 · 6 comments · Fixed by #13220
Closed
2 of 7 tasks

Archived repos visible on issues overview page #13171

tinxx opened this issue Oct 16, 2020 · 6 comments · Fixed by #13220
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@tinxx
Copy link

tinxx commented Oct 16, 2020

  • Gitea version (or commit ref): 1.12.5
  • Git version: 2.26.2
  • Operating system: Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

If you archive a repo it is still taken into account for the issue overview at /issues.

I would expect it to be hidden like it is hidden e.g. from the repo list on the dashboard.

Screenshots

Screenshot_2020-10-16 Gitea Git with a cup of tea

Screenshot_2020-10-16 Repo_B

@eneuschild
Copy link
Contributor

eneuschild commented Oct 16, 2020

Some noob questions on how to tackle this:

  • Apparently, the code that corresponds to this feature is a 360-lines-long function. Would it be acceptable for me to refactor this into several smaller funcs, before I hunt down the actual bug?
    • If so, would I make two separate PRs for the refac and the bug fix?
  • Am I right in assuming that, in order to filter issues, I'd use the IssuesOptions, and extend those with a field like DisallowArchived make sure the RepoIDs in there don't contain archived repos?

@zeripath
Copy link
Contributor

zeripath commented Oct 16, 2020

@eneuschild if you can refactor it I'd say do so - but you may find yourself having to deal with the law of unintended consequences multiple steps along the way and you'll find multiple stylistic differences between the various reviewers.

  • One thing I would recommend is to spread comments liberally through the code first to explain what you understand is going on, especially if the code is not immediately understandable. Whole sections of code might need preceding paragraphs to explain what they're doing. (You're spending all of this time to understand this code so you may as well help others)
  • Once you have a good grasp of each bit consider if the piece of code you're seeing could be a function.
  • I personally would prefer if we avoided functions that write to the ctx with ctx.ServerError(), ctx.HTML() or the like unless they're terminal and genuinely taking over the control flow. If you can avoid these please do! If you pass the modules/context/context.Context to a function you either need to follow a call to it with
_, ...  = fn(ctx, ...)
if ctx.Written() {
  return
}
// do stuff with your _, ...

Or write in a comment on the function something along the lines of // DO NOT WRITE TO THE CONTEXT. (I do wonder if we can use the type system to fix this.)

In terms of one or two PRs - it might be reasonable to open two but ensure that the second contains the first. The other thing is that a nice clean history in refactor case would be (at least until someone has reviewed) Rewrite your history using rebase if necessary to make the commits look clean and logical. Once someone has reviewed though please ask reviewers before rebasing as it especially with large reviews it can make it very difficult indeed.

@lunny
Copy link
Member

lunny commented Oct 17, 2020

Should this be a filter option or just hide all archived repositories?

@eneuschild
Copy link
Contributor

Should this be a filter option or just hide all archived repositories?

Since this is about the issues overview, I'd say entirely hiding issues from archived repos is a good way to go.

@stale
Copy link

stale bot commented Dec 19, 2020

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale stale bot added the issue/stale label Dec 19, 2020
@tinxx
Copy link
Author

tinxx commented Dec 19, 2020

There is a Merge Request being worked on so this issue is not stale. Thanks @eneuschild :)
Just posting this to keep the bot happy...

@stale stale bot removed the issue/stale label Dec 19, 2020
@lunny lunny added type/proposal The new feature has not been accepted yet but needs to be discussed first. issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented labels Dec 19, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Mar 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants