chore: drop isGitHubApp field from batch changes credentials (#63709)

We now have the `gitHubApp` field that can be used instead.
`isGitHubApp` was only introduced as part of the batch changes
integration with github app, and is therefore not released yet.

Closes SRCH-704

## Test plan

Manual testing

## Changelog

<!-- OPTIONAL; info at
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c
-->

---------

Co-authored-by: Bolaji Olajide <25608335+BolajiOlajide@users.noreply.github.com>
This commit is contained in:
Michael Bahr 2024-07-09 13:01:33 +02:00 committed by GitHub
parent e669330215
commit 4e510a2fb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 3 additions and 21 deletions

View File

@ -47,7 +47,6 @@ const sshCredential = (isSiteCredential: boolean): BatchChangesCredentialFields
isSiteCredential,
sshPublicKey:
'rsa-ssh randorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorando',
isGitHubApp: false,
gitHubApp: null,
})

View File

@ -156,7 +156,6 @@ export const ConfigAdded: StoryFn = () => (
isSiteCredential: true,
sshPublicKey:
'rsa-ssh randorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorando',
isGitHubApp: false,
gitHubApp: null,
},
externalServiceKind: ExternalServiceKind.GITHUB,
@ -181,8 +180,6 @@ export const ConfigAdded: StoryFn = () => (
isSiteCredential: true,
sshPublicKey:
'rsa-ssh randorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorando',
isGitHubApp: false,
gitHubApp: null,
},
externalServiceKind: ExternalServiceKind.GITLAB,
@ -199,7 +196,6 @@ export const ConfigAdded: StoryFn = () => (
isSiteCredential: true,
sshPublicKey:
'rsa-ssh randorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorando',
isGitHubApp: false,
gitHubApp: null,
},
externalServiceKind: ExternalServiceKind.BITBUCKETSERVER,
@ -216,7 +212,6 @@ export const ConfigAdded: StoryFn = () => (
isSiteCredential: true,
sshPublicKey:
'rsa-ssh randorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorando',
isGitHubApp: false,
gitHubApp: null,
},
externalServiceKind: ExternalServiceKind.BITBUCKETCLOUD,

View File

@ -35,7 +35,6 @@ const sshCredential = (isSiteCredential: boolean): BatchChangesCredentialFields
isSiteCredential,
sshPublicKey:
'rsa-ssh randorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorando',
isGitHubApp: false,
gitHubApp: null,
})

View File

@ -98,9 +98,7 @@ export const CodeHostConnectionNode: React.FunctionComponent<React.PropsWithChil
const gitHubApp: Pick<GitHubAppByIDFields, 'id' | 'name' | 'appURL' | 'logo' | 'appID'> | null =
gitHubAppKind === GitHubAppKind.COMMIT_SIGNING
? node.commitSigningConfiguration
: node.credential?.isGitHubApp
? node.credential.gitHubApp
: null
: node.credential?.gitHubApp ?? null
return (
<>

View File

@ -27,7 +27,6 @@ const credential = {
isSiteCredential: false,
sshPublicKey:
'ssh-rsa randorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorando',
isGitHubApp: false,
gitHubApp: null,
}

View File

@ -20,7 +20,6 @@ const credential: BatchChangesCredentialFields = {
isSiteCredential: false,
sshPublicKey:
'ssh-rsa randorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorandorando',
isGitHubApp: false,
gitHubApp: null,
}

View File

@ -26,7 +26,6 @@ export const CREDENTIAL_FIELDS_FRAGMENT = gql`
id
sshPublicKey
isSiteCredential
isGitHubApp
gitHubApp {
id
appID

View File

@ -566,7 +566,6 @@ type BatchChangesCredentialResolver interface {
ID() graphql.ID
ExternalServiceKind() string
ExternalServiceURL() string
IsGitHubApp() bool
GitHubAppID() int
SSHPublicKey(ctx context.Context) (*string, error)
CreatedAt() gqlutil.DateTime

View File

@ -3559,12 +3559,7 @@ type BatchChangesCredential implements Node {
isSiteCredential: Boolean!
"""
Whether the credential is tied to a GitHub App installation.
"""
isGitHubApp: Boolean!
"""
If the field isGitHubApp is true, this field contains the details of the GitHubApp.
If the credential is a GitHub app, this field contains the details of the GitHubApp.
"""
gitHubApp: GitHubApp
}

View File

@ -1951,7 +1951,7 @@ func (r *Resolver) CheckBatchChangesCredential(ctx context.Context, args *graphq
ExternalServiceType: extsvc.KindToType(cred.ExternalServiceKind()),
}
as := sources.AuthenticationStrategyUserCredential
if cred.IsGitHubApp() {
if cred.GitHubAppID() > 0 {
as = sources.AuthenticationStrategyGitHubApp
ghApp, err := r.db.GitHubApps().GetByID(ctx, cred.GitHubAppID())