SFDX Module set to "All/Package" subscription fails to deploy new file in context mode

Issue #1844 resolved
Xander Victory created an issue

I deploy single files etc and in this project, it now doesn’t like deploying new files in context mode.

(not possible to tick the Apex class)

Changing to “Selected” does allow the deploy as it ticks the checkbox ion the deploy modal.

Additionally, I’ve noticed that deploying in Context mode doesn’t update the local-only status, needing to explicitly refresh the metadata.

Comments (9)

  1. Scott Wells repo owner

    I'll take a look at the issue deploying new files via context mode. That's certainly odd. For what it's worth, I discourage the use of All/Package for anything except for managed package development as there are numerous issues associated with it because it can pick up metadata that either doesn't retrieve properly or fails to even deploy back to the same org from which it was retrieved (both can result in GACKs). I've been strongly considering removing it as an option in an upcoming release.

    As for not updating the local-only status, right now no deployments or retrievals do that. They should...but right now they don't.

  2. Xander Victory reporter

    I don’t recall specifically setting it to All, so I’ll remember to swap off that when I notice projects with it. thanks

  3. Xander Victory reporter

    Oh, I see how it got that setting - it seems to be the default when creating a new sfdx project

  4. Scott Wells repo owner

    Hmmmm...can you explain the nature of this project a bit more. For an SFDX project I wouldn't ever expect the module config screen to look like that. Here's what it looks like (or at least should look like) for a scratch org module/project where it's assumed that the CLI will manage the "subscription" via source tracking:

    Issue_1844_No_Manifest.png

    and here's what it looks like (same qualifier applies) for a manifest-based source format module/project where manifest/package.xml is used to manage the subscription:

    Issue_1844_Manifest.png

    It sounds like perhaps your project is in some other state and IC2 isn't quite setting things up properly? It'd be good to know that state. In particular I'd like to know the following:

    1. What kind of connection is being used here? Could I see the connection properties (with anything sensitive redacted, of course)?
    2. How was the project created and what is its overall structure?
    3. Does it have a manifest/package.xml file? f not, does it have a package.xml file somewhere else?
    4. Where are the source roots and are they properly configured?

    Let's start there. I suspect that this project is outside of IC2's expectations--which is not to say that they're incorrect, of course--and that's why you're seeing this kind of odd behavior.

  5. Xander Victory reporter
    1. OAuth to Sandbox (or Dev ed)
    2. File->New Project->SFDX->Select OAuth connection
    3. No & no
    4. Just the defaults

    Screenshots from new project which lead to my last comment about defaults (since changed off All)

  6. Log in to comment