sourcery-ai / sourcery

Instant AI code reviews
https://sourcery.ai
MIT License
1.54k stars 68 forks source link

Sourcery is not working in Jetbrains remote development env #341

Open ergleb78 opened 1 year ago

ergleb78 commented 1 year ago

Hello! our team was a happy users of sourcery for a long time until we had to switch to Jetbrains Remote development. Technically, we can't even log in. It looks like browser redirect is working but then nothing is happening and Login butin still present in the plugin settings.

Could you please point out what we are missing?

Hellebore commented 1 year ago

Hi - thanks for raising this and sorry for the late reply.

I wasn't aware of Jetbrains remote development - we will have to investigate so we can make this work.

Hellebore commented 1 year ago

@ergleb78 Which OS do you run locally and on the remote server?

Also could you post/send a screenshot via email of the state of PyCharm while it is trying to login?

ergleb78 commented 1 year ago

Hi Nick!

Local OS: MacOS [image: image.png]

Host OS: DISTRIB_DESCRIPTION="Ubuntu 22.04.2 LTS" Not sure if it's relevant, but I'm using IntelliJ instead of Pycharm in this case. But behavior is the same.

Not sure if this is the screenshot you are looking for, but this is what the login screen looks like for me. It redirects me to the [image: image.png]

Login process starts normally, and when I open the browser and accept the device I get OK screen.

But then, when I return to IDE, it displays the second request to finish authentication with a different code: [image: image.png]

On the screenshot above you can see 2 codes: one which I requested when clicked "open in the browser" and the second one. Then it auth times out.

On Sat, Apr 22, 2023 at 3:38 PM Nick Thapen @.***> wrote:

@ergleb78 https://github.com/ergleb78 Which OS do you run locally and on the remote server?

Also could you post/send a screenshot via email of the state of PyCharm while it is trying to login?

— Reply to this email directly, view it on GitHub https://github.com/sourcery-ai/sourcery/issues/341#issuecomment-1518889134, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKQWHJDNXU6L4DT2CNLHWZLXCRMWVANCNFSM6AAAAAAXFAOKY4 . You are receiving this because you were mentioned.Message ID: @.***>

Hellebore commented 1 year ago

Thanks! Unfortunately I can't see the screenshots there - could you please also send the mail to support@sourcery.ai?

We're still investigating and trying to reproduce the issue (we were all at PyCon US last week).

One possible workaround to try is that the outcome of the login process is an auth.yaml file with your sourcery token, which on mac lives at: /Users/YOUR_USER/.config/sourcery

If it's possible, taking this file from your local machine and dropping it in the remote one, at: $HOME/.config/sourcery should get it up and running.

Hellebore commented 1 year ago

While this is still an issue, a workaround was to login on the remote machine using the Sourcery CLI login command.