Using Branch PreDeploy Fix

PreDeploy Fix proactively detects and resolves missing dependencies before deployment.

Overview

The PreDeploy Fix is a validation process that inspects your branch for potential issues before deployment, such as:

  • API version mismatches

  • Missing components

  • Broken references

  • Unmet dependencies

If issues are detected, they are listed with options for resolution. This process helps prevent deployment failures by:

  • Checking and updating component API versions

  • Retrieving missing metadata

  • Removing or updating references to problematic components

By addressing these aspects, your deployment becomes cleaner and less error-prone.

circle-info

Best Practices

  • Always run a PreDeploy Fix before Validate or Deploy to reduce the chance of failures.

  • For Missing Dependencies, use Retrieve when possible to ensure all dependencies are correctly included. Use Remove only when you’re sure the reference is obsolete or not needed.

  • Enter clear and descriptive commit messages. These will show in the Commits tab for future tracking.

  • Rerun PreDeploy Fix after resolving issues until the lists are empty.

  • Use filters (status, type, date range) in Activities to quickly track your PreDeploy Fix jobs.

  • Review logs whenever a job ends with Exception or Action Required to understand what needs fixing.

Run Branch PreDeploy Fix

1

Select Branch and Run PreDeploy Fix

  1. Click Code from the left sidebar menu.

  2. Select a branch from the list.

  3. Click the Three Vertical Dots ⋮ dropdown menu next to Deploy.

  4. Click PreDeploy fix.

2

Select Connection

  1. Click Select for the Salesforce org connection to run the PreDeploy Fix for.

  2. Click Run.

  3. After starting the PreDeploy Fix job, it will be displayed on the Activities tab.

PreDeploy Fix Results

1

View Results

  1. Click the Activities tab.

  2. Check that the Pre Deploy Fix Search job status is Completed.

  3. Click the Pre Deploy Fix Search job.

circle-info

To help find a PreDeploy Fix job, you can click the All Types dropdown filter menu and select Pre Deploy Fix Search. This will filter the jobs to show just PreDeploy Fix jobs.

2

API Version Errors

If the PreDeploy Fix detects any API version errors, they will appear in the API Version Errors table. This table shows each component with an API version error. To the right of each component are two API versions: the Component API version and the Organization API version. The Component API version is the one the component uses in the branch, and the Organization API version is the one it uses in the Salesforce org used as the connection for this PreDeploy Fix.

circle-info

See the Fixing API Version Errors section below to learn how to resolve these errors.

  1. Click the API version errors tab.

3

Missing Dependencies

If the PreDeploy Fix identifies any missing dependencies, they will be shown in the Missing Components table. This table displays each missing metadata dependency along with the component that references it. To fix missing components, you can choose from two options and apply them to each component as needed.

  • Retrieve: This option retrieves the missing component and commits it to the branch.

  • Remove: This option removes the reference to the missing component and should only be used if it is confirmed that deploying without the component in the branch is safe.

circle-info

See the Fixing Missing Dependencies section below to learn how to resolve these errors.

  1. Click the Missing dependencies tab.

circle-info

If the Missing dependencies tab isn't visible, it means there are no missing dependencies.

4

View Job Logs

You can view the PreDeploy Fix job logs to check for any job processing problems and to verify which Salesforce org the job was run with.

  1. Click See logs.

  2. View the job status and log.

5

Re-Run PreDeploy Fix

Once you've fixed all API version errors and resolved missing dependencies, rerun the PreDeploy Fix job to ensure no issues remain. The following screenshots show a PreDeploy Fix job that completed without finding any issues.

circle-info

Both the API version errors and the Missing componets tables display No Components.

Fixing API Version Errors

If the PreDeploy Fix found API version errors, you can fix them by updating to the correct version.

1

Update Versions

  1. Click Update Versions.

  2. Click Add for each component to update the API version.

  3. Click Update.

  4. Enter a Commit Message for the changes to the branch.

  5. Click Resolve.

  6. After starting the API Update job, it will be displayed on the Activities tab as a Pre Deploy Fix Update job.

2

View Results

  1. Click the Pre Deploy Fix Update job.

  2. View the job status and log.

Fixing Missing Dependencies

1

Retrieve Missing Components

The selected metadata will be retrieved into your branch and added as a commit.

circle-info

If you have alread Removed dependency components, don't select them to retrieve. If you are unsure, you can rerun the PreDeploy Fix job.

  1. Click Retrieve.

  2. Click Add for each dependency component to retrieve.

  3. Click Retrieve.

  4. Enter a Commit Message for the changes to the branch.

  5. Click the Connection dropdown menu.

  6. Select the Salesforce org to retrieve the dependent components from.

  7. Click Run.

  8. After starting the Retrieve Missing Dependencies job, it will be displayed on the Activities tab as a Pre Deploy Fix Update job.

2

Remove Missing Components

The references to those components are removed from your branch, preventing deployment errors.

circle-info

If you have alread Retrieved dependency components, don't select them to remove. If you are unsure, you can rerun the PreDeploy Fix job.

  1. Click Remove.

  2. Click Add for each dependency component to retrieve.

  3. Click Remove.

  4. Enter a Commit Message for the changes to the branch.

  5. Click Run.

  6. After starting the Remove Missing Dependencies job, it will be displayed on the Activities tab as a Pre Deploy Fix Remove job.

3

View Results

  1. Click the Pre Deploy Fix Retrieve job for retrieving components or Pre Deploy Fix Remove job for removing components.

  2. View the job status and log.

Last updated

Was this helpful?