package.xml is not being retrieved

Issue #763 resolved
Ivan Shcheklein created an issue

When we run the metadata retrieval (module or project) it does not show package.xml to merge:

Screen Shot 2017-10-26 at 9.25.27 PM.png

Like it does not exist in Salesforce.

It means that no matter what we do locally or in Salesforce package.xml is out of sync.

Version 1.8.1.1-idea14

Comments (10)

  1. Scott Wells repo owner

    So here's the deal with package.xml during retrieval...IC actually removes it from the downloaded content under the following circumstances:

    • The retrieval scope is based on context or custom selection. It's removed in these situations because only a subset of metadata has been retrieved and the package.xml file included in the retrieved metadata package would itself represent that subset.
    • The metadata subscription is based on a package.xml file. It's removed in this situation because IC generates its own package.xml file for the retrieval to ensure that wildcards in your local package.xml file don't accidentally result in way more metadata being included in the retrieval than intended/expected.

    When IC originally did retain the retrieved package.xml file in both of these situations, users accidentally overwrote local, carefully hand-crafted package.xml files with the retrieved on and lost changes (yes, those files should have been under version control, but that's not always the case). As a result, based on feedback from users I changed things to work the way they do today.

    Note that IC does support updating your local package.xml file based on the metadata files in the filesystem using the Add to Metadata Subscription action. After pulling the metadata you want from your org, if you're configured for a Pacakge.xml metadata subscription, you should be able to run that action on your source root and IC will add any new files to the respective clauses. It'll even respect wildcards, though it won't create them for you.

    So that's more of an explanation of how things work now and why they work that way. I'm happy for this to be just one step in a dialog on how you might like to see that change based on your particular workflow needs.

  2. Ivan Shcheklein reporter

    That was quick as always, thank you Scott! Let me digest and try those things. Quick question - how do I check if metadata subscription is based on package.xml or something else (what is that option? is there some documentation?). Thanks!

  3. Scott Wells repo owner

    Just go to Illuminated Cloud>Configure Module and it's whichever radio button you've chosen, either All/Package, Package.xml, or Selected. I will be crashing for the evening very shortly but can continue this discussion tomorrow once you've had time to digest.

  4. Ivan Shcheklein reporter

    So, I tried to set All/Package:

    Screen Shot 2017-10-27 at 4.12.34 PM.png

    It does not see package.xml on retrieval.

    It's now also showing a lot stuff (fields, actions) for Account, Lead, Contact, Opportunity that is not related to the package itself.

  5. Scott Wells repo owner

    I should have pointed out that you don't want to use All/Package. I've thought about removing that altogether but there are some folks who use the All side, and the Package side is useful if you're developing managed packages. If you're maintaining a package.xml file you should choose Package.xml and point it at your package.xml file. IC will not include the retrieved package.xml in the directory diff, though. It wouldn't merge into your local, hand-crafted one well. To help maintain that you should use Add to Metadata Selection when you've added new files into your local filesystem.

  6. Ivan Shcheklein reporter

    So, I created a Node_Test field via Salesforce UI, added it to the package. I'm trying to update now my local metadata files (including package.xml). It's set to use src/package.xml. When I try to sync it does not pull the field description into the Account's metadata file. It does not pull package.xml (that is expected, as far as I understand).

  7. Scott Wells repo owner

    If you're using a Package.xml subscription you need to add the new field to your hand-crafted package.xml file and then click the Refresh button in the retrieve dialog. Alternatively when you retrieve you can change Contents to Custom and uncheck Subscribed Only, then click Refresh and it'll show up in the list for retrieval. Either way you have to give IC some notion of your intention to include it in the retrieval selection. Let me know if that doesn't make sense.

  8. Ivan Shcheklein reporter

    Yes, it makes sense. It's a little bit complicated though. I expected for it to have a single action to retrieve new objects. But anyway, I understand that not retrieving the package.xml is not a bug. Thank you for your help.

  9. Scott Wells repo owner

    Issue tracker grooming. If this is still an issue, please feel free to reopen, ideally with a concrete reproduction scenario.

  10. Log in to comment