- changed component to Deployment and Retrieval
DX Connection doesn't save correctly in Configure Project.
I have multiple DX modules in my project, I create a new scratch org, and then select Configure Project
from the Illuminated Cloud menu. I select the new scratch org from the connection dropdown for each of the modules in the project. I click the save button, everything appears fine. However, if I go to Configure Project
again, only the last module has been successfully updated to the new scratch org, the rest are unspecified
. I have to manually update the .iml file for each of the other modules.
Comments (36)
-
reporter -
reporter -
assigned issue to
-
assigned issue to
-
repo owner Thanks for filing, Rowan. Yeah, it sounds like from
#740and this story that there are issues with SFDX and multi-module projects. I'll take a look in the next few days. Hopefully it's some minor stuff required to make it all work properly. I'll keep you posted via these two tickets. -
reporter Hey Scott, no problem at all. Not massive issues, they're easy enough to get around. Just thought I'd log them anyways. Thanks for that, and the quick response :-)
-
reporter - marked as major
Updating the priority of this. The more DX projects that we include in the project, the more tedious it becomes to update each of the project's
.iml
files. -
repo owner Rowan, for this and for
#740, can you describe the way your multi-module project is set up? In particular I'd like to know the general directory structure including where the key SFDX files and directories reside (e.g.,.sfdx/
andsfdx-project.json
) for each module, and which scratch orgs are used by each module. I want to make sure I'm setting things up properly as I look at supporting this. Oh, and what manual changes are you having to make to the.iml
files to make it work? Thanks! -
reporter Hi Scott, thanks again for the quick response. Right. I'll try and explain. We currently have eight Github repositories housing the relevant code. I initially opened the
Core Project
, and then added the rest of them as modules. Similar to as follows:Core Project Utilities Common Components etc ...
Each of these modules contain a
.sfdx
directory andsfdx-project.json
file in the root of module, and get deployed to the same scratch org. In the.iml
file, I need to update theconnectionName
value in theIlluminated Cloud
facet for all projects other than the last one (which is the only one that gets updated inConfigure Project
) e.g<facet type="IlluminatedCloud" name="Illuminated Cloud"> <configuration> <option name="connectionName" value="project-scratch-org-1" /> <option name="deploymentSubstitutionRules"> <list> <SubstitutionRule> <option name="filenamePattern" value="" /> <option name="substitutionPattern" value="" /> <option name="substitutionText" value="" /> </SubstitutionRule> </list> </option> <option name="moduleContents"> <ModuleContents> <option name="manifest"> <Manifest /> </option> </ModuleContents> </option> </configuration> </facet>
Is that enough to get you up and running? Thanks again for looking into this.
-
repo owner That helps, yes. A few more questions if you don't mind. First, is the source code for these modules all intended for deployment into a single scratch org, or are you deploying into a scratch org per-module? I was under the impression that it was the former and these were all truly "modules" of the same code base broken out for better separation of concerns and management.
If that's the case, are these all just package directories in a single shared
sfdx-project.json
at the project-level?If that's the case (and I realize that at this point I may be asking the complete wrong questions if my expected answer to the first question was wrong!), have you considered setting up this project as a single module with multiple content/source roots, one for each package directory? That's generally how I'd intended to map SFDX projects to IntelliJ projects/modules, and it's one of the motivations for the recent enhancement to support multiple source roots with one designated as the default source root...which maps to the default package directory.
Let me know if I'm way off-base here and missing what you're trying to do. If that's the case I'll definitely go back to the drawing board.
-
reporter I don't mind at all :-) Ask away. The code for these modules will be deployed into a single scratch org (at least that's how we're currently developing it). However, some of these repositories will be shared across teams.
Common Components
for instance will be used by multiple teams, but deployed to their own scratch orgs. So in that sense, the intention is better separation of concerns, and management.Would setting it up as a single module with multiple contents/sources still work if some of those modules had to be in separate Github repos?
-
repo owner Yes, you can set up version control for your single-module project where each directory is associated with a different repo (or even VCS provider if you want). Open up Settings>Version Control and you'll see a table where you can add a row per-directory and set the VCS config for that directory. In that manner you can have a single-module project with multiple source roots, one per-package directory, each pointing to a different Git repo, and I think you'll get the desired behavior. I would say tinker with that a bit and let me know if/how it doesn't meet your needs.
-
reporter Ah, I didn't realise that functionality was available. I just tried it there now, but the plus sign is disabled for some reason. I'll do a bit of investigation, and let you know.
-
repo owner Let me know what you find. I can also try to set up a "multi-module" SFDX project as a single module as described and send it over to you as a reference implementation. I probably wouldn't be able to do that until this weekend, though, but I'm happy to do it. Honestly it would be educational for me as well just to put something concrete to the thoughts I'm sharing with you.
-
reporter I will do. Just trying to read up on the VSC config that you suggested. That would be perfect - the weekend is absolutely fine. Thanks for that.
-
repo owner Issue
#740was marked as a duplicate of this issue. -
reporter Hey Scott, right I have that setup as you suggested, and it looks great :-) You've converted me - It seems to meet our needs alright. I'm more than happy to move to that way of setting up multiple modules for a dx project. So just for my own edification, I'll now have to update the
sfdx-project.json
to include those other directories in thepackageDirectories
node? -
repo owner - changed status to resolved
Outstanding! That's how I'd like to see SFDX projects configured because it maps very cleanly to the
sfdx-project.json
package directories.I'm resolving this issue since Rowan has found the proposed solution satisfactory. I noticed that there are several other watchers/followers on this issue. If one of you still wants to discuss multi-module SFDX projects, feel free to reopen with details on your setup and we can see if the same approach would apply or not.
-
reporter Thanks for all the help Scott :-)
-
reporter Sorry Scott, I seem to have hit another issue. Whenever I add one (or more)
Context Roots
to my "main" project, and restart IntelliJ, or close and re-open the project (this is crucial to reproduce the issue) , the project seems to revert to the old style metadata dev-org setup. I get the following error:Invalid configuration for module 'main-project' Module 'main-project': The following must be configured properly: module's configured connection must resolve to a global connection module connections must have configured credentials module must have a configured metadata subscription Full resolution of these items may require multiple steps.
if I remove the added "Utils"
Content Root
and restart the project, it seems to work fine, and it reverts back to the scratch-org setup. -
repo owner - changed status to open
Okay. There may still be some warts to work through. Let me set up a project this way on my own this weekend and see whether I encounter the same issues. If so, I'll address them for a build early next week.
-
reporter One other thing I've noticed Scott. While you're working through those warts ;-) When I load a project as a
Context Root
, I don't get any files appearing underaura
,labels
,customMetadata
,layouts
andpermissionSets
. Actually, the only files I seem to get are underclasses
andobjects
. For objects though, I only get field directories - no files, and I don't get anything appearing underfields
andvalidationRules
either. Everything appears fine if I load the project as an existing module. -
reporter Hey Scott, how're things? Here, just wondering if you've had any luck reproducing the above?
-
repo owner Rowan, I actually did set up a project just last week with three separate package directories each with multiple source roots beneath them (for production vs. test source and also unpackaged/post-install source) and haven't run into any issues with it. I may need to work with you to understand the difference between how I've configured this one and how you've configured yours so that I can either model the same thing as you and hopefully reproduce the issue or help you model yours the same as mine and help you to resolve the issue. Maybe we should just do a quick screeshare sometime soon to compare notes. That might be the most expedient path forward.
-
reporter Hey Scott, damn. I wonder what I'm doing wrong then. A screen share would probably be the best way forward. I'll see if I can reproduce on a demo project setup, and let you know.
-
repo owner Let me know when you have a simple standalone project that reproduces the issue. You can either just send that to me for triage or we can jump on a screenshare.
-
reporter Hi Scott, how's things? Here, I'll just show you what's happening on our current project. It would be way easier than trying to set up several others to reproduce things. Let me know when suits you to do a screen share, and I'll show you the issues I'm having. Thanks again.
-
repo owner Rowan, I apologize for the long-delayed response here. We've had a major deadline in my day job that has caused me to be rather sidetracked. I should be available for a screenshare to compare notes this week if you're also available. Just let me know and I'm sure we can find a common time. Sorry again going dark on you!
-
reporter Hey Scott, no problem at all sure. :-) I'm available all this week. Let me know when suits you - and I'll work around that.
-
reporter Hi @RoseSilverSoftware - do you think we could have a look at this in the foreseeable future? I appreciate you're probably flat out with with work.
-
repo owner Hi, Rowan. Yeah, I've been much less responsive on this than intended. Again, sincere apologies. Do you have some times later this week that you might be available for a screenshare so we can compare approaches? I'm also at TrailheaDX next week if you happen to be going. We could grab some time there if so.
-
reporter Hi Scott, no problem. I noticed you've released version 2, so figured you were pretty busy. I absolutely have time. I'll make sure I'm free whenever suits you? I'm in Dublin, not too sure where in the world you are. Afraid my company won't be forking out for
TrailheaDX
- unfortunately. -
repo owner Hey...sorry...fell behind again. Yes, things are a bit crazy. My availability tomorrow is a bit sketchy right now. How does Monday look for you? After that I'm going to be heading to TrailheaDX for the remainder of the week, so that won't work well either.
I'm in Austin, TX, by the way. Just let me know if Monday works for you, and if so, ideally some times that might work. I'm in CDT which is (I think) ~6 hours behind you.
-
reporter Monday would be perfect Scott, thanks. I'll be available all day so we're rocking.
-
repo owner Rowan, can you send me an email at support@illuminatedcloud.com so that I can set up a Hangouts meeting for us on Monday? I need an email address to do so.
-
reporter @RoseSilverSoftware Working like a charm - thanks again for your time. I'll mark this resolved.
-
reporter - changed status to resolved
-
repo owner - changed component to Metadata Deployment/Retrieval/Removal
- Log in to comment