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

Implement gitpod auth and settings sync #337

Merged
merged 1 commit into from
Apr 28, 2022
Merged

Conversation

jeanp413
Copy link
Member

@jeanp413 jeanp413 commented Apr 13, 2022

related gitpod-io/gitpod#9136

Telemetry Events:

Common properties:
'common.extname': 'gitpod.gitpod-desktop',
'common.extversion': '0.0.29',
'common.nodeArch': 'x64',
'common.os': 'linux',
'common.platformversion': '5.13.0',
'common.product': 'desktop',
'common.uikind': 'desktop',
'common.vscodemachineid': '0d34d9a02c8981a664b756b27f73587b165f6c17b020744a3f2f5167081e1682',
'common.vscodesessionid': '859abcd9-0bb7-4b3d-a33c-574ac0ff2a631650380562678',
'common.vscodeversion': '1.67.0-insider',
  • gitpod_desktop_auth
    • Properties:
      • kind: login or logout or login_cancelled or login_failed or logout_failed
      • scopes: '["function:accessCodeSyncStorage","function:getGitpodTokenScopes","function:getLoggedInUser","resource:default"]'
  • gitpod_desktop_settings_sync
    • Properties:
      • enabled: 'true' or 'false'
  • gitpod_desktop_installation
    • Properties:
      • kind: install

@akosyakov
Copy link
Member

I think we can do analytics with another PR?

@akosyakov
Copy link
Member

Screenshot 2022-04-14 at 09 50 35

Let's change it to:

  • Restart VS Code for the new Setting Sync configuration take effect.
  • Reload this window

@akosyakov
Copy link
Member

Wow, code looks so well-structured ❤️ and you seem to address all important concerns.

@jeanp413
Copy link
Member Author

Let's change it to:

  • Restart VS Code for the new Setting Sync configuration take effect.
  • Reload this window

reload it not enough, you need to close all windows

@jeanp413
Copy link
Member Author

jeanp413 commented Apr 14, 2022

I think we can do analytics with another PR?

telemetry is done just needed a few 💄, I'll upload another vsix

@jeanp413
Copy link
Member Author

jeanp413 commented Apr 14, 2022

Added vsix file updated with telemetry (telemetry key added manually before creating the vsix for now, asked @jakobhero if it's Ok to push it to github or not, MS does commit it in it's extensions)

Telemetry event can be viewed here

@akosyakov
Copy link
Member

reload it not enough, you need to close all windows

yes, that's why I wrote Restart in message and reload this window. As far as I understand close this window does not close it but reload?

@jeanp413
Copy link
Member Author

jeanp413 commented Apr 19, 2022

@akosyakov added telemetry event description at the PR description

@akosyakov
Copy link
Member

It seems that code validating token was dropped, why? We should make sure that if a token gets expired on server side or we modify an extension to add more scopes then token should be invalidated.

@akosyakov
Copy link
Member

@jeanp413 @filiptronicek Could you rephrase UI facing messages to avoid Gitpod Code Sync Provider. It should be called Setting Sync with Gitpod. I see user facing error messages like Error setting up Gitpod Code Sync Provider and so on. Please scan source code of destkop extension and replace it with talking about enabling/disabling Settings Sync with Gitpod.

@akosyakov
Copy link
Member

akosyakov commented Apr 20, 2022

@jeanp413 It looks like we will produce a lot of tables with such analytics events. Can we rather have only 3 events with different properties and timestamp to indicate progress:

  • gitpod_desktop_installation to track when extension is installed/uninstalled
  • gitpod_desktop_settings_sync to track enablement
  • gitpod_desktop_auth to track progress with Gitpod auth

These events thought won't be enough still to understand whether a user is really synching with us. Is there a way to track it from VS Code extension or we need to track in server then? machine ids are propagated with sync requests as headers?

@jeanp413
Copy link
Member Author

gitpod_desktop_installation to track when extension is installed/uninstalled

I think there's no API to know from within the extension when it was installed the first time or uninstalled

These events thought won't be enough still to understand whether a user is really synching with us. Is there a way to track it from VS Code extension or we need to track in server then? machine ids are propagated with sync requests as headers?

We'll need to do it in the server, no API for that

@jeanp413
Copy link
Member Author

Added gitpod_desktop_installation event on first install

Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

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

LGTM 🎉
image

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

it looks good to me, besides #337 (comment)

@filiptronicek Could you double check following:

  • switching between Gitpod host does not require auth again because we delete token unnecessary
  • opening with VS Code Desktop still works

@jeanp413
Copy link
Member Author

jeanp413 commented Apr 27, 2022

@filiptronicek can you test and if everything looks good to you too approve it so we can merge this and release 🚀

  • switching between Gitpod host does not require auth again because we delete token unnecessary

P.S.: updated vsix file in the PR description

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

It worked nicely for me. I left some comments about user facing naming casing. It does not match to how other commands are named.

Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

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

opening with VS Code Desktop still works

Yes it does! All looking good.

For some reason I also wanted to try installing extensions not on OpenVSX. It looks like it is behaving correctly by not removing it, just skipping it from sync in places where it is not available...

[2022-04-28 18:47:33.081] [settingssync] [info] Extensions: Skipped synchronizing extension because the extension is not found. github.copilot

@jeanp413 jeanp413 merged commit 55ad182 into gp-code/main Apr 28, 2022
@jeanp413 jeanp413 deleted the local-settings-sync branch April 28, 2022 20:29
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.

3 participants