Connections filtered against IDE projects

Issue #2188 resolved
Adam Stepanek created an issue

Hi Scott,

I have multiple sf connection to multiple unrelated orgs, as a contractor this is I would say pretty common. And when I need to deploy metadata from one org to another it would be handy not to have to scroll through the connections to find the one I need as the rest are for completely different orgs.

So I was thinking if it would be possible to define, for example, that those connections A, B, C should appear only inside this project E, etc. Would it be possible?

Comments (14)

  1. Matthias Blom

    I’ll expand my +1 vote here. I currently have about 10 customers for which I have connections setup in SFDX, with multiple orgs each. Add to that some random playgrounds & dev orgs for messing around and a bunch of scratch orgs for package development, and I currenctly have 43 connections set up. This makes it a little tedious to switch between environments for one customer/package, for example when writing anonymous Apex in a sandbox and then running it in production for a quick fix, or running some SOQL queries.

    Another change that may help with this, is adding autofill/search to the project selection dialogs. For example, when using the connection dropdown in the anonymous Apex window and typing the list could automatically scroll to a first match.

  2. Gobius Dolhain

    We manage about 100 orgs across 40 separate clients, being able to just select relevant connections in a project would be heaven sent.

    I already found out you can add multiple connections to .idea/illuminatedCloud.xml by appending another IlluminatedCloudConnection entry in the list. This makes them show up at the top of the list under "Project connections"

    mO9hZMEeUj.png

    <?xml version="1.0" encoding="UTF-8"?>
    <project version="4">
      <component name="IlluminatedCloudSettings">
        <option name="connections">
          <list>
            <IlluminatedCloudConnection>
              <option name="connectionName" value="elf-sandbox" />
              <option name="connectionType" value="OAUTH" />
              <option name="defaultModuleName" value="elf-sfdc" />
              <option name="offlineSymbolTablePath" value="$PROJECT_DIR$/IlluminatedCloud/elf_sandbox/OfflineSymbolTable.zip" />
            </IlluminatedCloudConnection>
            <IlluminatedCloudConnection>
              <option name="connectionName" value="elf-production" />
              <option name="connectionType" value="OAUTH" />
              <option name="defaultModuleName" value="elf-sfdc" />
              <option name="offlineSymbolTablePath" value="$PROJECT_DIR$/IlluminatedCloud/elf_sandbox/OfflineSymbolTable.zip" />
            </IlluminatedCloudConnection>
            <IlluminatedCloudConnection>
              <option name="connectionName" value="elf-p1" />
              <option name="connectionType" value="OAUTH" />
              <option name="defaultModuleName" value="elf-sfdc" />
              <option name="offlineSymbolTablePath" value="$PROJECT_DIR$/IlluminatedCloud/elf_sandbox/OfflineSymbolTable.zip" />
            </IlluminatedCloudConnection>
          </list>
        </option>
      </component>
    </project>
    

    I know my changes to this file get reverted when I change anything to the module configuration and this isn't officially supported by IC.

  3. Scott Wells repo owner

    Hi. Yes, it’s in my work queue. I can’t say for sure when it will happen exactly (or guarantee that it will, but since it’s on my active radar, it’s likely), but it definitely wouldn’t be until after the new year.

  4. Scott Wells repo owner

    Interesting that you ask. It’s actually toward the top of my list now, but with Summer ‘23 being the next update (Monday of next week) and then an outage for a few weeks while I spend some summer holiday time with my family, mid-July would be the earliest it would be happening. But as I said, the good news is that it’s actually on the visible horizon…

  5. Scott Wells repo owner

    I’m likely going to start working on this shortly. I have a few ideas on the UX and thought I’d throw them out here for feedback. The Git status bar widget actually tackles a similar problem in a few different ways, so I figure I’ll start with an existing precedent:

    There are two features in play there, Recent and the ability to “star” entries.

    Recent is obviously a self-maintaining MRU, so extending this notion to connections, when you switch to or otherwise use a non-project connection in the context of the current project, it would automatically be added to that list, likely with a maximum number of entries and oldest (or perhaps least-used) ones rolling off as needed.

    Entries with a star are explicitly selected by the user and are always shown at the top of the list until/unless the star is removed.

    The advantage of the former is that it’s self-maintaining and likely shows what you want most of the time. The disadvantages, of course, is that if you only need a particularly connection once as a total one-off, it would end up in that list for some period of time, and also there would need to be some maximum length to that list.

    The advantage of the latter is that it’s explicit, though that’s also the disadvantage in that the user is required to take some action to designate each connection as being important for the current project vs. just inferring that from its use.

    Note that whichever approach is adopted--and it might not even end up being one of these two--the designated connections would show up everywhere that connections can be selected and are currently partitioned by project vs. non-project. This wouldn’t just be for the IC2 connection status bar widget.

    I’m inclined to go with the Recent approach, at least initially, and then determine whether something else is needed based on feedback. I just like the self-maintaining aspect.

    Thoughts from those who have expressed an interest in such a feature?

  6. Adam Stepanek reporter

    both solution works for me, the most important thing is that the solution, either Recent or Star, will be project scoped, meaning that a Recent list is project A will be different from list in project B.

    And one thing for the Recent list, I see two ways how the sorting could be implemented.
    1. for each connection have a timestamp a sort it from the youngest first to the oldest.

    2. have a count for each connection, each time it is used it increases by one

    I would say the second would be better as the list would not change the order as dramatically as with the first approach, and the user could get more easily used to the order of connection.

  7. Scott Wells repo owner

    Okay, I made really nice progress on this today using an MRU where entries are added automatically as you use alternative connections for metadata deployment/retrieval/removal, Anonymous Apex, SOQL Queries, Log Analyzer, unit test execution, etc., and are ordered based on frequency of use and time of last use descending (in that order), then by connection name and type ascending, e.g.:

    The Recent Connections section is now shown anywhere that connections are selected from (what was previously only) Project Connections and Global Connections, at least as long as there is at least one connection in the MRU based on prior usage.

    I’ve also added speed search to all of the connection selection combo-boxes, so finding those other connections initially is now much easier as well, e.g.:

    There currently is no limit on the number of connections that can be added to the MRU, nor is there an automatic expiration from that list. You also can’t remove entries explicitly. I’ll chew on options for managing MRU size/contents as I ready this for release, but hopefully this will provide a solid initial implementation of this for those who have been wanting it.

  8. Scott Wells repo owner

    More progress on this. I’ve added a number of configuration options:

    and now all of the connection selectors reflect that configuration quite clearly:

    The last thing I may do--other than extensive verification, of course--is add a way to clear the current project’s MRU entries if desired. Otherwise barring unforeseen circumstances, this should be included in Thursday’s build.

  9. Log in to comment