@@ -25,6 +25,7 @@ func TestSCMProviderGenerateParams(t *testing.T) {
2525 {
2626 Organization : "myorg" ,
2727 Repository : "repo1" ,
28+ RepositoryId : 190320251 ,
2829 URL :
"[email protected] :myorg/repo1.git" ,
2930 Branch : "main" ,
3031 SHA : "0bc57212c3cbbec69d20b34c507284bd300def5b" ,
@@ -33,6 +34,7 @@ func TestSCMProviderGenerateParams(t *testing.T) {
3334 {
3435 Organization : "myorg" ,
3536 Repository : "repo2" ,
37+ RepositoryId : 190320252 ,
3638 URL :
"[email protected] :myorg/repo2.git" ,
3739 Branch : "main" ,
3840 SHA : "59d0" ,
@@ -42,6 +44,7 @@ func TestSCMProviderGenerateParams(t *testing.T) {
4244 {
4345 "organization" : "myorg" ,
4446 "repository" : "repo1" ,
47+ "repository_id" : 190320251 ,
4548 "url" :
"[email protected] :myorg/repo1.git" ,
4649 "branch" : "main" ,
4750 "branchNormalized" : "main" ,
@@ -53,6 +56,7 @@ func TestSCMProviderGenerateParams(t *testing.T) {
5356 {
5457 "organization" : "myorg" ,
5558 "repository" : "repo2" ,
59+ "repository_id" : 190320252 ,
5660 "url" :
"[email protected] :myorg/repo2.git" ,
5761 "branch" : "main" ,
5862 "branchNormalized" : "main" ,
@@ -69,6 +73,7 @@ func TestSCMProviderGenerateParams(t *testing.T) {
6973 {
7074 Organization : "myorg" ,
7175 Repository : "repo3" ,
76+ RepositoryId : 190320253 ,
7277 URL :
"[email protected] :myorg/repo3.git" ,
7378 Branch : "main" ,
7479 SHA : "0bc57212c3cbbec69d20b34c507284bd300def5b" ,
@@ -83,6 +88,7 @@ func TestSCMProviderGenerateParams(t *testing.T) {
8388 {
8489 "organization" : "myorg" ,
8590 "repository" : "repo3" ,
91+ "repository_id" : 190320253 ,
8692 "url" :
"[email protected] :myorg/repo3.git" ,
8793 "branch" : "main" ,
8894 "branchNormalized" : "main" ,
@@ -95,6 +101,52 @@ func TestSCMProviderGenerateParams(t *testing.T) {
95101 },
96102 },
97103 },
104+ {
105+ name : "Repos with and without id" ,
106+ repos : []* scm_provider.Repository {
107+ {
108+ Organization : "myorg" ,
109+ Repository : "repo4" ,
110+ RepositoryId : "idaz09" ,
111+ URL :
"[email protected] :myorg/repo4.git" ,
112+ Branch : "main" ,
113+ SHA : "0bc57212c3cbbec69d20b34c507284bd300def5b" ,
114+ },
115+ {
116+ Organization : "myorg" ,
117+ Repository : "repo5" ,
118+ URL :
"[email protected] :myorg/repo5.git" ,
119+ Branch : "main" ,
120+ SHA : "0bc57212c3cbbec69d20b34c507284bd300def5b" ,
121+ },
122+ },
123+ expected : []map [string ]any {
124+ {
125+ "organization" : "myorg" ,
126+ "repository" : "repo4" ,
127+ "repository_id" : "idaz09" ,
128+ "url" :
"[email protected] :myorg/repo4.git" ,
129+ "branch" : "main" ,
130+ "branchNormalized" : "main" ,
131+ "sha" : "0bc57212c3cbbec69d20b34c507284bd300def5b" ,
132+ "short_sha" : "0bc57212" ,
133+ "short_sha_7" : "0bc5721" ,
134+ "labels" : "" ,
135+ },
136+ {
137+ "organization" : "myorg" ,
138+ "repository" : "repo5" ,
139+ "repository_id" : nil ,
140+ "url" :
"[email protected] :myorg/repo5.git" ,
141+ "branch" : "main" ,
142+ "branchNormalized" : "main" ,
143+ "sha" : "0bc57212c3cbbec69d20b34c507284bd300def5b" ,
144+ "short_sha" : "0bc57212" ,
145+ "short_sha_7" : "0bc5721" ,
146+ "labels" : "" ,
147+ },
148+ },
149+ },
98150 }
99151
100152 for _ , testCase := range cases {
0 commit comments