github / rally

GitHub <> Rally integration
MIT License
124 stars 33 forks source link

Application seems to be targeting an old version of the Github API #372

Closed gusrAA closed 2 years ago

gusrAA commented 2 years ago

Description We deployed this application and attempted to integrate it with Github Cloud (github.com). It seems that there were some issues with validation of responses from Github.

01:08:39.878Z ERROR event: Empty value for parameter 'name': undefined (id=c863cfc0-a0d7-11ec-8fdc-0cf073aceaa6)
HttpError: Empty value for parameter 'name': undefined
at /opt/rally/node_modules/@octokit/rest/plugins/validate/validate.js:74:15
at Array.forEach (<anonymous>)
at /opt/rally/node_modules/@octokit/rest/plugins/validate/validate.js:42:12
at Array.forEach (<anonymous>)
at validate (/opt/rally/node_modules/@octokit/rest/plugins/validate/validate.js:15:23)
at async Job.doExecute (/opt/rally/node_modules/bottleneck/light.js:405:18)

This one occurs when Probot tries to validate the request body of the Github Webhook

01:15:59.306Z ERROR event: Cannot read property 'head' of undefined (id=cecec440-a0d8-11ec-8bef-e1867f434d7e)
TypeError: Cannot read property 'head' of undefined
at RallyValidate.setStatusPending (/opt/rally/lib/RallyValidate.js:553:49)
at RallyValidate.handlePullRequestWithRally (/opt/rally/lib/RallyValidate.js:166:16)
at async RallyValidate.handlePullRequest (/opt/rally/lib/RallyValidate.js:135:5)
at async /opt/rally/index.js:16:14

Looking into it the property it's trying to grab doesn't actually exist (payload.pull_request.head.ref). For checks run responses theres a pull_requests field but not a `pull_request see here https://docs.github.com/en/rest/reference/checks#create-a-check-run

Version v1.2.1

To Reproduce Steps to reproduce the behavior:

Expected behavior Octokit should not fail to validate responses from Github and rally App should choose correct fields from Github API Responses.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.