Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot deploy namespaced Apex classes in unlocked packages to org #5637

Closed
Banuson opened this issue Jun 12, 2024 · 13 comments
Closed

Cannot deploy namespaced Apex classes in unlocked packages to org #5637

Banuson opened this issue Jun 12, 2024 · 13 comments
Labels
area:namespaces status:owned by another team We are maintaining this feedback for visibility but it is not within control of our team type:bug validated

Comments

@Banuson
Copy link

Banuson commented Jun 12, 2024

Hello,

I want to update a class from an unlocked packaged installed in my org with namespace MyPackage.

I am able to retrieve it, but if I want to change anything (adding a comment for example) in that file I am not able to deploy.
I want to deploy using metadata API. The apex class file is : classes/MyPackage__myClass.cls with MyPackage namespace.
public class myClass {
// class content
}
But when I try to deploy I have this error message:
File name mismatch with class name: myClass

Another issue is that in Org Browser:
files shows with doubled namespace for example:
MyPackage__MyPackage__myClass.cls
Retrieve using the org browser throws this error:
Entity of type 'ApexClass' named 'MyPackage__MyPackage__myClass' cannot be found

Currently I can only edit the class from Dev Console or Setup>Apex Class.

Salesforce Extension Version in VS Code: v60.15.0
Salesforce CLI Version: @salesforce/cli/2.42.6 win32-x64 node-v20.12.2
OS and version: Microsoft Windows 11 Enterprise 10.0.22621 Build 22621
VS Code version: Version: 1.90.0
Most recent version of the extensions where this was working: N/A

@svc-idee-bot
Copy link
Collaborator

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@daphne-sfdc
Copy link
Contributor

Hi @Banuson, We're aware of the issue with the duplicate namespaces in the org browser, as it was previously filed here: #5598. There is a workaround to retrieve using the manifest instead.

Let me try to replicate your issue with editing and deploying the namespaced Apex class in the unlocked package. I'll let you know if I can replicate it.

@Banuson
Copy link
Author

Banuson commented Jun 13, 2024

Hi @daphne-sfdc,

Just checking in to see if you had a chance to look into the issue with editing and deploying the namespaced Apex Class in the unlocked package.
Thanks for your help!

@daphne-sfdc
Copy link
Contributor

Hi @Banuson, Sorry for the delay. My team was working to resolve an urgent issue yesterday so I haven't gotten the chance to check this yet. I'll get back to you with my findings later today.

@daphne-sfdc
Copy link
Contributor

@Banuson Looks like you're correct that this is a bug - I was able to reproduce this issue using a new unlocked package that I created and installed into an empty scratch org. What's particularly interesting is that I'm unable to deploy namespaced Apex classes using the CLI either - we'll investigate our shared libraries to see what's going on.

daphne.yang@daphney-ltmkef9 classes % sf project deploy start --source-dir GlobalClass0000.cls
Error (1): GlobalClass0000.cls: File or folder not found

daphne.yang@daphney-ltmkef9 classes % sf project deploy start --source-dir svcideebot__GlobalClass0000.cls
Error (1): force-app: File or folder not found

Thanks for filing this issue, and sorry for the inconvenience.

Copy link

git2gus bot commented Jun 13, 2024

This issue has been linked to a new work item: W-15999415

@Banuson
Copy link
Author

Banuson commented Jun 13, 2024

@daphne-sfdc Thanks for confirming the issue and looking into it. Could you please provide an estimated timeline for a fix?

@daphne-sfdc
Copy link
Contributor

Hi @Banuson, Our team is continuing to investigate what is going on with the namespaced deployments. We'll keep you in the loop with any updates that we have. Thank you for your patience.

@Banuson
Copy link
Author

Banuson commented Jun 28, 2024

Hello @daphne-sfdc,

Are there any updates regarding this issue?

Thank you!

@daphne-sfdc daphne-sfdc changed the title Namespaced Apex Class filename mismatch Cannot deploy namespaced Apex classes in unlocked packages to org Jun 28, 2024
@daphne-sfdc
Copy link
Contributor

Hi @Banuson, Our team is still actively investigating this issue. We'll update you when we find anything important regarding this use case. Thank you.

@daphne-sfdc
Copy link
Contributor

Hi @Banuson,

While investigating this issue, our team found that the error that you're seeing happens both when deploying using VSCode/CLI and Workbench. Because it happens in Workbench, which directly calls the metadata API during the deploy, our team has determined that this issue is on the server side, owned by the Metadata API Team.

The Metadata API Team only receives issues via the official Salesforce support channels. If you would like to connect with them directly on this issue, please file a ticket in Salesforce Help and an investigation will be routed to them.

As this issue is not owned by our team, we'll be closing this issue.

@daphne-sfdc daphne-sfdc added the status:owned by another team We are maintaining this feedback for visibility but it is not within control of our team label Jul 30, 2024
@svc-idee-bot
Copy link
Collaborator

We have determined that the issue you reported exists in code owned by another team that uses only the official support channels, and thus we are closing this issue. To ensure that your issue is addressed, open an official Salesforce customer support ticket with a link to this issue. We encourage anyone experiencing this issue to do the same to increase the priority.

@diyer
Copy link
Collaborator

diyer commented Aug 8, 2024

@Banuson this is the work item that support can use to file a case on for this issue W-16395605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:namespaces status:owned by another team We are maintaining this feedback for visibility but it is not within control of our team type:bug validated
Projects
None yet
Development

No branches or pull requests

4 participants