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

compare/create PR produces a 404 #6302

Closed
2 of 7 tasks
philfry opened this issue Mar 11, 2019 · 42 comments · Fixed by #6871
Closed
2 of 7 tasks

compare/create PR produces a 404 #6302

philfry opened this issue Mar 11, 2019 · 42 comments · Fixed by #6871
Assignees
Labels
Milestone

Comments

@philfry
Copy link
Contributor

philfry commented Mar 11, 2019

  • Gitea version (or commit ref): 1.7.3
  • Git version: 2.21.0
  • Operating system: CentOS 7
  • 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

when trying to create a PR gitea shows a 404.
Happens both on

No relevant entries in the log files.

After downgrading to 1.7.2 everything works fine again.

Screenshots

@ptman
Copy link
Contributor

ptman commented Mar 15, 2019

My log which apparently is related to this issue and not #6225 : https://gist.github.com/ptman/f76b398d0503e5c50424c1ea8cbfafec .

The permissions should be correct. It worked nicely with 1.7.2. How can I check? I haven't been able to figure out a URL that would work. I mostly end up on the 404 page by following the URL that's returned via git command line, but also create new pull request takes me to the same 404 URL.

@zeripath
Copy link
Contributor

OK so this issue is related to:

5c30817

Which was reverted by:

fe99c99

This bug report appears to be related to workflows for which original commit worked and its reversion breaks.

@zeripath
Copy link
Contributor

Related bug reports are #3727, #5924

@zeripath
Copy link
Contributor

OK @ptman,

I assume from your statements you're trying to try do a PR from a user's forked repository on to an organisation's private repository?

Is the user a member of a team in the organisation and is that repository in that team? Does that team have permission to read pull requests? Could you check whether the PR url works if you happen to be an admin?

Presumably the PR url is the same on v1.7.2 and v1.7.4? If not could you paste the differences?

@ptman
Copy link
Contributor

ptman commented Mar 15, 2019

Yes, the URL is exactly the same. The user is an admin and owners team in organisation. Should have all permissions.

@zeripath
Copy link
Contributor

Just check that a) the user is in the team b) the repository is in the team and c) that the team has permission to read pull requests.

It's notable that there are two things that change between 1.7.2 and 1.7.4: the permission check, and possibly the URL.

If you tell me that the URL is the same on 1.7.2 then it must be the permission check.

@ptman
Copy link
Contributor

ptman commented Mar 15, 2019

Yes, I understood you the first time. My user is an admin according to site administration. There is only one team in the organisation. The default team called owners. My user is part of that team. That team has administrator access to the organisation.

The URL is the very same. It's shown in the logs. I sanitized it by renaming the organization to org etc., but didn't change the structure otherwise

@zeripath
Copy link
Contributor

Hi @ptman, Sorry I think I got distracted with a few other things.

OK. So where did we get to?

The fact that it's 404 and #6098 is implicated places this at:

https://github.com/zeripath/gitea/blob/189b3341dcbab2b13feeea4117910c85d1f772f4/routers/repo/pull.go#L687-L691

You could confirm this by setting log to Trace.

@morph027
Copy link

Ran into the same with 1.7.5 (did the very loooooooong upgrade from Gogs this weekend, using all versions in between).

log level set to trace:

2019/04/13 17:29:39 [T] ParseCompareInfo[5]: cannot create/read pull requests
2019/04/13 17:29:39 [D] Template: status/404

Will check the downgrade to 1.7.2

@morph027
Copy link

(Dirty) Downgrade to 1.7.2 worked.... (without DB restore from 1.7.2)

@zeripath
Copy link
Contributor

aha Thank you @morph027

Now before you suggest staying on 1.7.2 - there is a major security bug in Gogs and Gitea earlier than 1.7.6 so I think we need to fix this.

@zeripath
Copy link
Contributor

OK so here's a good test. Your user who can't create a pull on 1.7.5 - can they create comments on a pull that they did not post? Because that's the same test that is being used from 1.7.4.

@morph027
Copy link

Hi!

Thanks for your answer. Yes, just tried and i was able to comment on another users PR.

@zeripath
Copy link
Contributor

zeripath commented Apr 14, 2019

Ok that's extremely odd. Here's the test involved (L1158):

gitea/routers/repo/issue.go

Lines 1152 to 1167 in c168095

func NewComment(ctx *context.Context, form auth.CreateCommentForm) {
issue := GetActionIssue(ctx)
if ctx.Written() {
return
}
if !ctx.IsSigned || (ctx.User.ID != issue.PosterID && !ctx.Repo.CanReadIssuesOrPulls(issue.IsPull)) {
ctx.Error(403)
}
if issue.IsLocked && !ctx.Repo.CanWrite(models.UnitTypeIssues) && !ctx.User.IsAdmin {
ctx.Flash.Error(ctx.Tr("repo.issues.comment_on_locked"))
ctx.Redirect(issue.HTMLURL(), http.StatusSeeOther)
return
}

That's very odd that that would succeed but this fails:

gitea/routers/repo/pull.go

Lines 701 to 707 in c168095

perm, err := models.GetUserRepoPermission(headRepo, ctx.User)
if err != nil {
ctx.ServerError("GetUserRepoPermission", err)
return nil, nil, nil, nil, "", ""
}
if !perm.CanReadIssuesOrPulls(true) {
log.Trace("ParseCompareInfo[%d]: cannot create/read pull requests", baseRepo.ID)

@zeripath
Copy link
Contributor

No this really doesn't make sense. Let's break down L1158:

if !ctx.IsSigned || (ctx.User.ID != issue.PosterID && !ctx.Repo.CanReadIssuesOrPulls(issue.IsPull)) {

Looking at the definition of ctx.Repo:

// Repository contains information to operate a repository
type Repository struct {
models.Permission
IsWatching bool
IsViewBranch bool
IsViewTag bool
IsViewCommit bool
Repository *models.Repository
Owner *models.User
Commit *git.Commit
Tag *git.Tag
GitRepo *git.Repository
BranchName string
TagName string
TreePath string
CommitID string
RepoLink string
CloneLink models.CloneLink
CommitsCount int64
Mirror *models.Mirror
PullRequest *PullRequest
}

We see that ctx.Repo has an embedded models.Permission so how is that set?

Within repoAssignment in the same file we see:

ctx.Repo.Permission, err = models.GetUserRepoPermission(repo, ctx.User)

And this is called from RepoAssignment

repoAssignment(ctx, repo)

Which is a handler wrapped around /:username/:reponame

This is a equivalent to if !perm.CanReadIssuesOrPulls(true)) { if you're not the original poster of a PR so how can this work?

I genuinely don't understand why if you can comment on a PR on the head repo you can't do the pull-request.

@morph027
Copy link

Weird, of course.

Comment on PR (which works):

[Macaron] 2019-04-14 09:07:16: Started POST /organization/repository/issues/192/comments for x.x.x.x
...
[Macaron] 2019-04-14 09:07:17: Completed POST /organization/repository/issues/192/comments 302 Found in 390.850882ms

Trying to create a PR:

[Macaron] 2019-04-14 09:09:06: Started GET /organization/repository/compare/master...my-fork:ci for x.x.x.x
...
2019/04/14 09:09:06 [T] ParseCompareInfo[58824]: cannot create/read pull requests
2019/04/14 09:09:06 [D] Template: status/404
[Macaron] 2019-04-14 09:09:06: Completed GET /organization/repository/compare/master...my-fork:ci 404 Not Found in 99.870623ms

@morph027
Copy link

BTW....as this was an migration from Gogs, we do have warnings (which should be safe to ignore as i've read on other issues):

2019/04/14 09:12:33 [W] Table user Column must_change_password db default is 0, struct default is false
2019/04/14 09:12:33 [W] Table user Column allow_create_organization db default is , struct default is true
2019/04/14 09:12:33 [W] Table user Column prohibit_login db default is 0, struct default is false
2019/04/14 09:12:33 [W] Table repository Column is_fork db default is 0, struct default is false
2019/04/14 09:12:33 [W] Table repository Column size db default is , struct default is 0
2019/04/14 09:12:33 [W] Table repository Column size db nullable is true, struct nullable is false
2019/04/14 09:12:33 [W] Table repository Column is_fsck_enabled db default is 1, struct default is true
2019/04/14 09:12:33 [W] Table action Column is_deleted db default is 0, struct default is false
2019/04/14 09:12:33 [W] Table action Column is_private db default is 0, struct default is false
2019/04/14 09:12:33 [W] Table mirror Column enable_prune db default is 1, struct default is true
2019/04/14 09:12:33 [W] Table release Column is_draft db default is 0, struct default is false
2019/04/14 09:12:33 [W] Table release Column is_prerelease db default is , struct default is false
2019/04/14 09:12:33 [W] Table release Column is_prerelease db nullable is true, struct nullable is false
2019/04/14 09:12:33 [W] Table release Column is_tag db default is 0, struct default is false
2019/04/14 09:12:33 [W] Table login_source Column is_actived db default is 0, struct default is false
2019/04/14 09:12:33 [W] Table login_source Column is_sync_enabled db default is 0, struct default is false
2019/04/14 09:12:33 [W] Table protected_branch Column can_push db default is 0, struct default is false
2019/04/14 09:12:33 [W] Table protected_branch Column enable_merge_whitelist db default is 0, struct default is false
2019/04/14 09:12:33 [W] Table user_open_id Column show db default is 0, struct default is false
2019/04/14 09:12:33 [W] Table deleted_branch Column deleted_by_id db nullable is false, struct nullable is true
2019/04/14 09:12:33 [W] Table repo_indexer_status Column repo_id db nullable is false, struct nullable is true
2019/04/14 09:12:33 [W] Table review column type db type is VARCHAR(255), struct type is INT
2019/04/14 09:12:33 [W] Table comment has column old_assignee_id but struct has not related field
2019/04/14 09:12:33 [W] Table hook_task has column signature but struct has not related field
2019/04/14 09:12:33 [W] Table issue_user has column repo_id but struct has not related field
2019/04/14 09:12:33 [W] Table issue_user has column milestone_id but struct has not related field
2019/04/14 09:12:33 [W] Table issue_user has column is_poster but struct has not related field
2019/04/14 09:12:33 [W] Table issue_user has column is_closed but struct has not related field
2019/04/14 09:12:33 [W] Table repository has column enable_wiki but struct has not related field
2019/04/14 09:12:33 [W] Table repository has column enable_external_wiki but struct has not related field
2019/04/14 09:12:33 [W] Table repository has column external_wiki_url but struct has not related field
2019/04/14 09:12:33 [W] Table repository has column enable_issues but struct has not related field
2019/04/14 09:12:33 [W] Table repository has column enable_external_tracker but struct has not related field
2019/04/14 09:12:33 [W] Table repository has column external_tracker_format but struct has not related field
2019/04/14 09:12:33 [W] Table repository has column external_tracker_style but struct has not related field
2019/04/14 09:12:33 [W] Table repository has column enable_pulls but struct has not related field
2019/04/14 09:12:33 [W] Table repository has column external_tracker_url but struct has not related field
2019/04/14 09:12:33 [W] Table repository has column allow_public_wiki but struct has not related field
2019/04/14 09:12:33 [W] Table repository has column allow_public_issues but struct has not related field
2019/04/14 09:12:33 [W] Table repository has column pulls_ignore_whitespace but struct has not related field
2019/04/14 09:12:33 [W] Table repository has column pulls_allow_rebase but struct has not related field
2019/04/14 09:12:33 [W] Table two_factor has column user_id but struct has not related field

But as this is totaly weird, probably there's something buried deep in it.

@lunny
Copy link
Member

lunny commented Apr 14, 2019

@morph027 does that user have the permission of reading code on this repository?

@lafriks lafriks added this to the 1.8.0 milestone Apr 14, 2019
@morph027
Copy link

Yes, i can browse the web repo view and clone the repo using git.

@zeripath
Copy link
Contributor

Ok I've put up a pr to 1.9 to heavily log.Trace all permissions and denials.

It's #6618

One thing I've noticed looking at this code is that the wrong repo id is returned on that trace message you've got but that's by the by.

If you are able to could you build this pr #6618, take a safe copy of your db and test again with trace on to get the permissions?

On master you can target your logs so that all the trace logs don't appear eg:

[log]
Mode=console,permissiontrace
Level=info
Redirect_macaron_log=true
Xorm=file

[log.permissiontrace]
Mode=console
Level=trace
Expression=permission

Making it easier to see what you're looking for.

@morph027
Copy link

Thanks, will try tonight (or probably spawn a test clone).

@morph027
Copy link

morph027 commented Apr 15, 2019

Pulled 1.9-dev branch, applied the PR, built and tested:

404 when comparing

2019/04/15 19:28:14 ...s/repo_permission.go:154:func1() [T] Permission Loaded for 824724842144:my-user in 824724842224:organization/repository:
	Permissions: AccessMode: 824724842784:owner, 5 Units, 0 UnitsMode(s): [ 
	Units[0]: ID: 824724842320 RepoID: 824724842352 Type: 824724842816:UnitTypeCode Config: {}
	Units[1]: ID: 824724842416 RepoID: 824724842448 Type: 824724842848:UnitTypeIssues Config: {"EnableTimetracker":true,"AllowOnlyContributorsToTrackTime":true,"EnableDependencies":false}
	Units[2]: ID: 824724842512 RepoID: 824724842544 Type: 824724842880:UnitTypePullRequests Config: {"IgnoreWhitespaceConflicts":false,"AllowMerge":true,"AllowRebase":true,"AllowRebaseMerge":true,"AllowSquash":true}
	Units[3]: ID: 824724842608 RepoID: 824724842640 Type: 824724842912:UnitTypeReleases Config: {}
	Units[4]: ID: 824724842704 RepoID: 824724842736 Type: 824724842944:UnitTypeWiki Config: {} ]
2019/04/15 19:28:14 ...s/repo_permission.go:154:func1() [T] Permission Loaded for 824707101920:my-user in 824707102096:%!s(*interface {}=0xc0045fb570)/repository:
	Permissions: AccessMode: 824707102592:owner, 2 Units, 0 UnitsMode(s): [ 
	Units[0]: ID: 824707102304 RepoID: 824707102416 Type: 824707102640:UnitTypeCode Config: {}
	Units[1]: ID: 824707102512 RepoID: 824707102544 Type: 824707102704:UnitTypeReleases Config: {} ]

everyhing ok when commenting

2019/04/15 19:29:38 ...s/repo_permission.go:154:func1() [T] Permission Loaded for 824714147584:my-user in 824714147664:organization/repository:
	Permissions: AccessMode: 824714148224:owner, 5 Units, 0 UnitsMode(s): [ 
	Units[0]: ID: 824714147760 RepoID: 824714147792 Type: 824714148256:UnitTypeCode Config: {}
	Units[1]: ID: 824714147856 RepoID: 824714147888 Type: 824714148288:UnitTypeIssues Config: {"EnableTimetracker":true,"AllowOnlyContributorsToTrackTime":true,"EnableDependencies":false}
	Units[2]: ID: 824714147952 RepoID: 824714147984 Type: 824714148320:UnitTypePullRequests Config: {"IgnoreWhitespaceConflicts":false,"AllowMerge":true,"AllowRebase":true,"AllowRebaseMerge":true,"AllowSquash":true}
	Units[3]: ID: 824714148048 RepoID: 824714148080 Type: 824714148352:UnitTypeReleases Config: {}
	Units[4]: ID: 824714148144 RepoID: 824714148176 Type: 824714148384:UnitTypeWiki Config: {} ]
2019/04/15 19:29:38 ...s/repo_permission.go:154:func1() [T] Permission Loaded for 824716177024:another-user in 824716177104:organization/repository:
	Permissions: AccessMode: 824716177664:owner, 5 Units, 0 UnitsMode(s): [ 
	Units[0]: ID: 824716177200 RepoID: 824716177232 Type: 824716177696:UnitTypeCode Config: {}
	Units[1]: ID: 824716177296 RepoID: 824716177328 Type: 824716177728:UnitTypeIssues Config: {"EnableTimetracker":true,"AllowOnlyContributorsToTrackTime":true,"EnableDependencies":false}
	Units[2]: ID: 824716177392 RepoID: 824716177424 Type: 824716177760:UnitTypePullRequests Config: {"IgnoreWhitespaceConflicts":false,"AllowMerge":true,"AllowRebase":true,"AllowRebaseMerge":true,"AllowSquash":true}
	Units[3]: ID: 824716177488 RepoID: 824716177520 Type: 824716177792:UnitTypeReleases Config: {}
	Units[4]: ID: 824716177584 RepoID: 824716177616 Type: 824716177824:UnitTypeWiki Config: {} ]

(redacted the real values to my-user, organization and repository)

@zeripath
Copy link
Contributor

zeripath commented Apr 15, 2019

Did you change the id numbers too? I actually needed those to compare against, oh and could I get the permission denied logs too.

@zeripath
Copy link
Contributor

zeripath commented Apr 15, 2019

Now this bit is interesting:

Permission Loaded for 824707101920:my-user in 824707102096:%!s(*interface {}=0xc0045fb570)/repository

Why is %!s(*interface {}=0xc0045fb570) happening? It could mean that the owner is not a user here, (or theres a mistake in my code.)

But if you look at the permissions that you're receiving it only has Code and Releases. I suspect it's a Team? I'd have to go back and add some more code to the PR I think to determine it though.

Now the units returned here are interesting because they're precisely the reason the permissions is failing - it is testing if you can read UnitTypePullRequests. So is it possible adjust the team permissions?

I'll add some more things to #6618 to hopefully figure out what the 824707102096:%!s(*interface {}=0xc0045fb570) could be.

@morph027
Copy link

Hi!

No, i did not change the ids. This happens to users in team, yes.

@zeripath
Copy link
Contributor

I think this was missed in my earlier comment - your team doesn't appear to have the read pulls unit for the head repository. Could you check? It might be that you need to turn it off save and then put it back on in case this was an error in schema migration.

Could you also try adding a new team to see if that new team has permission too?

Many thanks

@morph027
Copy link

Ah, okay, sorry ;)

Doublechecked the permissions, removed, saved, added and saved again (see screenshots). Read Pull exists for the Team within the Organization which owns the repo.

screenshot

Screenshot from 2019-04-17 09-05-24

@morph027
Copy link

Just created a a local test clone and tried to reproduce our git:

  • created a new organization (me as owner)
  • created a repo inside this org.
  • forked into my users namespace
  • tried to create a PR and it works 🎉

So there must be something inside the database regarding all the "old" (migrated) repos. I'll try to create a useful database diff between a non-working and this working repo.

@morph027
Copy link

  • created a new repo within an existing organization (where the other "broken" repos are located too)
  • created a fork
  • bam, comparing works 🎉

So the old repos do have something which is bogus.

@morph027
Copy link

Deleting and re-forking the repos also make PRs work again. I can try to debug further (got multiple sql dumps to compare to each other), but for now, deleting and forking again looks like valid option (especially when using the API).

@zeripath
Copy link
Contributor

OK, I might drop my PR #6607 then. @ptman has @morph027 given you any ideas about what is odd with your teams?

@lunny lunny modified the milestones: 1.8.0, 1.8.1 Apr 22, 2019
@ptman
Copy link
Contributor

ptman commented Apr 23, 2019

What should I change for the repo (in the DB, using SQL) so that I don't have to remove the repo?

@morph027
Copy link

morph027 commented Apr 23, 2019

Not sure, still trying to figure out. This is the diff after re-creating the fork:

$ diff -Naur gitea-1.7.6-old-fork.sql gitea-1.7.6-new-fork.sql

--- gitea-1.7.6-old-fork.sql	2019-04-23 11:55:40.000000000 +0200
+++ gitea-1.7.6-new-fork.sql	2019-04-23 11:53:52.000000000 +0200

-INSERT INTO `repo_unit` VALUES (4879,60396,1,'{}',1555586779);
-INSERT INTO `repo_unit` VALUES (4881,60396,4,'{}',1555586779);
+INSERT INTO `repo_unit` VALUES (6919,61117,1,NULL,1556013194);
+INSERT INTO `repo_unit` VALUES (6920,61117,2,'{\"EnableTimetracker\":true,\"AllowOnlyContributorsToTrackTime\":true,\"EnableDependencies\":true}',1556013194);
+INSERT INTO `repo_unit` VALUES (6921,61117,3,'{\"IgnoreWhitespaceConflicts\":false,\"AllowMerge\":true,\"AllowRebase\":true,\"AllowRebaseMerge\":true,\"AllowSquash\":true}',1556013194);
+INSERT INTO `repo_unit` VALUES (6922,61117,4,NULL,1556013194);
+INSERT INTO `repo_unit` VALUES (6923,61117,5,NULL,1556013194);

-INSERT INTO `repository` VALUES (60396,21,'repo-name','repo-name','','','master',0,0,0,0,0,0,0,0,0,1,0,0,0,0,'',0,0,'','numeric',0,1,5,1541068250,1552487739,66701312,'',0,0,0,0,1,NULL);
+INSERT INTO `repository` VALUES (61117,21,'repo-name','repo-name','','','master',1,0,0,0,0,0,0,0,0,1,0,0,1,NULL,NULL,1,NULL,NULL,NULL,1,1,5,1556013194,1556013195,65684480,NULL,NULL,NULL,0,0,0,'null');

-INSERT INTO `user` VALUES (21,'user-name','user-name','','user-mail','[redacted]',0,0,'',0,'','','[redacted]','[redacted]',1541066617,1555587133,1,-1,1,0,0,0,0,'[redacted]','user-mail',1,0,0,0,134,'',0,0,1555587133,'',1,0,NULL,0);
+INSERT INTO `user` VALUES (21,'user-name','user-name','','user-mail','[redacted]',0,0,'',0,'','','[redacted]','[redacted]',1541066617,1556013194,1,-1,1,0,0,0,0,'[redacted]','user-mail',1,0,0,0,134,'',0,0,1556013076,'unified',1,0,'en-US',0);

+INSERT INTO `watch` VALUES (3031,21,61117);

@morph027
Copy link

The repository table itself does not change much besides having the proper default values in some columns.

Interesting that the repo_unit table is only losing 2 entries but get's 5 after the new fork exists.

No changes in the access table.

@zeripath any useful hints in this diff?

@lunny
Copy link
Member

lunny commented May 6, 2019

It's so strange. Create repository or fork repository will also insert defaultRepoUnits into repo_unit. It should be 5 records not 2 whatever v1.7.2 or v1.7.6

	defaultRepoUnits = []UnitType{
		UnitTypeCode,
		UnitTypeIssues,
		UnitTypePullRequests,
		UnitTypeReleases,
		UnitTypeWiki,
	}

@techknowlogick techknowlogick modified the milestones: 1.8.1, 1.8.2 May 6, 2019
@ptman
Copy link
Contributor

ptman commented May 7, 2019

I have removed some features for my fork so I only have UnitTypeCode and UnitTypeReleases on my fork. But how could I check the permissions from the database? The fork was created ages ago. Was there previously some problem with setting the correct permissions on a fork?

@lunny
Copy link
Member

lunny commented May 7, 2019

So that's maybe a bug, we should check the original repository's UnitTypePullRequest but not forked repository's.

@ptman
Copy link
Contributor

ptman commented May 7, 2019

Yes, that's correct. By adding PRs to my fork, 404s disappear.

@philfry
Copy link
Contributor Author

philfry commented May 7, 2019

fwiw, here's what the mysql server's query log shows when I open a compare/master...mylogin/mybranch url using gitea 1.8.0, which results in a 404:

--------------
SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `description`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `id`=2 LIMIT 1
--------------

2	mylogin	mylogin	My Name	my@email.example	0	mypasswordhash	0	2	1	mylogin	0			x	x	de-DE	1499335597	1557232808	1557231966	0	-1	1	1	1	1	1	0	somehash	my@email.example	1	1	1	2	3	00	0	unified	
--------------
SELECT count(*) FROM `notification` WHERE (user_id = 2) AND (status = 1)
--------------

0
--------------
SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `description`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `lower_name`='myorganization' LIMIT 1
--------------

3	myorganization	myorganization			0		0	0	0		1			x	x	NULL	1499335669	1518184298	0	1	-1	1	0	0	0	0	0	someotherhash		1	0	0	0	1		2	4	0	
--------------
SELECT `id`, `owner_id`, `lower_name`, `name`, `description`, `website`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_empty`, `is_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE `owner_id`=3 AND `lower_name`='my_baserepo' LIMIT 1
--------------

2	3	my_baserepo	my_baserepo			master	4	1	4	9	7	321	316	0	0	0	0	NULL	0	0	037898240	1	0	null	1499335881	1556542903
--------------
SELECT `id`, `repo_id`, `type`, `config`, `created_unix` FROM `repo_unit` WHERE (repo_id = 2)
--------------

115	2	1	{}	1524228124
117	2	3	{"AllowMerge":true,"AllowRebase":true,"AllowRebaseMerge":true,"AllowSquash":true,"IgnoreWhitespaceConflicts":false}	1524228124
116	2	4	{}	1524228124
--------------
SELECT count(*) FROM `release` WHERE repo_id=2 AND is_draft=0
--------------

0
--------------
SELECT `id`, `owner_id`, `lower_name`, `name`, `description`, `website`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_empty`, `is_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE (owner_id=2 AND fork_id=2) LIMIT 1
--------------

6	2	my_baserepo	my_baserepo			master	1	1	0	0	0	0	0	0	0	0	0	NULL	0	1	239924736	1	0	null	1499346520	1556800069
--------------
SELECT * FROM `user` INNER JOIN `team_user` ON `team_user`.org_id=`user`.id INNER JOIN `team` ON `team`.id=`team_user`.team_id WHERE (`team_user`.uid=2) AND (`team`.authorize=4) ORDER BY `user`.`name` ASC
--------------

3	myorganization	myorganization			0		0	0		1			x	x	1499335669	1518184298	01	-1	1	0	0	0	0	0	someotherhash		1	0	0	0	1		2	4		NULL	0		01	3	1	2	1	3	owners	Owners		4	1	2
4	anotherorga	anotherorga			0		0	0		1			x	x	1499335676	1513347490	00	-1	1	0	0	0	0	0	yetanotherhash		1	0	0	0	0		1	2		NULL	0		02	4	2	2	2	4	owners	Owners		4	0	2
--------------
SELECT `id`, `owner_id`, `lower_name`, `name`, `description`, `website`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_empty`, `is_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE (owner_id=4 AND fork_id=2) LIMIT 1
--------------

--------------
SELECT `id`, `user_id`, `repo_id` FROM `watch` WHERE `user_id`=2 AND `repo_id`=2 LIMIT 1
--------------

2	2	2
--------------
SELECT `id`, `uid`, `repo_id` FROM `star` WHERE `uid`=2 AND `repo_id`=2 LIMIT 1
--------------

1	2	2
--------------
SELECT `id`, `owner_id`, `lower_name`, `name`, `description`, `website`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_empty`, `is_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE (owner_id=2 AND fork_id=2) LIMIT 1
--------------

6	2	my_baserepo	my_baserepo			master	1	1	0	0	0	0	0	0	0	0	0	NULL	0	1	239924736	1	0	null	1499346520	1556800069
--------------
SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `description`, `num_teams`, `num_members`, `visibility`, `diff_view_style`, `theme` FROM `user` WHERE `lower_name`='mylogin' LIMIT 1
--------------

2	mylogin	mylogin	My Name	my@email.example	0	mypasswordhash	0	2	1	mylogin	0			x	x	de-DE	1499335597	1557232808	1557231966	0	-1	1	1	1	1	1	0	somehash	my@email.example	1	1	1	2	3	00	0	unified	
--------------
SELECT `id`, `owner_id`, `lower_name`, `name`, `description`, `website`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_empty`, `is_archived`, `is_mirror`, `is_fork`, `fork_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `created_unix`, `updated_unix` FROM `repository` WHERE (owner_id=2 AND fork_id=2) LIMIT 1
--------------

6	2	my_baserepo	my_baserepo			master	1	1	0	0	0	0	0	0	0	0	0	NULL	0	1	239924736	1	0	null	1499346520	1556800069
--------------
SELECT `id`, `repo_id`, `type`, `config`, `created_unix` FROM `repo_unit` WHERE (repo_id = 6)
--------------

48	6	1	{}	1500539873
49	6	4	{}	1500539873

@morph027
Copy link

morph027 commented May 7, 2019

Awesome, just tested the PR and it looks like it's working 👏 ❤️

@morph027
Copy link

Note: Successfully upgraded to 1.8.1 🎉

Thank you!

@ptman
Copy link
Contributor

ptman commented May 10, 2019

Yes, works for me as well, 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
Projects
None yet
7 participants