devops-center-feedback icon indicating copy to clipboard operation
devops-center-feedback copied to clipboard

Unable to Pull deleted Apex Classes

Open vishnuyadavalli opened this issue 3 years ago • 12 comments

Describe the bug We deleted a bunch of Apex classes and Visualforce Pages. But only a few of them are showing up when we pull changes in work item.

To Reproduce Steps to reproduce the behavior:

  1. Deleted existing Apex classes
  2. Click Pull Changes button in Work Item

Expected behavior Only a few classes are showing up.

Screenshots image

image

Additional context Add any other context about the problem here.

vishnuyadavalli avatar Aug 10 '22 16:08 vishnuyadavalli

Hello @vishnuyadavalli thanks for reporting this issue, I will start investigating it. Can you send me the orgId of the environment where you have DevOps Center package installed? And just to rule it out it, have you checked the ignored files?

EstebanRomero84 avatar Aug 10 '22 17:08 EstebanRomero84

Hi @EstebanRomero84 ,

Yes I checked Ignored files. They are not in ignored files. As you can see, only 1 apex class is pulled. But the rest of the classes are not pulled.

Org Id - 00DE0000000YgOr

vishnuyadavalli avatar Aug 10 '22 17:08 vishnuyadavalli

Could you run the following query in the dev environment where you deleted the components? SELECT Id, MemberName, MemberType, IsNameObsolete, IsNewMember, RevisionCounter, LastModifiedDate FROM SourceMember ORDER BY RevisionCounter DESC You will need to select Use Tooling API

EstebanRomero84 avatar Aug 10 '22 19:08 EstebanRomero84

@EstebanRomero84 ,

Can find the deleted apex classes with the query. image

vishnuyadavalli avatar Aug 10 '22 19:08 vishnuyadavalli

Thank you @vishnuyadavalli this is very helpful. Another question, how did you delete those classes? From setup, from dev console, sfdx, destructive deployment, or other way?

EstebanRomero84 avatar Aug 10 '22 20:08 EstebanRomero84

@EstebanRomero84 some from Dev Console, some form Setup ->Apex classes.

vishnuyadavalli avatar Aug 10 '22 20:08 vishnuyadavalli

@vishnuyadavalli the org where you deleted the classes is a sandbox or a scratch org? And if the answer is sandbox, which type and when source tracking was enabled on it?

Thanks

EstebanRomero84 avatar Aug 11 '22 14:08 EstebanRomero84

@EstebanRomero84 Yes. It is a sandbox and created after source tracking is enabled.

vishnuyadavalli avatar Aug 11 '22 17:08 vishnuyadavalli

@vishnuyadavalli the issue here seems to be related to the Source Member object, which DevOps Center uses to track changes. For some reason Source Member records were not created when you deleted those classes. We contacted internally the team that owns this functionality and they aware of this issue. You can track it here.

EstebanRomero84 avatar Aug 16 '22 13:08 EstebanRomero84

@EstebanRomero84 . Thanks you.

vishnuyadavalli avatar Aug 16 '22 14:08 vishnuyadavalli

I have also experienced this same issue. Deleted source that fails to create a source member record.

sdavis-AWP avatar Jul 20 '23 13:07 sdavis-AWP

Is there an update or Known Issue for it?

I rarely work with Sandboxes and when this was reported to me I was surprised.

From what I can see, this is how Source Tracking works in Sandboxes:

  • Refresh or create a Sandbox
  • The SourceMember Tooling API object does not have any records (check with: sf data query -t -q "SELECT MemberType, MemberName, IsNameObsolete FROM SourceMember")
  • Create new Metadata or update existing Metadata -> a SourceMember record get's created automatically ✅
  • Delete existing Metadata: -> no SourceMember record get's created automatically ❌

amtrack avatar Jun 10 '24 12:06 amtrack