How can IC sync changes to sandbox during git change branch?

371 views
Skip to first unread message

cfel...@twitter.com

unread,
Apr 5, 2016, 1:18:21 PM4/5/16
to Illuminated Cloud General Discussion

How can I configure the IlluminatedCloud plugin for to look for changes during a git branch switch and sync those with my Sandbox connection?


Right now when I branch switch some of the old branch files will stay on my Sandbox and when I run tests it will use files from old branch and give incorrect results unless i make a change to the old files to get them to save to sandbox.


Thanks!

Scott

unread,
Apr 5, 2016, 4:36:26 PM4/5/16
to Illuminated Cloud General Discussion
Chris, by default IntelliJ IDEA will scan the file system frequently (including when the IDE window gains focus) and reconcile the physical file system contents with its last known internal virtual file system state.  When it does this, it fires events for adds, updates, and deletes.  Illuminated Cloud listens for these events and can react to them automatically.  By default IC will not automatically deploy code for add and update events resulting from external changes.  You can enable this under Settings>Illuminated Cloud>Validation and Deployment by checking Deploy on external change.  As for deletes, IC will prompt you as to whether deleted files should be propagated into the org.  The problem is that if you haven't deployed updated files that reference those deleted files, the delete operation in the org will likely fail.

So, based on this explanation, what I would do is keep Deploy on external change disabled and, after switching branches, use IC to deploy the metadata for your project/module (Build>Illuminated Cloud>Deploy Modified/All Metadata).  Once that completes, start the recently-added bulk delete action (Build>Illuminated Cloud>Delete Metadata) and filter to Server Only (uncheck Local Only and Local + Server).  Depending on your metadata subscription, you may see some items that weren't deployed by you (sample data in dev orgs, etc.), but overall make sure the that should no longer be there are selected and click OK.  When the delete completes, your org should reflect your local branch.

There are probably ways to automate this a bit more, but it's hard to know exactly what can/should be safely removed from the org, and I'd rather err on the side of caution when doing so.

Hope this helps!
Scott

Scott

unread,
Apr 5, 2016, 4:59:52 PM4/5/16
to discu...@illuminatedcloud.com
Another user replied directly:

I do wish there was a quick way to toggle this off/on for times when I'm not connected to the internet.

Yeah, I've considered adding a true "offline mode" to IC that, with a single toggle, turns off all operations that would expect a server to be present.  I thought I even had an enhancement on the existing backlog, but I just looked and didn't see one.  I'll correct that shortly!  I think this becomes even more useful when I start to add local code inspections and intentions that help write correct/valid code before ever sending it to Salesforce.  It would allow you to have a reasonable coding session while disconnected, though obviously with Development-as-a-Service, there are still going to be pretty significant limits to how far you can get with that.  And of course upon going online, it would give the option to reconcile with the server to catch things up.

I'll definitely get this idea entered into the issue tracker and prioritized, though.

Regards,
Scott

UPDATE: Added the enhancement request.
Reply all
Reply to author
Forward
0 new messages