bitbucket own hosted v5.11.1 branchUrl fix and enbaled error tracing for mkdocs process stack trace

This commit is contained in:
Kaparwan Manoj
2021-02-02 10:38:47 +11:00
parent 5df0714a84
commit 9cda5593af
2 changed files with 7 additions and 2 deletions
+3 -2
View File
@@ -32,10 +32,11 @@ export async function getBitbucketDefaultBranch(
const isHosted = resource === 'bitbucket.org';
// Bitbucket Server https://docs.atlassian.com/bitbucket-server/rest/7.9.0/bitbucket-rest.html#idp184
// Changed branchUrl to support Atlassian Bitbucket v5.11.1 , which has different branchUrl format
const branchUrl = isHosted
? `${config.apiBaseUrl}/repositories/${project}/${repoName}`
: `${config.apiBaseUrl}/projects/${project}/repos/${repoName}/default-branch`;
: `${config.apiBaseUrl}/projects/${project}/repos/${repoName}/branches/default`;
const response = await fetch(branchUrl, getBitbucketRequestOptions(config));
if (!response.ok) {
const message = `Failed to retrieve default branch from ${branchUrl}, ${response.status} ${response.statusText}`;
@@ -133,6 +133,10 @@ export const runCommand = async ({
process.stderr.on('data', stream => {
logStream.write(stream);
// added below change to make OS ( child process) exception to the backend logs
const bufferbase64 = Buffer.from(stream, 'base64');
const textAscii = bufferbase64.toString('ascii');
console.log(' Process Stderror trace: ', textAscii);
});
process.on('error', error => {