Skip to main content

Is the metadata included in the metadata filter?

Troubleshooting your CI job metadata filters a component is not deployed through CI jobs/pipelines

Chris Mead avatar
Written by Chris Mead
Updated yesterday


​What's the impact on the CI job?

If components you're trying to deploy through your CI job/pipelines are not included in your metadata filter, your CI job will not deploy them.

Commonly, this is because the metadata filter defined in the CI job settings is either:

  • excluding the metadata type in question (so the metadata you're trying to deploy),

  • the filter is excluding metadata object(s) that other metadata object(s) depend on

  • the item you want to deploy belongs to a managed package, and your CI job's filter doesn't have Include managed packages option selected - in which case check this article for more guidance on how to amend your filter: Comparing managed package metadata with Gearset

How to view your metadata filter

On your CI dashboard page, navigate to CI job Edit settings and select Metadata filters tab to see if the named metadata item is included in the metadata filter.


Check below article for more details on metadata filters and how they work:
​Custom metadata filters in Compare and deploy and CI jobs
​

If the filter is missing something you want to deploy (e.g. a specific metadata type isn't added to your filter), you can add the metadata type to the existing filter, save the filter, save your CI job, and once this is done you'd need to re-run the CI job.
Check guidelines on updating filters in automation jobs.

This should deploy to the org the metadata item that falls under the metadata type newly added to your CI job's filter.

For example, below image shows Custom object metadata added to the CI job filter with all its ten sub-components.

How can I view the metadata filter if I'm not the CI job owner?

A Gearset user who is not the owner of a CI jobs can still preview CI job settings in our app.

For user-owned Pipelines OR standalone CI jobs (jobs not used in Pipelines)

This is only possible if a user has Deployment level access for the target org of the CI job. The CI job owner can assign such access in Orgs Permissions page in our app (more guidance on assigning permission in this article).


Users with Deployment level access to the target org of a CI job will be able to click on View settings button to preview all the configuration for a given job.

For CI jobs used in team-shared / team-owned Pipelines

On the Pipelines & CI jobs page, a Gearset user with a Member status would need the following access to be able to view CI job settings:

  • Be added to the list of Pipeline users with either View or Edit access.

  • Have either Run or Edit "CI permission" for a team-shared CI job.

    Note: If a Member has a None permission assigned for a team-owned Pipeline, it means this Member is unable to view settings for any of the CI jobs that belong to the Pipeline.

Advanced example on how amending the filter solves a CI issue

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.

In SFDX source format repository - is an Apex class / Custom object / Lightning component not showing up in the comparison of your CI job?

Do you have the corresponding .cls-meta.xml for each .cls file?
Do you have the corresponding .cmp-meta.xml for each .cmp file?

Do you have the corresponding .object-meta.xml for each object in the object directory?

Do you have a .forceignore file that is set to exclude that source file/directory?
That could be the reason Gearset isn't picking up the component.

If we can't retrieve the metadata in your CI job's comparison, it will not be deployed to the target org even if you've successfully merged the PR in your (long-lived) environment branch (if you're using Pipelines workflow for deployments).

We also have a separate documentation covering common problems with viewing metadata in source control, which you may find useful when troubleshooting your CI jobs - particularly in scenarios when the source environment of your CI job is a Git branch.

Did this answer your question?