Compiling and pushing static resources in SFDX

Issue #647 resolved
Luke Kozakewycz created an issue

Used to be able to just save files in the resource bundles and it would save everything. Now I save and nothing happens - doesn't even recompile the static resource file prior to deploying it.

Any ideas? Has the process changed for static resources?

This is an SFDX project.

Comments (9)

  1. Scott Wells repo owner

    Luke, this is all very recently implemented functionality for the SFDX pre-release builds. I had to wire static resource bundle management into the SFDX push/pull processes. Sounds like there's a bug in there still. Do you mind running the deployment with the following in Help>Debug Log Settings:

    #com.illuminatedcloud.intellij.builder.ForceComSfdxDeployer
    

    and then sending me your idea.log using Help>Show Log in Explorer/Finder/Files?

  2. Luke Kozakewycz reporter

    Hi Scott,

    Yes, this does seem quite buggy. I got it to work coming in the next day and playing around with it but then it started packaging everything inside the zip in a directory.

    Here is exactly what happened:

    1. Created a new static resource called AuraLib.resource (zip file)
    2. Create a resource bundle from this static resource
    3. Created a new file inside the resource bundle called helper.js and removed the placeholder
    4. Pushed the changes (Ctrl+Alt+Shift+F9)

    Resource exists in org but only contains the placeholder

    I then tried messing about with it and ended up getting a resource bundle folder structure like so:

    AuraLib.resource.AuraLib.resource/helper.js

    This would then save, but the static resource would end up with the following folder structure which is wrong:

    AuraLib.resource/AuraLib.resource/helper.js

    I delete it all out and start fresh with the right folder structure, save it and push the changes and this is what the logs gave me:

    2017-07-11 10:26:09,996 [  35545]  ERROR - emon.impl.AnnotationHolderImpl - IntelliJ IDEA 2017.1.4  Build #IC-171.4694.23 
    2017-07-11 10:26:09,996 [  35545]  ERROR - emon.impl.AnnotationHolderImpl - JDK: 1.8.0_112-release 
    2017-07-11 10:26:09,996 [  35545]  ERROR - emon.impl.AnnotationHolderImpl - VM: OpenJDK 64-Bit Server VM 
    2017-07-11 10:26:09,996 [  35545]  ERROR - emon.impl.AnnotationHolderImpl - Vendor: JetBrains s.r.o 
    2017-07-11 10:26:09,996 [  35545]  ERROR - emon.impl.AnnotationHolderImpl - OS: Windows 10 
    2017-07-11 10:26:09,996 [  35545]  ERROR - emon.impl.AnnotationHolderImpl - Last Action:  
    2017-07-11 10:26:14,141 [  39690]  DEBUG - j.builder.ForceComSfdxDeployer - Pushing 'ls-engage' to 'AuraDev' 
    2017-07-11 10:26:14,154 [  39703]   INFO - j.builder.ForceComSfdxDeployer - Updating single static resource from bundle C:/Users/Luke/sfdx/ls-engage/resource-bundles/UX.resource for deployment. 
    2017-07-11 10:26:14,324 [  39873]   INFO - j.builder.ForceComSfdxDeployer - Static resource AuraLib.resource is up-to-date relative to resource bundle directory. 
    2017-07-11 10:26:14,324 [  39873]   INFO - j.builder.ForceComSfdxDeployer - Using the sfdx CLI to push changes for project 'ls-engage' to scratch org 'AuraDev' with force=false, background=false. 
    2017-07-11 10:26:19,902 [  45451]   INFO - j.builder.ForceComSfdxDeployer - Push completed in 5s 578ms. 
    2017-07-11 10:26:19,906 [  45455]  DEBUG - j.builder.ForceComSfdxDeployer - Received push response:
    {
      "status": 0,
      "successResponse": {
        "status": 0,
        "result": {
          "pushedSource": []
        }
      }
    } 
    2017-07-11 10:26:19,907 [  45456]  DEBUG - j.builder.ForceComSfdxDeployer - Checking for conflicts. 
    2017-07-11 10:26:19,907 [  45456]  DEBUG - j.builder.ForceComSfdxDeployer - Push appears to have succeeded. Adding details. 
    2017-07-11 10:26:19,907 [  45456]   INFO - .IlluminatedCloudExceptionUtil - All files are up-to-date. 
    2017-07-11 10:26:19,908 [  45457]   INFO - .IlluminatedCloudExceptionUtil - Push details:
    {
      "successes": [],
      "failures": [],
      "numSuccesses": 0,
      "numFailures": 0
    } 
    

    By the sound of the logs, it isn't recognizing there's an update in the resource bundle(?).

  3. Scott Wells repo owner

    That helps, Luke. I'll take a look at why it's not picking up the change when it should. Hopefully it's something really simple with the dirty check. I appreciate the details!

  4. Scott Wells repo owner

    And of course the malformed structure will need to be fixed as well. Odd that it's doing that since I'm just reusing the exact same resource bundle management stuff, but perhaps I'm passing in the wrong portion of the path or something.

  5. Scott Wells repo owner

    I'll be including a fix for this in tomorrow's official build with SFDX. I was able to reproduce and fix the issues with dirty detection, but I wasn't able to reproduce the issues with the malformed structure. If you're still seeing those after updating to tomorrow's official build please add the following under Help>Debug Log Settings and send me the resulting log:

    #com.illuminatedcloud.intellij.builder.ForceComSfdxDeployer
    #com.illuminatedcloud.intellij.resourcebundle.StaticResourceBundleUtil
    
  6. Scott Wells repo owner

    Delivered in 1.8.0.4. Let me know if the changes in that build don't address all of the issues you've seen with SFDX/resource bundle support.

  7. Log in to comment