forked from drone/go-scm
-
Notifications
You must be signed in to change notification settings - Fork 83
/
data.go
108 lines (95 loc) · 3.68 KB
/
data.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
package fake
import "github.com/jenkins-x/go-scm/scm"
type Data struct {
Issues map[int][]*scm.Issue
OrgMembers map[string][]string
Collaborators []string
IssueComments map[int][]*scm.Comment
IssueCommentID int
PullRequests map[int]*scm.PullRequest
PullRequestChanges map[int][]*scm.Change
PullRequestComments map[int][]*scm.Comment
PullRequestCommentsAdded []string
PullRequestCommentsDeleted []string
PullRequestLabelsAdded []string
PullRequestLabelsRemoved []string
PullRequestLabelsExisting []string
ReviewID int
Reviews map[int][]*scm.Review
Statuses map[string][]*scm.Status
IssueEvents map[int][]*scm.ListedIssueEvent
Commits map[string]*scm.Commit
TestRef string
PullRequestsCreated map[int]*scm.PullRequestInput
PullRequestID int
CreateRepositories []*scm.RepositoryInput
Organizations []*scm.Organization
Repositories []*scm.Repository
CurrentUser scm.User
Users []*scm.User
Hooks map[string][]*scm.Hook
//All Labels That Exist In The Repo
RepoLabelsExisting []string
// org/repo#number:label
IssueLabelsAdded []string
IssueLabelsExisting []string
IssueLabelsRemoved []string
// org/repo#number:body
IssueCommentsAdded []string
// org/repo#issuecommentid
IssueCommentsDeleted []string
// org/repo#issuecommentid:reaction
IssueReactionsAdded []string
CommentReactionsAdded []string
// org/repo#number:assignee
AssigneesAdded []string
// org/repo#number:milestone (represents the milestone for a specific issue)
Milestone int
MilestoneMap map[string]int
// list of commits for each PR
// org/repo#number:[]commit
CommitMap map[string][]scm.Commit
// Fake remote git storage. File name are keys
// and values map SHA to content
RemoteFiles map[string]map[string]string
// A list of refs that got deleted via DeleteRef
RefsDeleted []DeletedRef
UserPermissions map[string]map[string]string
}
type DeletedRef struct {
Org, Repo, Ref string
}
// NewData create a new set of fake data
func NewData() *Data {
return &Data{
Issues: map[int][]*scm.Issue{},
OrgMembers: map[string][]string{},
Collaborators: []string{},
IssueComments: map[int][]*scm.Comment{},
PullRequests: map[int]*scm.PullRequest{},
PullRequestChanges: map[int][]*scm.Change{},
PullRequestComments: map[int][]*scm.Comment{},
PullRequestLabelsAdded: []string{},
PullRequestLabelsRemoved: []string{},
PullRequestLabelsExisting: []string{},
PullRequestsCreated: map[int]*scm.PullRequestInput{},
Reviews: map[int][]*scm.Review{},
Statuses: map[string][]*scm.Status{},
IssueEvents: map[int][]*scm.ListedIssueEvent{},
Commits: map[string]*scm.Commit{},
MilestoneMap: map[string]int{},
CommitMap: map[string][]scm.Commit{},
RemoteFiles: map[string]map[string]string{},
TestRef: "abcde",
IssueLabelsAdded: []string{},
IssueLabelsExisting: []string{},
IssueLabelsRemoved: []string{},
IssueCommentsAdded: []string{},
IssueCommentsDeleted: []string{},
IssueReactionsAdded: []string{},
CommentReactionsAdded: []string{},
AssigneesAdded: []string{},
UserPermissions: map[string]map[string]string{},
Hooks: map[string][]*scm.Hook{},
}
}