The otava regressions command supports an optional --branch argument, which specifies the feature branch to compare against the base branch.
Problem
The current implementation has several limitations:
- The feature-branch logic is implemented at the importer level, which forces every importer to either implement it or explicitly raise
NotImplementedError (as is currently the case).
- The Graphite importer relies on custom interpolation logic for the
$BRANCH environment variable.
- There is no way to configure the base branch name.
These limitations lead to several undesirable consequences:
- To configure a custom base branch, we we must manually expand the
$BRANCH environment variable (via expandvars). PostgreSQL example and e2e test illustrate this problem.
- Feature-branch testing is not supported by importers other than Graphite.
- Importer behavior is inconsistent and difficult to reason about.
Proposed Solution
CLI API Changes
Replace the existing --branch argument with two explicit arguments:
Usage semantics:
- If only
--base-branch is provided, it overrides the default base branch and tests for regressions within that branch.
- If both
--base-branch and --feature-branch are provided, Otava tests the feature branch for regressions relative to the base branch.
- If only
--feature-branch is provided, Otava compares the feature branch against the default base branch (main).
Configuration Interpretation Changes
regressions command
Otava expands the $BRANCH variable using both the base and feature branch values.
analysis command
Otava expands $BRANCH using the value provided via --branch, following the same mechanism as other ConfigArgParse-controlled options.
The
otava regressionscommand supports an optional--branchargument, which specifies the feature branch to compare against the base branch.Problem
The current implementation has several limitations:
NotImplementedError(as is currently the case).$BRANCHenvironment variable.These limitations lead to several undesirable consequences:
$BRANCHenvironment variable (viaexpandvars). PostgreSQL example and e2e test illustrate this problem.Proposed Solution
CLI API Changes
Replace the existing
--branchargument with two explicit arguments:--base-branchSpecifies the base branch to compare against.
Default:
main--feature-branchSpecifies the feature branch to compare.
No default.
Usage semantics:
--base-branchis provided, it overrides the default base branch and tests for regressions within that branch.--base-branchand--feature-branchare provided, Otava tests the feature branch for regressions relative to the base branch.--feature-branchis provided, Otava compares the feature branch against the default base branch (main).Configuration Interpretation Changes
regressionscommandOtava expands the
$BRANCHvariable using both the base and feature branch values.analysiscommandOtava expands
$BRANCHusing the value provided via--branch, following the same mechanism as otherConfigArgParse-controlled options.