integration support for harness p4-fixed test

Signed-off-by: Calvin Lee <cjlee@ualberta.ca>
This commit is contained in:
Calvin Lee
2024-04-23 16:41:40 -06:00
parent 6a0e918dc6
commit ed8b5324da
2 changed files with 71 additions and 73 deletions
+6 -2
View File
@@ -93,12 +93,16 @@ export function getHarnessFileContentsUrl(
_repos,
repoName,
_files,
ref,
_ref,
_branch,
...path
] = url.replace(baseUrl, '').split('/');
const urlParts = url.replace(baseUrl, '').split('/');
const refAndPath = urlParts.slice(13);
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=${ref}`;
return `${baseUrl}/gateway/code/api/v1/repos/${accountId}/${orgName}/${projectName}/${repoName}/+/content/${pathWithoutSlash}?routingId=${accountId}&include_commit=false&ref=${refString}`;
} catch (e) {
throw new Error(`Incorrect URL: ${url}, ${e}`);
}