@@ -32,70 +32,80 @@ func TestGetGitContext(t *testing.T) {
3232 name : "Clean Project (after clone)" ,
3333 testProjectZipDirPath : filepath .Join (basePath , "clean" ),
3434 gitInfo : & services.XscGitInfoContext {
35- GitRepoHttpsCloneUrl : "https://github.com/attiasas/test-security-git.git" ,
36- GitRepoName : "test-security-git" ,
37- GitProject : "attiasas" ,
38- GitProvider : "github" ,
39- BranchName : "main" ,
40- LastCommitHash : "5fc36ff0666e5ce9dba6c0a1c539ee640cabe0b0" ,
41- LastCommitMessage : "remove json" ,
42- LastCommitAuthor : "attiasas" ,
35+ Source : services.CommitContext {
36+ GitRepoHttpsCloneUrl : "https://github.com/attiasas/test-security-git.git" ,
37+ GitRepoName : "test-security-git" ,
38+ GitProject : "attiasas" ,
39+ BranchName : "main" ,
40+ CommitHash : "5fc36ff0666e5ce9dba6c0a1c539ee640cabe0b0" ,
41+ CommitMessage : "remove json" ,
42+ CommitAuthor : "attiasas" ,
43+ },
44+ GitProvider : "github" ,
4345 },
4446 },
4547 {
4648 name : "Self-Hosted Git Project (and SSO credentials)" ,
4749 testProjectZipDirPath : filepath .Join (basePath , "selfhosted" ),
4850 gitInfo : & services.XscGitInfoContext {
49- GitRepoHttpsCloneUrl :
"ssh://[email protected] /~assafa/test-security-git.git" ,
50- GitRepoName : "test-security-git" ,
51- GitProject : "~assafa" ,
52- GitProvider : "bitbucket" ,
53- BranchName : "main" ,
54- LastCommitHash : "6abd0162f4e02e358124f74e89b30d1b1ff906bc" ,
55- LastCommitMessage : "initial commit" ,
56- LastCommitAuthor : "attiasas" ,
51+ Source : services.CommitContext {
52+ GitRepoHttpsCloneUrl :
"ssh://[email protected] /~assafa/test-security-git.git" ,
53+ GitRepoName : "test-security-git" ,
54+ GitProject : "~assafa" ,
55+ BranchName : "main" ,
56+ CommitHash : "6abd0162f4e02e358124f74e89b30d1b1ff906bc" ,
57+ CommitMessage : "initial commit" ,
58+ CommitAuthor : "attiasas" ,
59+ },
60+ GitProvider : "bitbucket" ,
5761 },
5862 },
5963 {
6064 name : "Gitlab Project (group tree structure)" ,
6165 testProjectZipDirPath : filepath .Join (basePath , "gitlab" ),
6266 gitInfo : & services.XscGitInfoContext {
63- GitRepoHttpsCloneUrl : "https://gitlab.com/attiasas/test-group/test-security-git.git" ,
64- GitRepoName : "test-security-git" ,
65- GitProject : "attiasas/test-group" ,
66- GitProvider : "gitlab" ,
67- BranchName : "main" ,
68- LastCommitHash : "ada14e9f525d8cbfb3c8c31ebe345d85ec342480" ,
69- LastCommitMessage : "add npm" ,
70- LastCommitAuthor : "attiasas" ,
67+ Source : services.CommitContext {
68+ GitRepoHttpsCloneUrl : "https://gitlab.com/attiasas/test-group/test-security-git.git" ,
69+ GitRepoName : "test-security-git" ,
70+ GitProject : "attiasas/test-group" ,
71+ BranchName : "main" ,
72+ CommitHash : "ada14e9f525d8cbfb3c8c31ebe345d85ec342480" ,
73+ CommitMessage : "add npm" ,
74+ CommitAuthor : "attiasas" ,
75+ },
76+ GitProvider : "gitlab" ,
7177 },
7278 },
7379 {
7480 name : "Gerrit Project (no owner)" ,
7581 testProjectZipDirPath : filepath .Join (basePath , "gerrit" ),
7682 gitInfo : & services.XscGitInfoContext {
77- GitRepoHttpsCloneUrl : "https://gerrit.googlesource.com/git-repo" ,
78- GitRepoName : "git-repo" ,
79- GitProject : "git-repo" ,
80- GitProvider : "gerrit" ,
81- BranchName : "main" ,
82- LastCommitHash : "a532f57a1f20623f5b9dd022493141a5b2a71009" ,
83- LastCommitMessage : `clean project` ,
84- LastCommitAuthor : "attiasas" ,
83+ Source : services.CommitContext {
84+ GitRepoHttpsCloneUrl : "https://gerrit.googlesource.com/git-repo" ,
85+ GitRepoName : "git-repo" ,
86+ GitProject : "git-repo" ,
87+ BranchName : "main" ,
88+ CommitHash : "a532f57a1f20623f5b9dd022493141a5b2a71009" ,
89+ CommitMessage : `clean project` ,
90+ CommitAuthor : "attiasas" ,
91+ },
92+ GitProvider : "gerrit" ,
8593 },
8694 },
8795 {
8896 name : "Forked Project (multiple remotes)" ,
8997 testProjectZipDirPath : filepath .Join (basePath , "forked" ),
9098 gitInfo : & services.XscGitInfoContext {
91- GitRepoHttpsCloneUrl : "https://github.com/attiasas/test-security-git.git" ,
92- GitRepoName : "test-security-git" ,
93- GitProject : "attiasas" ,
94- GitProvider : "github" ,
95- BranchName : "main" ,
96- LastCommitHash : "5fc36ff0666e5ce9dba6c0a1c539ee640cabe0b0" ,
97- LastCommitMessage : "remove json" ,
98- LastCommitAuthor : "attiasas" ,
99+ Source : services.CommitContext {
100+ GitRepoHttpsCloneUrl : "https://github.com/attiasas/test-security-git.git" ,
101+ GitRepoName : "test-security-git" ,
102+ GitProject : "attiasas" ,
103+ BranchName : "main" ,
104+ CommitHash : "5fc36ff0666e5ce9dba6c0a1c539ee640cabe0b0" ,
105+ CommitMessage : "remove json" ,
106+ CommitAuthor : "attiasas" ,
107+ },
108+ GitProvider : "github" ,
99109 },
100110 },
101111 // Not supported yet
0 commit comments