edgafner / dorkag

Issue Tracker repository for all Dorkag plugins
Other
5 stars 0 forks source link

[BUG]: Unable to switch repositories after logging in without deleting and re-creating credentials each time #77

Closed TaighHawkins closed 5 months ago

TaighHawkins commented 5 months ago

Describe the bug As in the title. When switching to a new repository (within the same project) the plugin gets stuck at: (image1) and if click Log In it then expects you to enter a new token, but if it's a token for the same account you just get (image2)

To Reproduce Steps to reproduce the behavior:

  1. Open a repository
  2. Log in
  3. Switch to a new repository (on either a new window or the current window)
  4. See error

Expected behavior Seamless transition between the repositories, at the very least, the login should attempt to use the credentials before trying to create a new account

Screenshots image1 image2

Desktop (please complete the following information):

JetBrains IDE (please complete the following information):

Azure Devops organization details:

Jonatha1983 commented 5 months ago

@TaighHawkins Thanks for reporting I ll investigate this.

Just checking Is it a fork repo you trying to switch? Or completely different repo?

TaighHawkins commented 5 months ago

Completely different repos, but all within the same project (so far)

Jonatha1983 commented 5 months ago

@TaighHawkins Maybe I am missing something, but to clarify, you can't switch to a completely different repo if it does not exist in your current opened local repo.

The plugin has the same functionality as Jetbrains' GitHub and GitLab plugins—it doesn't let you see all pull requests from all your repositories on your source code provider, but only those related to the current Git repository.

Look at your git remotes, ``git remotes—vv, the output of remotes is the list of repositories the plugin should let you connect with.

To view PRs from other reports, you must open the corresponding IDE project, but you don't need to change anything with your account settings.

TaighHawkins commented 5 months ago

Sorry, let me clarify.

I have my Devops organisation 'Thawkins".

I've opened Rider and opened one Repository in my project "Hello". Let's call it "API 1".

I open the plugin, and I connect to the Devops service, so I'm now connected to "THawkins: Hello/API 1 origin" ({Org}: {Project}/{repo} {remote repo alias}) in the plugin and I can create a pull request. Happy days.

I now have some work on a different repository, "Function 1" in the same project. So I close and reopen Rider (or switch or open a new window, behaviour has been the same) and when I go to the AZD plugin I am blocked. The plugin states it is trying to connect to "THawkins: Hello/Function 1 origin". But all I have is a "Log In" option. If I click this I have to enter a new token. If I enter a new token it tells me the user account already exists.

Essentially, my experience with the plugin has been that you can only work on one repo in a given project and that is unfortunately, rather inconvenient.

Hopefully this helps?

Jonatha1983 commented 5 months ago

@TaighHawkins Yes, it helps a lot, thank you.

I could reproduce in a specific scenario - and it is indeed a bug.

It happened to me when I had one local repository that I cloned with SSH and another with HTTPS.

I will fix it, but for now, what you can do (if you can) is change the remote of one of them so they will both be SSH or HTTPS - in that case, the plugin recognizes that it is the same valid account.

This is a short video of me switching repositories in the same project ( BTW, it should also work for cross projects and cross organizations ), and this is how it should work:

https://github.com/edgafner/dorkag/assets/3816566/ff2f0dde-4932-470e-9338-4e6af754070c

Sorry for the inconvenience and I will update you once a fix is release.

Jonatha1983 commented 5 months ago

@TaighHawkins version 2024.1.51 contains a fix for this.

It is pending Jetbrains' approval on the marketplace. ( 1-2 days)

Thanks for reporting. If the issue persists, please feel free to reopen it.

Jonatha1983 commented 5 months ago

@TaighHawkins Version 2024.1.53 was approved by jetbrains - please let me know if this version fix the issue for you.

Thanks