Custom classes from installed managed packages missing from OST

Issue #941 new
Scott Wells repo owner created an issue

This was reported by a user recently. I'm going this use this issue both to track progress on the issue and as a delivery vehicle for test builds to help diagnose the root cause.

Comments (16)

  1. Scott Wells reporter

    This is a test build with additional logging around custom classes in OST generation. You can install the build by downloading it and using Settings>Plugins>Install plugin from disk. After doing so, please make sure that the following is included in Help>Debug Log Settings:

    #com.illuminatedcloud.symtab.OfflineSymbolTable
    

    and then generate your OST. With that done, please send me all idea.log* files from the time period of OST generation. Hopefully it will show me what's going on.

  2. Eric Kintzer

    Scott -- I may be victim of same issue and before I try the zip w/ debug I want to make sure that my use case matches your diagnostic tool

    1. Existing project with OST generated. Happy user (me)
    2. Install managed package into org for #1
    3. Add code line that references managed package class Select in code Foo__c[] = Select.someMethod(..). IC 2.0.1.3 highlights the expression to the right of the equals sign in red "cannot resolve symbol"
    4. Regenerate OST, restart IDEA

    RESULT: symbol Select still in red; expression to right of = still in red.

  3. Scott Wells reporter

    You don't need to install the attached build. The most recent official build includes the fix. Can you navigate into the parent class of the missing method and see if it's in the OST? If so, do you see the method in that class? If not, you're likely hitting a Salesforce bug that I discussed with them today. If it is there, though, it's an IC bug. Let's figure out which and then I can provide some additional feedback on next steps.

  4. Eric Kintzer

    Scott -- the expression Select.Field.hasChanged(...) - referencing managed package 'Selector', class Select, subclass Field - there's no way to navigate to this class - ⌘B yields "Cannot find declaration to go to" - that is, the whole class is not available to IC - I don't see the managed package's namespace in the Libraries folder.

    Is there some procedure to add newly-added Managed Packages to the Libraries folder?

    When I go to IC | Configure Module | Installed Package - the newly-installed package is not present/enumerated

  5. Scott Wells reporter

    Hey, Eric. So sorry for the delayed response. Between TrailheaDX and a late flight home, I'm only now getting my gray matter going again.

    So let me make sure I understand properly...you've installed a managed package into your org that include global Apex classes/methods, and after installation of that package, you fully regenerated your OST and allowed the project to close/reopen, correct? And now there are global classes/methods that you'd expect to have in your OST, but not only are you not seeing those classes/methods, you're not even seeing the package namespace? Is that correct?

    And it sounds like you also don't see the package when you look at the org's available metadata in the subscription editor? Have you clicked the Refresh button to force IC to re-enumerate the org's metadata?

    If the answer to all of that is "yes", what permissions did you choose when you installed the package? It is possible that the credentials you're using from IC don't have access to the package and/or its contents?

  6. Eric Kintzer

    Hi Scott -- sorry for delay -- weekend intervened

    1) RMB on project - Illuminated Cloud | Refresh Metadata

    2) Libraries folder does not contain the new Managed package

    3) IC - Configure Module | InstalledPackage does not contain the managed package

    3.1) Regenerate (full) OST

    3.2) Reload project

    RESULT: Symbol for class in managed package not recognized

    4) Permission used to install package - "For admins only"

    5) IC permissions are same as used to install package (i.e. my username/pw)

    Package name is Selector and namespace = Select

    For example expression

    Case[] casesWithPhoneChange = Select.Field.hasChanged(Case.Phone__c)
                    .andx(Select.Field.notNull(Case.Phone__c))
                    .filter(Records,existingRecords);
    

    has the Select.Field.hasChanged in red as well as the methods .andX, Select.Field.notNull, and filter (all in red)

    Managed package link here

    I'm wondering if the namespace = Select might be the issue as that conflates with SOQL keyword Select

    That said, the absence of seeing the package in the libraries folder would tend to contradict that hypothesis.

  7. Scott Wells reporter

    Thanks, Eric. I think the next best step for me is to install that package and reproduce as much of this as I can. Thanks for providing the link! You're likely correct that Select is contributing to the issue, and installing the package should make that obvious one way or the other.

    A few other things, though...Refresh Metadata will only get the latest version of metadata you already have. Please read Metadata retrieval and reconciliation here to understand the difference in behavior between the Retrieve, Retrieve for Merge, and Refresh operations. The libraries folder is driven completely off of OST generation and not off of metadata retrieval/refresh, so step 2 in your description should have occurred after step 3.1. I am a little curious about step 3, though, as I'd expect that to be listed under the InstallPackage metadata type.

    Let me install the package and try to reproduce this stuff. I won't get to do that until this evening, but I'll let you know what I find ASAP. Thanks again!

  8. Eric Kintzer

    OK, I read the above link on Metadata Retrieval

    1. I did Retrieve Metadata for Project - Server only, clicked the "refresh' mini-icon and the Select managed package appears in Metadata Object InstalledPackages as per expectations. However, the box is uncheckable and frankly, I don't see why I would need to select it anyway as per your doc, the OST will be built using all Apex classes, including those in managed packages
    2. Then regenerate OST/reload project and Select does not appear in the libraries folder

    I'm certainly willing to entertain this is user error as I'm not completely sure of the steps I should be taking to recognize the managed package added to the org after the project was created. I know I had to take no special action to have the existing-came-with-org managed packages included in the libraries folder or recognized as valid symbols in the OST.

    1. I tried creating a new IC project from a diff org that contained the Select managed package
    2. Generated OST
    3. Restart IDEA

    In this use case, the Select symbols are recognized so my hypothesis about reserved word name clash is probably bogus

  9. Scott Wells reporter

    Good timing. I'm actually starting to take a look now in the background. I just installed the package and will shortly work through the issues that you're seeing.

    Regarding seeing the package in the subscription editor, that was just to see if it was being included in the metadata enumeration API responses. You're correct that you do not need to retrieve that. If you did, you'd just get a *.installedPackage XML file that could be used to automate the installment of the package as part of metadata deployment (which is admittedly handy).

    Hopefully in just a few I'll either reproduce what you're seeing (which would be ideal) or I won't in which case I'll need to get you to gather some detailed logs from OST generation so I can see why that namespace isn't being included when you generate your OST. More info coming very soon...

  10. Scott Wells reporter

    Okay, I just went through this and it works fine here. The OST generation properly included the Select namespace, and in IC I'm able to write the same statement you included a few above with no syntax errors (though the syntax highlighting for Select is incorrect...it looks like a keyword instead of an identifier).

    Just so I understand, you're saying that when you do this against a new org, things are working properly, but when you do it against the original org, the Select namespace is not included in the OST therefore leading to what look like syntax errors in the editor. Is that a correct assessment? If so, I'll probably need you to generate your OST against the problem org with debug logging enabled for OST generation so that I can see what's going on with that namespace.

  11. Eric Kintzer

    relevant project is BUS311 - Michelle PB (I have many projects open at same time)

    OST gen finds classes for managed packages: (2018-04-04 1254h)

    • Apttus
    • Apttus_XApps
    • NVMContactWorld
    • et4ae5

    but not "Select"

  12. Scott Wells reporter

    Thanks, Eric. I won't get a chance to look at it for a few hours but will let you know what I find for sure.

  13. Log in to comment