Scratch orgs are not available in Connection list

Issue #1288 resolved
Kostas Vorilas created an issue

After latest plugin upgrade, scratch orgs (active) are not available in the Connection list (see attached image) of Configure project. Please note that sfdx force:org:list displays active scratch orgs and active orgs are available in Anonumous Apex tab connection list. It seems that there is a problem only with Connection list in Configure Project.

Webstorm version 2019.1.1

Comments (12)

  1. Scott Wells repo owner

    Kostas, do you have a file named manifest/package.xml as a peer to sfdx-project.json? If so, that's the reason for this behavior. IC is recognizing the project as an SFDX-develop-against-any-org project instead of as a scratch org project. It will only allow you to select SFDX non-scratch org connections for those types of projects. This is intended behavior, though if there's a use case that I haven't contemplated around a scratch org project with a package.xml file, please let me know and I'll be happy to take a look.

  2. Kostas Vorilas reporter

    @Scott Wells thanks for your quick response. Yes, you are right. We do have manifest/package.xml and it is intended (I can not recall why but I will ask and let you know). Please note that until 2.0.5.6 we had no issue with connections.

  3. Scott Wells repo owner

    That's correct. Support for SFDX-develop-against-any-org projects was added in 2.0.5.7, so that's when IC started to treat the combination of an sfdx-project.json and manifest/package.xml file as indicative of that project type. That's why you see the change in behavior, and it's very much intentional. I think the real question is whether there's a good use case for having a manifest/package.xml file and still wanting to work with scratch orgs. If so, I'm happy to revisit the current mutually-exclusive behavior. Please let me know what you learn about the presence of that file in this project that's intended to be used with scratch orgs. Thanks!

  4. Kostas Vorilas reporter

    @Scott Wells It was added from a VScode user as he wanted to directly deploy (and filter types) to packaging org using right click. We will remove it from our project and put it on .gitignore as he prefers to keep it. I believe we can close this ticket.

  5. Scott Wells repo owner

    I think that's a completely valid use case and something I'd already considered supporting. I'll definitely plan on adding support for deployment of metadata primarily oriented toward a scratch org to a non-scratch org (and the same for retrieval) via force:source:deploy/retrieve. That would also resolve this issue for you because the presence of a manifest/package.xml wouldn't by itself cause IC to see a module as being for SFDX-develop-against-any-org. Instead the user would be allowed to choose any SFDX connection--whether for a scratch org or a non-scratch org--and the connection selection would determine the primary method of moving metadata back and forth for things like deploy-on-save. If against a scratch org, though, the user would still be able to deploy/retrieve against any non-scratch org.

    I'll see if I can get that in over the next few weeks. Thanks for the context!

  6. Kostas Vorilas reporter

    @Scott Wells Thanks again for your swift response. We will be happy when/if you provide a solution. Until then we will remove it temporarily from our project.

  7. Log in to comment