Skip to content

2022 10 24 API version parameter

Sebastien edited this page Oct 24, 2022 · 1 revision

API version parameter

  • Status: accepted
  • Date: 2022-10-24

Technical Story: #362

Context and Problem Statement

{Describe the context and problem statement, e.g., in free form using two to three sentences. You may want to articulate the problem in form of a question.}

The application should be able to deduce the API version to used based on the sfdx-project.json file as well.

Decision Drivers

  • CLI Experience
  • Compatibility with existing behaviour>

Considered Options

  • Use parameter or use sfdx-project.json or use latest (in that order)
  • Use a new parameter to search in sfdx-project.json
  • Use a keyword in -a parameter to tell the system to look in sfdx-project.json

Decision Outcome

Chosen option: "Use parameter or use sfdx-project.json or use latest (in that order)", because it has maximum compatibility with existing behavior and does not require huge changes in CLI usage.

Positive Consequences

  • Now when -a not set we use the same API value as the one from sfdx-project.json. Incremental package generation is done with the same API version used for deployment

Negative Consequences

  • It may use sfdx-project.json instead of latest when you don't specify -a. You may be used to have latest version used in this case.

Pros and Cons of the Options

Use parameter or use sfdx-project.json or use latest (in that order)

If the parameter is set then use parameter Else try to extract sourceApiVersion from sfdx-project.json Then if the API version is not defined or not supported, use the latest.

  • Good, Same CLI experience as before
  • Good, Use what it can find, in order
  • Bad, May be relaying on latest with an old version in sfdx-project.json

Use a new parameter to search in sfdx-project.json

If the new parameter is filled then use it. Or latest if version not supported

  • Good, new parameter, does not touch previous parameter
  • Bad, 2 parameters for the same aspect

Use a keyword in -a parameter to tell the system to look in sfdx-project.json

Use -a with a keyword (file) to drive the cli to search in sfdx-project.json for the API version Or latest if version not supported

  • Good, reuse the -a
  • Good, does not behave differently when not setting -a
  • Bad, create a convention in the version parameter