Skip to content

Commit e94284c

Browse files
committed
Remove 'access' from yaml generation
1 parent c7a9c56 commit e94284c

File tree

3 files changed

+0
-37
lines changed

3 files changed

+0
-37
lines changed

contrib/fixtures/fixture_generation.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ var (
2222
name string
2323
}{
2424
{
25-
models.GetYamlFixturesAccess, "access",
2625
models.GetYamlFixturesUserRepoUnit, "user_repo_unit",
2726
},
2827
}

models/fixture_generation.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,6 @@ import (
99
"strings"
1010
)
1111

12-
// GetYamlFixturesAccess returns a string containing the contents
13-
// for the access table, as recalculated using repo.RecalculateAccesses()
14-
func GetYamlFixturesAccess() (string, error) {
15-
16-
repos := make([]*Repository, 0, 50)
17-
if err := x.Find(&repos); err != nil {
18-
return "", err
19-
}
20-
21-
for _, repo := range repos {
22-
repo.MustOwner()
23-
if err := repo.RecalculateAccesses(); err != nil {
24-
return "", err
25-
}
26-
}
27-
28-
var b strings.Builder
29-
30-
accesses := make([]*Access, 0, 200)
31-
if err := x.OrderBy("user_id, repo_id").Find(&accesses); err != nil {
32-
return "", err
33-
}
34-
35-
for i, a := range accesses {
36-
fmt.Fprintf(&b, "-\n")
37-
fmt.Fprintf(&b, " id: %d\n", i+1)
38-
fmt.Fprintf(&b, " user_id: %d\n", a.UserID)
39-
fmt.Fprintf(&b, " repo_id: %d\n", a.RepoID)
40-
fmt.Fprintf(&b, " mode: %d\n", a.Mode)
41-
fmt.Fprintf(&b, "\n")
42-
}
43-
44-
return b.String(), nil
45-
}
46-
4712
// GetYamlFixturesUserRepoUnit returns a string containing the contents for the
4813
// user_repo_unit table, as recalculated using repo.RebuildAllUserRepoUnits()
4914
func GetYamlFixturesUserRepoUnit() (string, error) {

models/fixture_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,5 @@ func TestFixtureGeneration(t *testing.T) {
3030
assert.True(t, data == expected, "Differences detected for %s.yml", name)
3131
}
3232

33-
test(GetYamlFixturesAccess, "access")
3433
test(GetYamlFixturesUserRepoUnit, "user_repo_unit")
3534
}

0 commit comments

Comments
 (0)