integration support for harness p5-fixed api microsite-fix content api
Signed-off-by: Calvin Lee <cjlee@ualberta.ca>
This commit is contained in:
@@ -38,7 +38,7 @@ describe('Harness code core', () => {
|
||||
'https://app.harness.io/ng/account/accountId/module/code/orgs/orgName/projects/projName/repos/repoName/files/refMain/~/all-apis.yaml',
|
||||
),
|
||||
).toEqual(
|
||||
'https://app.harness.io/gateway/code/api/v1/repos/accountId/orgName/projName/repoName/+/content/all-apis.yaml?routingId=accountId&include_commit=false&ref=refMain',
|
||||
'https://app.harness.io/gateway/code/api/v1/repos/accountId/orgName/projName/repoName/+/raw/all-apis.yaml?routingId=accountId&git_ref=refMain',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -102,7 +102,7 @@ export function getHarnessFileContentsUrl(
|
||||
const refIndex = refAndPath.findIndex(item => item === '~');
|
||||
const refString = refAndPath.slice(0, refIndex);
|
||||
const pathWithoutSlash = path.join('/').replace(/^\//, '');
|
||||
return `${baseUrl}/gateway/code/api/v1/repos/${accountId}/${orgName}/${projectName}/${repoName}/+/content/${pathWithoutSlash}?routingId=${accountId}&include_commit=false&ref=${refString}`;
|
||||
return `${baseUrl}/gateway/code/api/v1/repos/${accountId}/${orgName}/${projectName}/${repoName}/+/raw/${pathWithoutSlash}?routingId=${accountId}&git_ref=${refString}`;
|
||||
} catch (e) {
|
||||
throw new Error(`Incorrect URL: ${url}, ${e}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user