mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 20:51:43 +00:00
[Context](https://sourcegraph.slack.com/archives/C04UV9ZVBB2/p1696374182439959) The customer reported an issue where a Sourcegraph instance configured with a GitHub app for Batch Changes couldn't sign commits on forked changesets even when the GitHub app was granted access to the forked repo. This happens because while creating an authenticator used to create the signed commits, we always assume the repository to find the GitHub app installation for is the original repository where the Batch CHange was executed. https://github.com/sourcegraph/sourcegraph/blob/main/internal/batches/sources/sources.go#L161 In this PR, I changed the approach and instead checked if the changeset is pushed to a fork, then figured out the namespace where the forked changeset is created and used that to get the GitHub app installation record.  ## Test plan * MAnual testing - Add a GitHub app for BAtch Changes commit signing. Ensure you give it access to the forked repository of your choice. - Add `batchChanges.enforceForks` to your site config, and create a batch change. - The changeset should be verified and created in your repository fork once published. * Updated unit tests |
||
|---|---|---|
| .. | ||
| BUILD.bazel | ||
| mocks_temp.go | ||
| store_test.go | ||
| store.go | ||