-
Notifications
You must be signed in to change notification settings - Fork 130
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
refactor(probot)!: upgrade gcf-utils to probot@10, @octokit/rest@18 #963
Conversation
@@ -51,7 +52,7 @@ | |||
"mocha": "^8.0.0", | |||
"nock": "^13.0.0", | |||
"sinon": "^9.0.0", | |||
"sonic-boom": "^1.0.1", | |||
"sonic-boom": "1.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the point release of sonic-boom breaks types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app.on('schedule.repository', spy); | ||
app.on('err', sinon.stub().throws()); | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
app.on('schedule.repository' as any, spy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Octokit is now strict about event names, I've been talking to @gr2m about how we might approach this going forward.
// TODO: How do we still get access to this installation token? | ||
async getAuthenticatedOctokit(installationId: number): Promise<Octokit> { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const app = (this.probot as any).apps[0] as Application; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gr2m I think this is what we talked about earlier today, that can be used to give us an Octokit instance with permission to call octokit.apps.listReposAccessibleToInstallation
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, sorry for the need of this ugly hack, I hope make it obsolete soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just so we don't lose track, @bcoe could I trouble you to file an upstream bug and leave it in a comment here so we can come clean up?
// TODO: How do we still get access to this installation token? | ||
async getAuthenticatedOctokit(installationId: number): Promise<Octokit> { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const app = (this.probot as any).apps[0] as Application; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, sorry for the need of this ugly hack, I hope make it obsolete soon
Co-authored-by: Gregor Martynus <gregor@martynus.net>
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
@gr2m thank you for the review. |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
// TODO: How do we still get access to this installation token? | ||
async getAuthenticatedOctokit(installationId: number): Promise<Octokit> { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const app = (this.probot as any).apps[0] as Application; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just so we don't lose track, @bcoe could I trouble you to file an upstream bug and leave it in a comment here so we can come clean up?
}); | ||
sinon | ||
.stub(bootstrapper, 'getAuthenticatedOctokit') | ||
.returns(Promise.resolve(new Octokit())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shorten to .resolves(new Octokit())
@@ -190,7 +197,8 @@ export = (app: Application) => { | |||
} | |||
}); | |||
|
|||
app.on('schedule.repository', async context => { | |||
// See: https://github.com/octokit/webhooks.js/issues/277 | |||
app.on('schedule.repository' as any, async context => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to keep the build clean, please address the warnings here
@@ -16,8 +16,18 @@ import myProbotApp from '../src/release-please'; | |||
import {Runner} from '../src/runner'; | |||
import {describe, it, beforeEach} from 'mocha'; | |||
import {resolve} from 'path'; | |||
|
|||
// We provide our own GitHub instnace, similar to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo in instnace :)
) | ||
.reply(200, {content: config.toString('base64')}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is gonna break stuff in other bots
// see: https://github.com/probot/probot/issues/1367 | ||
name: 'pull_request.labeled' as any, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove .labeled
from the name. labeled
is the action, it is part of the payload:
repo-automation-bots/packages/release-please/test/fixtures/pull_request_labeled.json
Line 2 in e9637b1
"action": "labeled", |
// see: https://github.com/probot/probot/issues/1367 | |
name: 'pull_request.labeled' as any, | |
name: 'pull_request', |
// see: https://github.com/probot/probot/issues/1367 | ||
name: 'pull_request.labeled' as any, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// see: https://github.com/probot/probot/issues/1367 | |
name: 'pull_request.labeled' as any, | |
name: 'pull_request', |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
First pass at an attempt to get us on the latest version of
probot
, this is going to be somewhat gnarly.