Skip to content

Can't push after Deleting source file for an Apex class with Deleted status #3274

@geoffswift

Description

@geoffswift

Summary

Steps To Reproduce

  1. Have an Apex class with a Deleted status
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
	<apiVersion>63.0</apiVersion>
	<status>Deleted</status>
</ApexClass>
  1. Push the code to your org
  2. Delete the source file
  3. Try to push to the org

Expected result

Push succeeds

Actual result

Component Failures [1]
┌───────────┬────────────────────────┬────────────────────────────────────────────────────────────┬─────────────┐
│ Type │ Name │ Problem │ Line:Column │
├───────────┼────────────────────────┼────────────────────────────────────────────────────────────┼─────────────┤
│ ApexClass │ destructiveChanges.xml │ No ApexClass named: Example found │ │
└───────────┴────────────────────────┴────────────────────────────────────────────────────────────┴─────────────┘

Additional information

Presumably it thinks it has to remove the class from the org, despite the fact it was never actually deployed.

System Information

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.85.7",
  "nodeVersion": "node-v22.12.0",
  "osVersion": "Darwin 24.4.0",
  "rootPath": "/Users/gswift@financialforce.com/src/cpm/node_modules/@salesforce/cli",
  "shell": "bash",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.2.27 (core)",
    "@oclif/plugin-commands 4.1.24 (core)",
    "@oclif/plugin-help 6.2.27 (core)",
    "@oclif/plugin-not-found 3.2.49 (core)",
    "@oclif/plugin-plugins 5.4.36 (core)",
    "@oclif/plugin-search 1.2.23 (core)",
    "@oclif/plugin-update 4.6.37 (core)",
    "@oclif/plugin-version 2.2.27 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.38 (core)",
    "@oclif/plugin-which 3.2.34 (core)",
    "@salesforce/analytics 1.4.39 (link) /Users/gswift@financialforce.com/src/cpm/node_modules/@salesforce/analytics",
    "@salesforce/cli 2.85.7 (core)",
    "apex 3.6.12 (core)",
    "api 1.3.3 (core)",
    "auth 3.6.111 (core)",
    "community 3.3.20 (link) /Users/gswift@financialforce.com/src/cpm/node_modules/@salesforce/plugin-community",
    "data 4.0.26 (core)",
    "deploy-retrieve 3.22.4 (core)",
    "info 3.4.53 (core)",
    "lightning-dev 2.10.3 (link) /Users/gswift@financialforce.com/src/cpm/node_modules/@salesforce/plugin-lightning-dev",
    "limits 3.3.51 (core)",
    "marketplace 1.3.8 (core)",
    "org 5.6.1 (core)",
    "packaging 2.9.5 (link) /Users/gswift@financialforce.com/src/portfolio-limits-reporter/node_modules/@salesforce/plugin-packaging",
    "schema 3.3.59 (core)",
    "settings 2.4.23 (core)",
    "sobject 1.4.54 (core)",
    "telemetry 3.6.38 (core)",
    "templates 56.3.44 (core)",
    "trust 3.7.81 (core)",
    "user 3.6.17 (core)",
    "@salesforce/sfdx-scanner 4.10.0 (user) published 58 days ago (Tue Feb 25 2025) (latest is 4.11.0)"
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue or pull request that identifies or fixes a buginvestigatingWe're actively investigating this issuevalidatedVersion information for this issue has been validatedwontfixWe won't work on this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions