In Copado Essentials, depending on the situations, different API versions will be used when retrieving metadata from Salesforce. This article explains how API version is managed within Copado Essentials.
Deploy From Org to Org
When deploying metadata from Salesforce to Salesforce, Copado Essentials default latest API version is used. The default API is regularly updated to match the latest Salesforce release.
Commit metadata from Salesforce Org to GIT
Before retrieving metadata from the source Salesforce Org, Copado Essentials automatically detects the API version of the metadata currently stored in the GIT repository.
If the source is in DX format, Copado Essentials looks at the version number from the sfdx-project.json file in the repository
If the source is in MDAPI classic format, Copado Essentials looks at the version from the package.xml file in the repository
If the repository is empty, the Copado Essentials uses the latest default API version.
Once the API version number is determined, Copado Essentials will use this version number to retrieve the metadata from the source Salesforce org. This is to make sure that the new retrieved metadata is in the same version as the current code in your GIT repository.
Deploy metadata from GIT to Salesforce Org
When deploying metadata from Git to Salesforce org, Copado Essentials respects the API version defined in package.xml (classic format) or sfdx-project.json (DX-format). If you need to change the API version that Copado Essentials uses, simply update package.xml or sfdx-project.json and commit the changes to your Git repo. Copado Essentials will automatically pick up the updated API version accordingly.
Please note that if you ever update the API version in package.xml or sfdx-project.json, you should also update the content of your metadata files to align with the updated API version.