While trying to build a report of our entire Bitbucket workspace I encounter this bug on some repos, rendering the report incomplete.
{
"error": {
"message": "Cannot read properties of undefined (reading 'nickname')",
"stack": "TypeError: Cannot read properties of undefined (reading 'nickname')\n
at BitbucketRunner.aggregateCommitContributors (/home/portfolio/.nvm/versions/node/v20.12.0/lib/node_modules/@paloaltonetworks/redshirts/dist/vcs/bitbucket/bitbucket-runner.js:18:39)\n
at BitbucketRunner.processRepo (/home/portfolio/.nvm/versions/node/v20.12.0/lib/node_modules/@paloaltonetworks/redshirts/dist/common/base-runner.js:72:22)\n
at async Task.task (/home/portfolio/.nvm/versions/node/v20.12.0/lib/node_modules/@paloaltonetworks/redshirts/dist/common/base-runner.js:45:25)"
}
}
From what I can tell there is a problem with this block:
const newCommit = {
username: author.user.nickname,
email: email || author.raw,
commitDate: date,
};
It seems you're referencing the nickname property, but author.user is undefined, leading to this exception. Catching this error and outputting author.raw to the debug log seems wise, and possibly adding a list of unrecognized/ignored authors to the output in some way would be helpful.
Application details:
2024-06-07T08:02:57.090Z [debug]: Environment details:
2024-06-07T08:02:57.092Z [debug]: Redshirts version: 0.6.0
2024-06-07T08:02:57.092Z [debug]: Node version: v20.12.0
2024-06-07T08:02:57.092Z [debug]: OS: Linux - linux - 5.15.0-107-generic
2024-06-07T08:02:57.092Z [debug]: CPU arch: x64
2024-06-07T08:02:57.092Z [debug]: Command args:
/home/portfolio/.nvm/versions/node/v20.12.0/bin/node
/home/portfolio/.nvm/versions/node/v20.12.0/bin/redshirts
While trying to build a report of our entire Bitbucket workspace I encounter this bug on some repos, rendering the report incomplete.
From what I can tell there is a problem with this block:
It seems you're referencing the
nicknameproperty, butauthor.useris undefined, leading to this exception. Catching this error and outputtingauthor.rawto the debug log seems wise, and possibly adding a list of unrecognized/ignored authors to the output in some way would be helpful.Application details: