Skip to content

User dashboard repositories filter incorrectly handles repos with NULL "is_archived" column #12037

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

Closed
2 of 7 tasks
oreineke opened this issue Jun 24, 2020 · 10 comments
Closed
2 of 7 tasks

Comments

@oreineke
Copy link

oreineke commented Jun 24, 2020

  • Gitea version (or commit ref): 1.12.1
  • Git version:
  • Operating system: Ubuntu 18.04
  • 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 have repos that have a NULL "is_archived" value in the "repositories" table, they are not shown if you filter for not-archived repositories in the user's dashboard repositories widget.

This is because the related SQL queries filter for "is_archived=false", which does not match NULL.

Repos that have a NULL "is_archived" value are those created before the archive feature was introduced in Gitea I suspect.

A possible solution might be to automatically migrate "is_archived=NULL" to "is_archived=false" in the "repositories" table.

@kolaente
Copy link
Member

I think migrating is_archived=NULL to is_archived=false is the way to go here.

@6543
Copy link
Member

6543 commented Jun 24, 2020

will create a pull

@mrsdizzie
Copy link
Member

mrsdizzie commented Jun 24, 2020

Hmm we did this:

#11853

Looks like you have to manually run doctor command for 1.12 to fix this issue

@6543
Copy link
Member

6543 commented Jun 24, 2020

@oreineke are you sure you are on 1.12.1 ?

@oreineke
Copy link
Author

Yes, I am sure, this is a copy and paste from the web page: "Powered by Gitea Version: 1.12.1"

@oreineke
Copy link
Author

Maybe also relevant: I am running Gitea in Docker, so I pulled image gitea/gitea:1.12 (before, I was running gitea/gitea:1.11).

@oreineke
Copy link
Author

oreineke commented Jun 24, 2020

On closer inspection I see in the "gitea doctor --all" output

[ 3 ] Check consistency of database
- 13 repositories with null is_archived
OK.

The "OK" is kind of misleading.

@oreineke
Copy link
Author

These are the Migrations I see in the log:

gitea.log:2020/06/24 08:46:14 ...ations/migrations.go:300:Migrate() [I] Migration[118]: Add commit id and stale to reviews
gitea.log:2020/06/24 08:46:16 ...ations/migrations.go:300:Migrate() [I] Migration[119]: Fix migrated repositories' git service type
gitea.log:2020/06/24 08:46:17 ...ations/migrations.go:300:Migrate() [I] Migration[120]: Add owner_name on table repository
gitea.log:2020/06/24 08:46:18 ...ations/migrations.go:300:Migrate() [I] Migration[121]: add is_restricted column for users table
gitea.log:2020/06/24 08:46:19 ...ations/migrations.go:300:Migrate() [I] Migration[122]: Add Require Signed Commits to ProtectedBranch
gitea.log:2020/06/24 08:46:20 ...ations/migrations.go:300:Migrate() [I] Migration[123]: Add original informations for reactions
gitea.log:2020/06/24 08:46:22 ...ations/migrations.go:300:Migrate() [I] Migration[124]: Add columns to user and repository
gitea.log:2020/06/24 08:46:22 ...ations/migrations.go:300:Migrate() [I] Migration[125]: Add some columns on review for migration
gitea.log:2020/06/24 08:46:23 ...ations/migrations.go:300:Migrate() [I] Migration[126]: Fix topic repository count
gitea.log:2020/06/24 08:46:23 ...ations/migrations.go:300:Migrate() [I] Migration[127]: add repository code language statistics
gitea.log:2020/06/24 08:46:26 ...ations/migrations.go:300:Migrate() [I] Migration[128]: fix merge base for pull requests
gitea.log:2020/06/24 08:46:26 ...ations/migrations.go:300:Migrate() [I] Migration[129]: remove dependencies from deleted repositories
gitea.log:2020/06/24 08:46:26 ...ations/migrations.go:300:Migrate() [I] Migration[130]: Expand webhooks for more granularity
gitea.log:2020/06/24 08:46:26 ...ations/migrations.go:300:Migrate() [I] Migration[131]: Add IsSystemWebhook column to webhooks table
gitea.log:2020/06/24 08:46:27 ...ations/migrations.go:300:Migrate() [I] Migration[132]: Add Branch Protection Protected Files Column
gitea.log:2020/06/24 08:46:27 ...ations/migrations.go:300:Migrate() [I] Migration[133]: Add EmailHash Table
gitea.log:2020/06/24 08:46:27 ...ations/migrations.go:300:Migrate() [I] Migration[134]: Refix merge base for merged pull requests
gitea.log:2020/06/24 08:46:27 ...ations/migrations.go:300:Migrate() [I] Migration[135]: Add OrgID column to Labels table
gitea.log:2020/06/24 08:46:27 ...ations/migrations.go:300:Migrate() [I] Migration[136]: Add CommitsAhead and CommitsBehind Column to PullRequest Table
gitea.log:2020/06/24 08:46:27 ...ations/migrations.go:300:Migrate() [I] Migration[137]: Add Branch Protection Block Outdated Branch
gitea.log:2020/06/24 08:46:27 ...ations/migrations.go:300:Migrate() [I] Migration[138]: Add ResolveDoerID to Comment table
gitea.log:2020/06/24 08:46:27 ...ations/migrations.go:300:Migrate() [I] Migration[139]: prepend refs/heads/ to issue refs
gitea.log:2020/06/24 08:46:27 ...ations/migrations.go:300:Migrate() [I] Migration[140]: Save detected language file size

@mrsdizzie
Copy link
Member

This is not a migration on Gitea 1.12 (see previously linked issue) thats why it was added to the doctor command. Looks like it worked based on the doctor output above?

@oreineke
Copy link
Author

oreineke commented Jun 24, 2020

OK, I see!

Running gitea doctor --all --fix just fixed it, thanks!

@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
None yet
Projects
None yet
Development

No branches or pull requests

5 participants