fixed comments

Signed-off-by: Calvin Lee <cjlee@ualberta.ca>
This commit is contained in:
Calvin Lee
2024-05-29 11:14:08 -06:00
parent 94f3bb6edf
commit a2d6127793
3 changed files with 6 additions and 6 deletions
@@ -117,7 +117,7 @@ describe('HarnessIntegration', () => {
'https://app.harness.io/ng/account/accountId/module/code/orgs/orgName/projects/projName/repos/repoName/edit/refMain/~/all-apis.yaml',
),
).toBe(
'https://app.harness.io/gateway/code/api/v1/repos/accountId/orgName/projName/repoName/+/edit/all-apis.yaml',
'https://app.harness.io/ng/account/accountId/module/code/orgs/orgName/projects/projName/repoName/files/refMain/~/all-apis.yaml',
);
});
});
@@ -57,7 +57,7 @@ describe('Harness code core', () => {
'https://app.harness.io/ng/account/accountId/module/code/orgs/orgName/projects/projName/repos/repoName/edit/refMain/~/all-apis.yaml',
),
).toEqual(
'https://app.harness.io/ng/account/accountId/module/code/orgs/orgName/projects/projName/repoName/files//ng/account/accountId/module/code/orgs/orgName/projects/projName/repos/repoName/edit/refMain/~/all-apis.yaml',
'https://app.harness.io/ng/account/accountId/module/code/orgs/orgName/projects/projName/repoName/files/refMain/~/all-apis.yaml',
);
});
});
+4 -4
View File
@@ -65,8 +65,8 @@ export function getHarnessFileContentsUrl(
* @remarks
*
* Converts
* from: https://gitea.com/a/b/src/branchname
* to: https://gitea.com/api/v1/repos/a/b/archive/branchname.zip
* from: https://qa.harness.io/ng/account/accountId/module/code/orgs/orgId/projects/projectName/repos/repoName/files/branch/~/fileName
* to: https://qa.harness.io/gateway/code/api/v1/repos/accountId/orgId/projectName/repoName/+/archive/branch.zip?routingId=accountId
*
* @param url - A URL pointing to a repository/path
* @param config - The relevant provider config
@@ -128,7 +128,7 @@ export function getHarnessRequestOptions(config: HarnessIntegrationConfig): {
/**
* Return parsed git url properties.
*
* @param config - A Gitea provider config
* @param config - A Harness provider config
* @param url - A URL pointing to a repository
* @public
*/
@@ -171,7 +171,7 @@ export function parseHarnessUrl(
..._path
] = pathSegments;
const refAndPath = urlParts.slice(
urlParts.findIndex(i => i === 'files') + 1,
urlParts.findIndex(i => i === 'files' || i === 'edit') + 1,
);
const refIndex = refAndPath.findIndex(item => item === '~');
const refString = refAndPath.slice(0, refIndex).join('/');