New IC project is initialised without the selected metadata

Issue #2219 resolved
René Görgens created an issue

Hi Scott,

Something weird just happened on the way to a new project:

  • Context: I wanted to manually replicate an existing project from another machine (while temporarily being unable to access the existing project on the other machine and in the absence of version control), thus I painstakingly selected dozens of metadata
  • I selected package.xml
  • I proceeded to create project/ retrieve metadata (definitely checked, w/o generating an offline symbol table)
  • No metadata were retrieved. Is that normal behaviour? If so, would it be possible to alert the user that no metadata will be retrieved if no existing package.xml is actually selected while metadata are being selected?

I’m a bit confused here. Thanks in advance.

Comments (12)

  1. René Görgens reporter

    I now understand better how one can work with package.xml:

    • The file needs to exist for IC to populate it. For it to already exist, I have:

      • Created an empty project, resulting in an empty package.xml
      • Configured the package.xml via Configure Module
    • Then used this package.xml to retrieve the metadata

    I still find the ‘new project’ dialogue somewhat ambiguous in this regard, I can select package.xml but (unless I am mistaken) the package.xml (for a project from scratch) doesn’t exist at that stage. So in order to avoid the above workaround (if it is one), it would be good to have the option ‘generate package.xml’. Or perhaps this is what’s already supposed to happen? Then I found that it didn’t happen for me in the instance described initially.

  2. Scott Wells repo owner

    Which new project option did you choose, Illuminated Cloud or Illuminated Cloud SFDX? For the former, you choose the subscription type as a step of the new project wizard; for the latter, IC2 is just driving the Salesforce CLI’s force:project:create command, and if you want a package.xml file there’s an option to include one via the Generate Manifest option:

    This should all be documented in this user guide topic:

    https://bitbucket.org/RoseSilverSoftware/illuminatedcloud/wiki/User_Guide/Create_SFDX_Project.md

    Please let me know if that doesn’t resolve this for you.

  3. René Görgens reporter

    I chose Illuminated Cloud

    I tried this again:

    1. New project wizard:

      • I select package.xml w/o clicking into the file dialogue
      • I select 1 metadata
      • In the second step I select only ‘Retrieve metadata from Salesforce’, nothing else
      • Result: no metadata is retrieved, package.xml is empty, .iml only lists package.xml
    2. New project wizard:

      • I select “Selected”
      • I select 1 metadata
      • In the second step I select only ‘Retrieve metadata from Salesforce’, nothing else
      • Result: the selected metadata is retrieved, package.xml and .iml are both listing the metadata

    For me this is a defect, in scenario 1 I select metadata to be retrieved but nothing is retrieved.

    This was with 2.2.3.6. Updated to 2.2.4.1 but it’s the same

  4. Scott Wells repo owner

    Gotcha. Yes, you’re correct that choosing Package.xml in that new project wizard has no effect, and that’s because the project directory in which that file would reside does not yet exist until you complete the new project wizard. The workflow is to use Selected initially which will in fact perform a metadata retrieval then switch to Package.xml if desired which will result in creation/populating of a package.xml file in the now-present project directory structure based on the current metadata subscription. I’ll make sure that the Package.xml option isn’t available for selection in that wizard step to avoid this confusion.

  5. Scott Wells repo owner

    I actually decided to take care of this properly and implement full support for Package.xml subscriptions in the new project wizard for metadata format projects. Now if you select that option in the wizard, it will show a default path of src/package.xml (not editable) and enable the metadata selection tree just as if you had chosen Selected. The selected subscription is used to seed the initial package.xml file and then used for the initial retrieval.

    This should be included in this week’s Thursday build.

  6. René Görgens reporter

    Re-test OK, but it worked only after a second IDE restart (manual close/open), not after the first IDE restart suggested by the plugin update process.

    • The first attempt after restart resulted in an empty package.xml and no metadata retrieved (in spite of 8 Apex classes having been selected).

  7. Scott Wells repo owner

    Hmmmm…I’ve never heard of that. If you see such strange behavior again let me know. Not sure if it just didn’t take the update the first time or what…

  8. Log in to comment