batches: use GH App to "duplicate" and sign the commit#52492
Conversation
Bundle size report 📦
Look at the Statoscope report for a full comparison between the commits 18b2e87 and 60d130d or learn more. Open explanation
|
e356e40 to
b148eb6
Compare
558f174 to
e8f9544
Compare
e8f9544 to
7ebcf8d
Compare
6a49cc0 to
a52a3da
Compare
f11ac01 to
c4dc5b4
Compare
40ef9fb to
83d45a4
Compare
c4dc5b4 to
8245682
Compare
83d45a4 to
3d2f8c8
Compare
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 048be3d...e3b2686.
|
st0nebreaker
left a comment
There was a problem hiding this comment.
Looks good! By the way, the "[code]" links in the PR description are broken. I went through the main functions changed and just left a few comments/questions
|
Ack, sorry the links were broken! I've hopefully fixed them up now for when Bolaji reviews. 😅 |
704ded8 to
39d663f
Compare
BolajiOlajide
left a comment
There was a problem hiding this comment.
This changes look good to me.
|
Following up for #52224, does this give us any new field on the |
|
No, nothing for that yet! But to give you a starting place, the |
Closes https://github.com/sourcegraph/sourcegraph/issues/52493.
Here's a walkthrough of the changes. I think it's easier to think about it in this order rather than trying to parse the diff from top to bottom:
GitHubSource.DuplicateCommit[code].sourcer.ForChangesetto specify the preferredAuthenticationStrategy[code].AuthenticationStrategyUserCredential, which indicates using the "normal" method of authenticating aChangesetSourcewith the user or site credential.AuthenticationStrategyGitHubApp, if theChangesetSourcewould be created for a GitHub code host, we will try to authenticate with a GH App instead (sourcer.withGitHubAppAuthenticator()).gitHubAppStore.GetByDomain()).ChangesetSourcewith it as an installation.ChangesetSource(such as creating new commits 👀) will be authenticated as the GH App installation.executor.pushChangesetPatchas the entry point to initiate the "duplicate commit workflow" [code].ChangesetSourcefor the changeset's repo that we use to create a git push config and push the commit with gitserver.refs/heads/my-batch-change-branch) to use later to look up the commit, if we will be duplicating it.executor.runAfterCommitwith context about the operation.ChangesetSourceis for a GitHub code host, we try to authenticate a secondChangesetSourcefor it using a batches GH App.GitHubSource.DuplicateCommit().Test plan
Updated source tests and added new VCR tests for
GitHubSource.DuplicateCommit.Manually tested the whole workflow with a batches GH App and confirmed a branch with one signed commit was produced at the end: