All Collections
FAQ
Continuous integration
Troubleshooting continuous integration (CI) jobs
Troubleshooting continuous integration (CI) jobs

Check the Metadata filter and problem analyzers

Valerio Chang avatar
Written by Valerio Chang
Updated over a week ago

Is your continuous integration (CI) job not deploying an item you expect it to?
Is your CI job showing changes that repeatedly do not get deployed to the target?

If so, we have some question to help you debug! This article will help you check to see at which stage the problem has occurred and what you can do.

Question 1 - Is the metadata included in the metadata filter?

Sometimes the real cause a CI job isn't deploying something, it is because that metadata isn't being retrieved in the comparison. The most common cause of that is the custom metadata filters are

  • excluding the metadata type in question, or

  • excluding metadata objects that other metadata objects depend on.

Check the job setting to see if the named metadata item is included in the metadata filter. See here for more details on metadata filters and how they work. If the filter is missing something you want to deploy, you can add it and re-run the CI job.

Advanced example

Here's an example error to illustrate this:

Asset_Automation_Alerts Flow myWaitEvent_myWait_myRule_3_event_2_SA1 (Action) - We can't find an action with the name and action type that you specified.

This is an unhelpful message saying that some action in your Flow references an object not found.

You go to the View Problem Analysis Fixes and select Items that depend on something that isn't on the target and discover that Gearset suggested that

Remove items that reference Asset (CustomObject), which is not available on the target
Asset.Nudge_Reminder_3
Asset.Nudge_Reminder_4

Those are your newly-added email alerts in your Flow. They were excluded because they reference Asset which had been excluded from the CI custom metadata filter.

Editing the custom metadata filter to include Custom Object Asset fixes the CI issue.

Question 2 - Has the problem analyzers stripped the metadata item out?

When you run a manual compare and deploy, after the items to deploy are selected and before the deployment package is created, the problem analyzers kick in. Problem analyzers are Gearset suggestions for your deployment package, to add or remove any components that help make your deployment more likely to succeed. You can choose to tick or untick any of these suggestions in order to modify your package.

In a CI job scenario, since it is an automated process, all the suggestions are automatically ticked (which may add or remove components to the package). It will then proceed with the deployment. This is the most common reason that items are not deployed in a CI job. 

If you would like to verify that problem analyzers are the reason that your item is not being deployed via the CI job, you can view the problem analysis results for the CI job run, as described below. (Alternatively, you can run a manual comparison with the same source and target, using the same metadata filter, and click through to see the problem analyzers being triggered.)

We have now added the option for you to change the problem analyzer setting and choose to not apply any problem analysis fixes.

View problem analysis fixes in CI job history  

To see what the problem analyzers are doing under the hood with your CI job, navigate to View history for the job in question from the Continuous integration dashboard. There, you will see a history of your CI job runs with the option to view problem analysis fixes. (The button will be gray if there are no fixes to display.) 

Here's where to find it:

Problem analyzers applied will be shown like this:

This view shows you which problem analyzers made changes to your job, and which items were affected.

Note: You won't be able to edit anything on this page - it's purely for informational purposes. If you want the CI job to accept the problem analyzers, you can use the feature of the Problem analyzer templates or choose "Don't apply any fixes" from the advance settings as shown above.

What can I do if I want something different?

If you want to deploy the changes to the target

The quickest way to do this is to use the manual deployment process to deploy the items that have not been deployed in the CI job, and untick the problem analyzer after reading the reason for it. Note that this may result in a deployment error/failure; after all, that is the purpose of the problem analyzer in the first place. You may need to address the Salesforce deployment errors in order to deploy successfully.

If you don't want to deploy the changes to the target

You can also choose to not deploy specific items into the target. To remove an item from being included in future job runs, you may edit the metadata filter in the CI job setting to exclude those components from showing up in the future.

Question 3 - Has the metadata item made it into the deployment package zip file?

Sometimes the metadata item did not make it into the deployment package. If it's not in the deployment package zip file, then it will not be deployed.

Please check if the deployment package zip contains the metadata you expect. Once you download the file, in your file explorer, unzip your zip package and open the metadata with your text editor.

If you have any questions about this process, please don't hesitate to ask us in the in-app chat!

Did this answer your question?