Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/spacecat-shared-cloud-manager-client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export default class CloudManagerClient {
this.log.info(`Cloning CM repository: program=${programId}, repo=${repositoryId}, type=${repoType}`);

const args = await this.#buildAuthGitArgs('clone', programId, repositoryId, { imsOrgId, repoType, repoUrl });
this.#execGit([...args, clonePath]);
this.#execGit([...args, '--recurse-submodules', clonePath]);
this.log.info(`Repository cloned to ${clonePath}`);
this.#logTmpDiskUsage('clone');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,19 @@ describe('CloudManagerClient', () => {
expect(cloneArgsStr).to.not.include('Bearer');
});

it('includes --recurse-submodules in the clone arguments', async () => {
const client = CloudManagerClient.createFrom(createContext());

await client.clone(
TEST_PROGRAM_ID,
TEST_REPO_ID,
{ imsOrgId: TEST_IMS_ORG_ID },
);

const gitArgs = getGitArgs(execFileSyncStub.firstCall);
expect(gitArgs).to.include('--recurse-submodules');
});

it('throws when standard credentials not found for programId', async () => {
const client = CloudManagerClient.createFrom(
createContext({ CM_STANDARD_REPO_CREDENTIALS: TEST_STANDARD_CREDENTIALS }),
Expand Down