The activation engine — determines which groups and steps should run.
Combines branch policies, scope-based change detection, commit message
targeting, dependency propagation, and only branch filtering into
a single resolution pipeline.
Algorithm
The activation engine runs through these phases in order:
Branch policy — match the current branch against
Pipette.Branchpatterns.scopes: :allactivates everything; a scope list restricts to named scopes;nilfalls through to file detection.Targeting — if not disabled, check for
[ci:group]in the commit message or theCI_TARGETenv var. When found, activate only targeted groups (plus their transitive dependencies viaPipette.Graph).Scope matching — test each scope's file patterns against the changed files. Fire matching scopes. If any fired scope has
activates: :all, activate all groups. Otherwise activate groups bound to fired scopes.Force activation — add groups specified by
force_activateenv vars (e.g.FORCE_DEPLOY=true).Dependency propagation — pull in transitive dependencies of active groups. Scopeless groups (no
:scopefield) are activated when any of theirdepends_ongroups are active.onlyfilter — remove groups whose:onlybranch pattern doesn't match the current branch. Force-activated groups bypass this filter.Step
onlyfilter — within each remaining group, remove steps whose:onlybranch pattern doesn't match the current branch. Groups left with no steps are dropped entirely.Step filter — if targeting specified individual steps (e.g.
[ci:api/test]), keep only those steps and their intra-group dependencies.
Example
result = Pipette.Activation.resolve(pipeline, ctx, changed_files, force_groups)
result.groups #=> [%Pipette.Group{name: :api, ...}]
Summary
Functions
Resolve which groups and steps should be active for this build.
Types
@type result() :: %{groups: [Pipette.Group.t()]}
Functions
@spec resolve( Pipette.Pipeline.t(), Pipette.Context.t(), [String.t()] | :all, MapSet.t(atom()) | :all ) :: result()
Resolve which groups and steps should be active for this build.
Takes the full pipeline definition, the runtime context, the list of changed
files (or :all to activate everything), and a set of force-activated group
names (or :all).
Returns a map with a :groups key containing the list of active
Pipette.Group structs, with steps filtered if step-level targeting is active.
Examples
result = Pipette.Activation.resolve(pipeline, ctx, ["apps/api/lib/user.ex"])
result.groups #=> [%Pipette.Group{name: :api, ...}]
result = Pipette.Activation.resolve(pipeline, ctx, :all)
result.groups #=> all groups in the pipeline