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

Converts GitHub integration authentication to use gk.dev GLVSC-554 #3356

Merged
merged 17 commits into from
Jul 3, 2024

Conversation

sergeibbb
Copy link
Member

@sergeibbb sergeibbb commented Jun 18, 2024

Description

Introduces a provider for GitHub integration that tries to check for existing GitHub session before accessing an integration on GKDev (GLVSC-554)

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

@axosoft-ramint axosoft-ramint self-requested a review June 18, 2024 17:18
@axosoft-ramint axosoft-ramint self-assigned this Jun 18, 2024
@sergeibbb sergeibbb changed the base branch from main to feature/GLVSC-569-fix-refresh June 19, 2024 16:28
Base automatically changed from feature/GLVSC-569-fix-refresh to main June 19, 2024 18:12
Copy link
Contributor

@axosoft-ramint axosoft-ramint left a comment

Choose a reason for hiding this comment

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

A couple of suggestions on the base class and override strategies - mainly suggesting that we leverage abstract classes/fns.

CHANGELOG.md Outdated Show resolved Hide resolved
src/plus/integrations/authentication/github.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@axosoft-ramint axosoft-ramint left a comment

Choose a reason for hiding this comment

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

Apologies for multiple reviews - one more important thing I forgot in the previous review regarding "connect to remote".

src/plus/integrations/integration.ts Outdated Show resolved Hide resolved
@sergeibbb sergeibbb force-pushed the GLVSC-554-use-gkdev-github branch 2 times, most recently from d37fa99 to 6e6f918 Compare June 20, 2024 12:41
@sergeibbb sergeibbb force-pushed the GLVSC-554-use-gkdev-github branch 2 times, most recently from d78a8fb to f06921d Compare June 20, 2024 14:18
FTOSevenK

This comment was marked as off-topic.

@sergeibbb sergeibbb force-pushed the GLVSC-554-use-gkdev-github branch 5 times, most recently from 355cb5c to afcb2f4 Compare June 21, 2024 11:06
Copy link
Contributor

@axosoft-ramint axosoft-ramint left a comment

Choose a reason for hiding this comment

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

Currently, when testing with a GitHub repo on this PR branch, it shows that my remotes are not connected, and Launchpad also doesn't recognize my existing (VScode built-in) connected GitHub integration.

I did a bit of investigation and found out why - we covered existing built-in GitHub tokens in the createSession flow, but not in the getSession flow.

@d13 d13 self-requested a review June 25, 2024 15:28
@axosoft-ramint
Copy link
Contributor

Hey @sergeibbb, while reviewing your PR, I'd suggest the following code changes:

👉 Fixes integration.connect throwing error for GitHub

Ensures that manageCloudIntegrations is always called before attempting integration.connect for GitHub

You can also review and apply these suggestions locally on your machine.

Learn more about GitKraken Code Suggest

Code Suggest liberates your code reviews from GitHub's restrictive, comment-only feedback style. As simple as suggesting changes in a Google-doc, provide real code suggestions from where you code, e.g. your IDE, and on anything in your project — not just on the lines of code changed in the PR.

Join your team on GitKraken to speed up PR review.

@axosoft-ramint
Copy link
Contributor

@sergeibbb There are issues with integration.connect being called on a cloud integration before it is ready. manageCloudIntegrations should always be called before attempting the connection, or the user may not be logged in or may not see the settings page first.

I made some updates to address this - see my code suggestion above.

@sergeibbb sergeibbb force-pushed the GLVSC-554-use-gkdev-github branch 6 times, most recently from 326de11 to a1cf15f Compare June 28, 2024 17:14
that tries to check for existing GitHub session before accessing an integration on GKDev
…provider GLVSC-554

access it through a getter
…t createSession differently GLVSC-554

but share the common logic, which is implemented in the base class, of managing the created session
…t of the base flow GLVSC-554

stops calling the `super.createSession()` from the child.
sets the expiration period to 1 year from now.
Ensures that manageCloudIntegrations is always called before attempting integration.connect for GitHub
… GLVSC-554

Checks for the cloud integration connection fist, and then uses the vscode session as a fallback if the cloud one isn't there.
Copy link
Member

@d13 d13 left a comment

Choose a reason for hiding this comment

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

This is looking great. I've been able to successfully test:

  • With local integration, without GK integration
  • With GK integration, without local integration
  • With local integration fallback, after signing out of GK integration

src/constants.ts Outdated Show resolved Hide resolved
@d13 d13 requested a review from axosoft-ramint July 3, 2024 15:02
@sergeibbb sergeibbb merged commit 2f9750e into main Jul 3, 2024
2 checks passed
@sergeibbb sergeibbb deleted the GLVSC-554-use-gkdev-github branch July 3, 2024 15:10
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.

None yet

5 participants