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

Integrations support self hosted providers from gkdev (#3901) #3922

Merged

Conversation

sergeibbb
Copy link
Member

@sergeibbb sergeibbb commented Jan 13, 2025

Description

#3901

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

@sergeibbb sergeibbb linked an issue Jan 13, 2025 that may be closed by this pull request
@sergeibbb sergeibbb force-pushed the 3901-integrations-support-self-hosted-providers-from-gkdev branch from ede3ded to f00ba5b Compare January 13, 2025 14:28
sergeibbb added a commit that referenced this pull request Jan 13, 2025
sergeibbb added a commit that referenced this pull request Jan 13, 2025
@sergeibbb
Copy link
Member Author

@eamodio, @axosoft-ramint, @d13,

To sum up what is happening here: new type of integration "cloud-github-enterprise" that works as enterprise but gets authorization as cloud.

@sergeibbb sergeibbb force-pushed the 3901-integrations-support-self-hosted-providers-from-gkdev branch from f00ba5b to b15b070 Compare January 13, 2025 17:06
sergeibbb added a commit that referenced this pull request Jan 13, 2025
sergeibbb added a commit that referenced this pull request Jan 13, 2025
@sergeibbb sergeibbb force-pushed the 3901-integrations-support-self-hosted-providers-from-gkdev branch from b15b070 to fb6f815 Compare January 13, 2025 17:07
sergeibbb added a commit that referenced this pull request Jan 13, 2025
sergeibbb added a commit that referenced this pull request Jan 13, 2025
Copy link
Member

@eamodio eamodio left a comment

Choose a reason for hiding this comment

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

Overall it looks good - though I did have a few questions.

src/constants.integrations.ts Outdated Show resolved Hide resolved
src/constants.integrations.ts Outdated Show resolved Hide resolved
src/git/parsers/remoteParser.ts Outdated Show resolved Hide resolved
src/git/parsers/remoteParser.ts Outdated Show resolved Hide resolved
src/webviews/home/homeWebview.ts Outdated Show resolved Hide resolved
src/git/remotes/remoteProviders.ts Show resolved Hide resolved
axosoft-ramint pushed a commit that referenced this pull request Jan 14, 2025
axosoft-ramint pushed a commit that referenced this pull request Jan 14, 2025
@axosoft-ramint axosoft-ramint force-pushed the 3901-integrations-support-self-hosted-providers-from-gkdev branch from cfaf38c to 15c7e7f Compare January 14, 2025 22:40
}

protected async writeSecret(
key: IntegrationAuthenticationKeys,
session: ProviderAuthenticationSession | StoredSession,
) {
await this.container.storage.storeSecret(key, JSON.stringify(session));
await this.authenticationService.addConfigured({
integrationId: this.authProviderId,
domain: isSelfHostedIntegrationId(this.authProviderId) ? session.id : undefined,
Copy link
Member

Choose a reason for hiding this comment

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

This scares me a since we could in the future change the session.id to be/mean something else and we'd implicitly break this.

I would suggest we add domain on to the session like we are doing with cloud to make it explicit.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a good idea, though we would want to include a migration for existing sessions to include that like we did with cloud. @sergeibbb

Copy link
Contributor

Choose a reason for hiding this comment

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

@eamodio I'm going to add a TODO here and write this up as post-release debt

src/constants.storage.ts Outdated Show resolved Hide resolved
Comment on lines 104 to +108
await this.container.storage.deleteSecret(key);
await this.authenticationService.removeConfigured({
integrationId: this.authProviderId,
domain: isSelfHostedIntegrationId(this.authProviderId) ? sessionId : undefined,
});
Copy link
Member

Choose a reason for hiding this comment

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

Nit for another day, but it feels like these operations should be combined into the AuthService rather than in the base class.

@axosoft-ramint
Copy link
Contributor

@sergeibbb Please feel free to take over from here including @eamodio 's review comments on my "configured integrations" changes.

@sergeibbb sergeibbb force-pushed the 3901-integrations-support-self-hosted-providers-from-gkdev branch from 15c7e7f to 672297d Compare January 15, 2025 17:47
@axosoft-ramint axosoft-ramint merged commit cb7e263 into main Jan 15, 2025
3 checks passed
sergeibbb added a commit that referenced this pull request Jan 15, 2025
sergeibbb added a commit that referenced this pull request Jan 15, 2025
sergeibbb added a commit that referenced this pull request Jan 15, 2025
sergeibbb added a commit that referenced this pull request Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrations: support self-hosted providers from gkdev
3 participants