Skip to main content
Comparing managed package metadata with Gearset

How to compare and deploy changes to your managed packages

Mateusz Kochanowicz avatar
Written by Mateusz Kochanowicz
Updated over a week ago

Gearset fully supports comparison and deployments of changes to managed package metadata in your Salesforce orgs and version control environments.

In the Compare and deploy - managed package versions are shown in the metadata filter.

There's also an option to explicitly include or exclude managed package components in a comparison when the versions are different.

Including managed package metadata in your comparisons

There are some pre-defined metadata filters in our app that by default do not include managed packages. These are (numbers in brackets indicate number of metadata types used by each filter):
- Basic comparison (6)
- Default comparison (63)
- Default CI comparison (8)
- Default Experience Cloud Comparison (16)


An example of how a Default comparison filter's setup looks in our app:

To retrieve managed package metadata in your comparison results when using our pre-defined filters, select one of these two filters:
- Default profiles and permission sets comparison (16), or
- Compare all (213)

An example of Compare all filter's default setup in our app:

Alternatively, you can always create your own custom filter which includes either all or only specific managed packages.

Or you can add managed packages to any of the pre-defined filters that don't include managed packages by default.

Using the 'Compare all' filter

When you select the arrow sign under COMPARISON FILTERS > MANAGE CUSTOM FILTERS on your Compare and deploy page:


The Compare all filter will include all namespaces and all metadata types (which includes the Installed package metadata type, as discussed later in this article).

How does it work in the updated version of Compare and deploy?

To use this filter, on the Compare and deploy page click on COMPARISON FILTERS menu, then select Compare all filter.



Next, you can select Compare now - this button will be highlighted in blue if you've already selected the source and target environments that you want to compare.

Tip: If you have large orgs or many managed packages, then using the Compare all filter can make the comparison process slower, as Gearset needs to retrieve a larger volume of metadata. For a faster comparison, follow option 2 below.

Viewing managed packages before running the comparison

Before you run your comparison, and after selecting source and target environments for comparison, you can navigate to MANAGE CUSTOM FILTERS.

Here you can preview all the managed packages available in both of the compared environments.

Selecting either All or Choose allows you to decide whether you want to retrieve all of the packages, or only the ones you tick on the list.

Display of managed packages items on the filter

Managed package items are not going to be shown under Named items until packages are included in the comparison.

Example on below video where Chat Box managed package is added to the filter, which immediately shows up this package's components in the Named items section.

Package version item handling

After you decide whether to include all or only specific managed packages, you can move to the dropdown menu under Package version item handling.

  • Show all items (default configuration - recommended)

This is a default setting for all new filters.

By selecting this option, Gearset will retrieve managed package metadata components regardless of their version in the source and target.

Note: Please, be aware that although Gearset will retrieve components across versions by default, these may fail to deploy if the versions are in conflict.

  • Hide items when different (recommended)

Although this isn't a default setting, it's still recommended to use as it may help with successful validations/deployments of managed package components.

This option hides managed package metadata components when the package version is different across the source and target.

Note: This setting also applies to any of the Second-Generation Managed Packages, so that Gearset's functionality remains aligned across 1st and 2nd generation packages.

  • Installed package dependent (not recommended)

This is not the recommended option as managed package results will be affected by the Installed package metadata type.

Why is this option available?

Mainly to allow backwards compatibility with pre-existing CI jobs created prior to the update of managed package retrieval in our app.

Important to note in relation to existing CI jobs:
This option will be automatically applied to pre-existing CI jobs that have managed packages included, and were created prior to 24 September 2024 (date of released update).

How to update managed packages (1GP) in Gearset

By "1GP" we're referring to First-Generation Managed Packages.

It's important to remember that Installed package metadata type needs to be included in your metadata filter if you want to:

  • Retrieve and deploy the managed package itself.

  • Upgrade 1st Generation managed packages in Gearset.

Note: Second-Generation Managed Packages will need to to be upgraded from within Salesforce, or via the Salesforce CLI.

Update managed package version in Compare and deploy

Update managed package version in Gearset Pipelines

If you've decided to update your managed package in the Dev org(s), and you're working with Gearset Pipelines, you would need to:

  • Commit the package version into a feature branch to propagate it through your Pipeline as a standalone upgrade.

Retrieve only customisable managed package items

Gearset's metadata filter gives you an choice to further narrow down the retrieval of managed package items to only to customisable items.

To do so, enable the toggle Show Only Customisable Package Items:

Enabling this option will prompt Gearset to only include in a comparison the unrestricted metadata types from a managed package and any customisations.

The full list of unrestricted types is available in the Salesforce documentation:
Components Available in Second-Generation Managed Packages


How is this useful?

If this option is enabled, all customisations made to a managed package will be shown in the comparison (along with any parent objects).

Non-customisable types (such as Apex) will not be included in the comparison. This functionality helps you to see only the managed package metadata that you can make changes to, therefore surfacing only the items that may have been amended in the compared environments.

This setting aims to help users by removing noise from the comparison results through the exclusion of non-customisable items.

Viewing managed package components in comparison results

Now that you've included the packages you want to compare in the metadata filter, click Compare now. In the comparison results, you'll see any associated changes for those packages.

These can be selected and deployed just like any other metadata component type. You can search for them by entering the namespace prefix into the filter box in the top right of the table. Sometimes you may need to add the entire prefix to find your package's components.

For example, on below image we're searching for Chat Box installed package components with "chatbx__" namespace prefix.

It's a new package in the source org, and we're intending to deploy it to the target.

The Installed package file itself will also appear as an item in the comparison results. Selecting and deploying the package files will trigger the package to be installed in the target environment (if the package is new in the source), or it will update the package to the later version if there is a version difference between the source and target environments.

Examples

Below image shows how you can effectively use the "Search" option on the left hand side to look up Installed package metadata type - once clicked on, the comparison results shows only the installed packages that are new in the source environment (it's because here we're viewing only the New items window).

If you can't find a customization you've made to a piece of metadata in a managed package, then you should filter the results for Installed package, and check if the package is installed in both orgs and is the same version.

View managed package versions in your metadata filter

After you've run your comparison in our app using Compare now option, you can select the cog icon:

This will allow you to preview the list of detected managed packages (namespaces) in your comparison results - as long as you select either or All or Choose under Include managed packages:

Selecting Choose allows you to customise your filter further and, for example, specify managed packages that you want to preview in your updated comparison results before you select Ok (or before selecting Update comparison in scenario when you're refreshing already run comparison).

Tip: If you need to change the Managed Package Version for an Apex Class, this page has some useful hints and tips:
Manage Version Settings for Apex

Making such change directly in Gearset isn't possible.

Managed package versions

You will notice that Gearset displays the manage package's name and its namespace (e.g. Salesforce Connected Apps and sf_com_apps).


In addition to that, we also show:

  • managed package versions, including when package versions are different or the same in the compared environments.

  • Whether or not a package is present in the environment
    If a package is not present in either source or target, you'd see info such as:

    Source: N/A or Target: N/A.

Note: If it happens that Gearset is unable to detect package version, it will simply show as "Unknown version" under the package's namespace.

'Additional namespaces' setting explained

This functionality allows you to set up a metadata filter that includes managed packages that are not present in your current comparison, but you know you want to include them in that filter for future use.

And when re-running an existing comparison, this option allows you to add to your filter namespaces of managed packages that you'd like to include in your comparison after you hit Update comparison button.



For example, on the above video we've included managed packages named jz_managed and mk_managed.

These packages will be retrieved in the comparison results as long as packages with such namespaces exists in either source or target environments that are being compared.

Note: You'd need to know the exact namespace of a package you want to add to the filter in order for the package to be retrieved.

Managed package metadata in version control

If you’re comparing metadata in source control (i.e. GitHub, Bitbucket etc), Gearset may not be able to identify when metadata is part of a managed package.

Therefore, sometimes it can happen that a given metadata may appear in the comparison results, even if the None option is selected for Include managed packages in your metadata filter.

Did this answer your question?