Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report: getIndirectPullRequests() gets TypeError: Cannot read property 'commitId' of undefined #909

Closed
LouisSung opened this issue Dec 17, 2020 · 1 comment · Fixed by #910

Comments

@LouisSung
Copy link
Contributor

Describe the bug

This bug is related to XplatGenerateReleaseNotes:v3.* (exact: 3.35.7)

When enabling the Advanced > Get Indirect Pull Requests, the following error raised.

I think this happens because the var foundPR = allPullRequests.find( e => e.lastMergeCommit.commitId === cs.commitId); doesn't check the existence of e.lastMergeCommit, whereas the other place if (pr.lastMergeCommit) { if (pr.lastMergeCommit.commitId === commit.id) { does check.

I'm not sure why this happenes but I couldn't find this PR (1038) in all of our PRs and repos.
Therefore, I guess this PR becomes unavailable becasuse its associated repo was deleted.

To Reproduce

Not sure how

Expected behavior

Should bypass the commitId access if the e.lastMergeCommit does not exists

Screenshots

N/A

Logs

2020-12-17T06:30:16.4837493Z Found 183 Azure DevOps PRs in the repo
2020-12-17T06:30:16.4842879Z Checking for PRs associated with the commit 215d95a9b2f88ab6d0a8b5b7ada1f7b526ed940e
2020-12-17T06:30:16.4843475Z - PR 1170 matches the commit 215d95a9b2f88ab6d0a8b5b7ada1f7b526ed940e
2020-12-17T06:30:16.4843929Z - PR 1038 does not have a lastMergeCommit
2020-12-17T06:30:16.4844213Z Checking for PRs associated with the commit 0968c4bebedb9affc78a42ba5d39ff9fd8e69184
2020-12-17T06:30:16.4844639Z - PR 1038 does not have a lastMergeCommit
2020-12-17T06:30:16.4845073Z Enriching known Pull Requests
2020-12-17T06:30:16.7970936Z ##[debug]Checking for tags for 1170
2020-12-17T06:30:16.9202928Z ##[debug]Added 0 work items for 1170
2020-12-17T06:30:17.0463609Z ##[debug]Added 1 commits for 1170, note this includes commits on the PR source branch not associated directly with the build
2020-12-17T06:30:17.0464600Z Checking the CS associated with the PRs to see if they are inturn associated PRs
2020-12-17T06:30:17.0496763Z ##[error]TypeError: Cannot read property 'commitId' of undefined
2020-12-17T06:30:17.0506378Z ##[debug]Processed: ##vso[task.issue type=error;]TypeError: Cannot read property 'commitId' of undefined

What is the issue see:

  • XplatGenerateReleaseNotes:3.35.7
@LouisSung LouisSung added the bug label Dec 17, 2020
@rfennell
Copy link
Owner

rfennell commented Dec 17, 2020

Thanks for reporting this, I will had a null check, it will be in 3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants