Dynamic baseline branch

about 17 hours ago

Historically, RelativeCI computed bundle comparisons, relative metrics, and relative rule evaluations against the latest job on the project's base branch. For branches created from non-default branches, code could diverge and produce out‑of‑sync comparisons.

Starting with @relative-ci/agent@v5.1.0 and relative-ci/agent-action@v3.1.0, the agent detects the pull request’s target (base) branch and uses the latest job on that branch as the baseline. If base-branch data is missing, the service falls back to the latest job on the RelativeCI project’s base branch.

Dynamic baseline branch flow
Dynamic baseline branch flow

Most CI providers expose the pull request base branch via environment variables during pull_request builds. To provide a custom base branch, you can:

  • set the RELATIVE_CI_BASE_BRANCH environment variable, or
  • pass the --base-branch flag to the CLI.

Learn more about the agent build information

The information regarding the base branch is available on the job details section:

Job details dynamic baseline
Job details dynamic baseline

In case you want to inspect the build information collected by the agent, you can run the agent in debug mode:

Package updates

Read more

Follow us on Twitter, subscribe to our mailing list or subscribe to our feed to stay up to date with RelativeCI updates.