Skip to content

Commit a6949ff

Browse files
Added test case for rbc command from release bundle source with in a project
1 parent 3d8d69b commit a6949ff

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lifecycle_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,20 @@ func createRbFromMultiSourcesUsingCommandFlags(t *testing.T, lcManager *lifecycl
256256
assert.NoError(t, err)
257257
}
258258

259+
func populateRepositoryKeyForReleaseBundleSources(sources []services.RbSource) {
260+
if len(sources) == 0 || sources[0].SourceType != "release_bundles" {
261+
return
262+
}
263+
for i := range sources {
264+
for j := range sources[i].ReleaseBundles {
265+
rb := &sources[i].ReleaseBundles[j]
266+
if rb.ProjectKey != "" {
267+
rb.RepositoryKey = rb.ProjectKey + "-release-bundles-v2"
268+
}
269+
}
270+
}
271+
}
272+
259273
func buildMultiSources(sources []services.RbSource, buildsSourcesStr, bundlesSourcesStr, projectKey string) []services.RbSource {
260274
// Process Builds
261275
if buildsSourcesStr != "" {
@@ -265,6 +279,9 @@ func buildMultiSources(sources []services.RbSource, buildsSourcesStr, bundlesSou
265279
// Process Release Bundles
266280
if bundlesSourcesStr != "" {
267281
sources = buildMultiBundleSources(sources, bundlesSourcesStr, projectKey)
282+
if projectKey != "" {
283+
populateRepositoryKeyForReleaseBundleSources(sources)
284+
}
268285
}
269286

270287
return sources

0 commit comments

Comments
 (0)