Support org/user level projects (#22235)

Fix #13405

<img width="1151" alt="image"
src="https://user-images.githubusercontent.com/81045/209442911-7baa3924-c389-47b6-b63b-a740803e640e.png">

Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Lunny Xiao 2023-01-20 19:42:33 +08:00 committed by GitHub
parent 0c048e554b
commit 6fe3c8b398
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 1556 additions and 176 deletions

View file

@ -22,7 +22,7 @@ func TestIsProjectTypeValid(t *testing.T) {
}{
{TypeIndividual, false},
{TypeRepository, true},
{TypeOrganization, false},
{TypeOrganization, true},
{UnknownType, false},
}
@ -34,13 +34,13 @@ func TestIsProjectTypeValid(t *testing.T) {
func TestGetProjects(t *testing.T) {
assert.NoError(t, unittest.PrepareTestDatabase())
projects, _, err := GetProjects(db.DefaultContext, SearchOptions{RepoID: 1})
projects, _, err := FindProjects(db.DefaultContext, SearchOptions{RepoID: 1})
assert.NoError(t, err)
// 1 value for this repo exists in the fixtures
assert.Len(t, projects, 1)
projects, _, err = GetProjects(db.DefaultContext, SearchOptions{RepoID: 3})
projects, _, err = FindProjects(db.DefaultContext, SearchOptions{RepoID: 3})
assert.NoError(t, err)
// 1 value for this repo exists in the fixtures