ChrisCarini / automatic-github-issue-navigation-configuration-jetbrains-plugin

A plugin that automatically configures the IDEs Issue Navigation for GitHub projects.
https://plugins.jetbrains.com/plugin/19543-automatic-github-issue-navigation-configuration
Apache License 2.0
6 stars 0 forks source link

Linking issue doesn't work with multiple repositories projects. #174

Open mrm-david opened 1 year ago

mrm-david commented 1 year ago

I have a project with 2 repositories, one for the server and one for addons. I code on the addons, and only update the server once in a while.

When clicking on an issue from the addons log, it opens the issue on github on the server project.

ChrisCarini commented 1 year ago

Hi @mrm-david - thanks for opening this issue.

For my own ease, do you happen to have steps to reproduce exactly what you are seeing, ideally including a public project I can use to confirm/test against?

I think it might not be possible to distinguish/accomplish what you'd be looking for here, as the plugin simply automatically configures Issue Navigation (in your IJ settings, see Version Control -> Issue Navigation), and there is no easy way to distinguish between repositories to the best of my knowledge. If you know of a way to manually configure this so that it works as you expect, please also include those steps, as well!

mrm-david commented 1 year ago

Hi. First of all, thanks for the extension. Unfortunately I am working on a private project at the moment. I'll try to see if I can find the time to make an example project with a public repo.

ChrisCarini commented 1 year ago

Sounds good. If it's faster for you, try to manually configure multiple in the settings menu I mentioned previously and see if it works as expected. If it does, then let me know and there is possibly a chance to make an improvement here; if it is not possible, then I'd recommend opening a feature request with JetBrains (youtrack.jetbrains.com) so they can implement (if you do, please share the feature request link here, as well).

ChrisCarini commented 11 months ago

I opened a feature request with JetBrains -> https://youtrack.jetbrains.com/issue/IDEA-339598/Version-Control-Issue-Navigation-configuration-on-a-per-repository-basis

I happen to kinda have this implemented in intellij-community, thought I'm sure my code is sub-optimal. In the above ticket, I am essentially either (a) seeking guidance from someone from JetBrains, or (b) someone from JetBrains dev team to take over my change.

ChrisCarini commented 2 months ago

🚧 Workaround 🚧

I was chatting with a colleague at work and they presented the following as a workaround.

In the .idea/vcs.xml file, change the following:

...
  <component name="IssueNavigationConfiguration">
    <option name="links">
      <list>
        <IssueNavigationLink>
          <option name="issueRegexp" value="\(#(\d+)\)" />
          <option name="linkRegexp" value="https://github.com/sample_org/repo_you_want_to_use/issues/$1" />
        </IssueNavigationLink>
        <IssueNavigationLink>
          <option name="issueRegexp" value="ignorethisplease" />       <!---- CHANGE THIS LINE -->
          <option name="linkRegexp" value="https://github.com/sample_org/repo_you_want_to_ignore/issues/$1" />
        </IssueNavigationLink>
...

and commit this file to your VCS.

The next time the IDE starts with this plugin installed, the plugin will see that the URL for the repo is already configured and will not try to re-configure. It does have the (minor) side effect of linking any ignorethisplease text you might have in your code, but that's unlikely to happen, and if it does, this value can be changed to some random sequence of chars to reduce the likelihood even further.