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

feat: upgrade buildcop to probot 10 #1000

Merged
merged 15 commits into from
Oct 14, 2020
Merged

feat: upgrade buildcop to probot 10 #1000

merged 15 commits into from
Oct 14, 2020

Conversation

sofisl
Copy link
Contributor

@sofisl sofisl commented Oct 2, 2020

No description provided.

@sofisl sofisl requested a review from a team October 2, 2020 06:25
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 2, 2020
@sofisl sofisl requested a review from tbpg October 2, 2020 06:25
@sofisl sofisl changed the title [DO NOT MERGE]: Upgrade buildcop to probot 10 feat: upgrade buildcop to probot 10 Oct 6, 2020
@@ -75,6 +79,139 @@ const GROUPED_MESSAGE = `Many tests failed at the same time in this package.

`;

interface IssuesListForRepoResponseItem {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do we need to define this type? Seems like it should be a part of @octokit/types?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, @octokit/types only defines the response to this method as an array, rather than a single item. We need to define this as well for those references.

Screen Shot 2020-10-14 at 12 29 40 AM

let issues = await context.github.paginate(options);
let issues = (await context.github.paginate(
options
)) as IssuesListForRepoResponseData;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised we need this cast when we didn't before?

Copy link
Contributor Author

@sofisl sofisl Oct 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because it's expecting a type of Promise<PaginationResults<unknown>> rather than the array of data that it will be.

Octokit: require('@octokit/rest').Octokit,
probot = createProbot({
githubToken: 'abc123',
Octokit: TestingOctokit as any,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bunch of any lint warnings in this file, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, unfortunately the 'any' is a known issue since the Github API event names have been locked down; see here: octokit/webhooks.js#277

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add this as a comment in the file, though!

@sofisl
Copy link
Contributor Author

sofisl commented Oct 14, 2020

@tbpg Thanks for the review! I cut down on the IssuesListForRepoResponseItem and added in comments to describe the 'any' situation as well as the need to declare the IssuesListForRepoResponseItem type.

@sofisl sofisl requested a review from tbpg October 14, 2020 07:40
@sofisl sofisl merged commit 3145361 into googleapis:master Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants