Skip to main content

Adding previously missing metadata types into Gearset Pipelines

The process to follow when needing to adjust the metadata filter of your Pipelines' Continuous Integration (CI) jobs

Written by George Marino

Problem

When first configuring each of the continuous integration (CI) jobs that make up your Gearset Pipeline, you need to set a metadata filter. This should match the metadata filter that was used to seed your Git repository, but it also dictates which metadata types each CI job will consider for each run.

However, since the initial configuration of your filter, you may come to realize that your filter is missing certain metadata types, which now need to be considered by each job. These missing metadata types also need to be added to your repository(The main branch and all subsequent environment branches).

This document walks you through the process to rectify this.

Important note: This process rebases your repository from Production, so your environments should be in sync, just as they were when you first set up your Pipeline. If your central orgs are out of sync with Production, refresh them. If that's not possible, use Compare & Deploy instead: run a comparison with Production as the source and each org as the target, then deploy the differences to bring them in line before you begin.

Solution

When you're ready, follow these steps:

  1. Configure and save a new metadata filter

    1. Navigate to Compare & Deploy, select the drop down box under Comparison Filter. Scroll to the bottom and select Manage custom filters.

    2. If not already selected, from the dropdown box in the top left, select your previously saved filter currently being used by all CI jobs in your Pipeline.

    3. Update your filter to include the types previously missing, that you'd like to add. When in doubt, follow the advice in our documentation.

    4. Make sure you select Save your changes as a new filter, then Save Filter.

  2. Ensure your CI jobs won't attempt to deploy anything during this process

    1. Navigate to the CI Jobs Dashboard page.

    2. Click on one of your CI jobs, expand it with the arrow on the right hand side and select Edit settings.

    3. Navigate to Metadata Filters tab on the left side.

    4. Deselect all metadata types, so zero types are included. Save the filter using the Update the filter option. This will then automatically update the filter of all CI jobs in your Pipeline.

    5. Then Save CI job.

  3. Repopulate Main from Production, using the new filter

    1. Navigate to Compare & Deploy, using your newly created metadata filter from step 1, run a comparison between Production (as the source) and a newly created feature branch (at the target). Be sure to create that feature branch from your Main/Master branch.

    2. Select all the New and Changed components, bringing them into the package.

    3. Proceed to the next page. You may see a number of Problem Analyzers triggering for various reasons. Pay attention to these suggestions, but for the most part you can deselect/ignore them. We're looking to seed your repository with all the metadata, bringing it in sync with your org.

    4. Commit all these components into your feature branch.

    5. At the end of the commit, create a pull request against Main/Master branch.

    6. Now you have a PR within your Pipeline, which you can review and promote.

    7. This creates back-propagation PRs. Don't merge/promote these yet, complete step 4 first. (After the following steps, these PR's should automatically close, but if they don't, they can be manually closed)

  4. Re-sync each environment in your pipeline

    1. (Note: if you have "Automatically create Sync PRs after a promotion to the final environment" enabled, you can skip this step) Navigate to your final Pipeline environment on the Deployment pipelines page. Click the sync icon (hover text: "Create sync PRs from main to all your upstream environments") and select Create X pull requests.

    2. A pull request will be opened between Main and each central environment in your pipeline, merge each of these. The promotion of these PRs will sync all these newly added metadata components from your Main branch into your environment branches. This in turn will trigger a run of the CI jobs, however, due to step 1, this won't actually deploy anything.

  5. Re-enable your CI jobs so they can deploy again

    1. Navigate to the CI Jobs Dashboard page.

    2. Click on one of your CI jobs, expand it with the arrow on the right hand side and select Edit settings.

    3. Navigate to Metadata Filters tab on the left side.

    4. Select your newly created filter from step 1. Then Save CI job.

    5. Repeat these steps for all CI jobs in your Pipeline.

Post configuration considerations

I still have in-flight work open in a PR against the environments. What do I do about these?

Your pre-existing feature branches and their open PR's will still exist, you'll see them still within your Pipeline. However, Existing feature branches and PRs won't include the newly added metadata types. If their components depend on that metadata, they may fail to deploy reliably. We recommend deleting open feature branches and starting fresh.

What if I also have Vlocity data in my filter?

Vlocity is data rather than metadata, and is handled slightly differently. Our advice changes slightly to ensure everything goes smoothly following the above-mentioned process. As part of Step 2, rather than including absolutely nothing in the filter, we'd recommend including just one negligible Vlocity type in the filter. This should be a type that you do not currently use and do not plan on using in the future.

Did this answer your question?