• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 23177125175

17 Mar 2026 03:32AM UTC coverage: 52.677% (-40.3%) from 92.932%
23177125175

Pull #23177

github

web-flow
Merge 1824dfbf4 into 0b9fdfb0e
Pull Request #23177: Bump the gha-deps group across 1 directory with 4 updates

31687 of 60153 relevant lines covered (52.68%)

1.05 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.48
/src/python/pants/goal/auxiliary_goal.py
1
# Copyright 2024 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4

5
from abc import ABC, abstractmethod
2✔
6
from dataclasses import dataclass
2✔
7
from typing import ClassVar
2✔
8

9
from pants.base.exiter import ExitCode
2✔
10
from pants.base.specs import Specs
2✔
11
from pants.build_graph.build_configuration import BuildConfiguration
2✔
12
from pants.engine.goal import GoalSubsystem
2✔
13
from pants.engine.unions import UnionMembership
2✔
14
from pants.init.engine_initializer import GraphSession
2✔
15
from pants.option.options import Options
2✔
16
from pants.option.scope import ScopeInfo
2✔
17

18

19
@dataclass
2✔
20
class AuxiliaryGoalContext:
2✔
21
    """Context passed to a `AuxiliaryGoal.run` implementation."""
22

23
    build_config: BuildConfiguration
24
    graph_session: GraphSession
25
    options: Options
26
    specs: Specs
27
    union_membership: UnionMembership
28

29

30
class AuxiliaryGoal(ABC, GoalSubsystem):
2✔
31
    """Configure an "auxiliary" goal which allows rules to "take over" Pants client execution in
32
    lieu of executing an ordinary goal.
33

34
    Only a single auxiliary goal is executed per run, any remaining goals/arguments are passed
35
    unaltered to the auxiliary goal. Auxiliary goals have precedence over regular goals.
36

37
    When multiple auxiliary goals are presented, the first auxiliary goal will be used unless there is a
38
    auxiliary goal that begin with a hyphen (`-`), in which case the last such "option goal" will be
39
    prioritized. This is to support things like `./pants some-builtin-goal --help`.
40

41
    The intended use for this API is rule code which runs a server (for example, a BSP server)
42
    which provides an alternate interface to the Pants rule engine, or other kinds of goals
43
    which must run "outside" of the usual engine processing to function.
44
    """
45

46
    # Used by the arg splitter to optionally allow aliasing auxiliary goals.
47
    aliases: ClassVar[tuple[str, ...]] = ()
2✔
48

49
    @classmethod
2✔
50
    def create_scope_info(cls, **scope_info_kwargs) -> ScopeInfo:
2✔
51
        return super().create_scope_info(is_auxiliary=True, **scope_info_kwargs)
×
52

53
    @abstractmethod
2✔
54
    def run(
2✔
55
        self,
56
        context: AuxiliaryGoalContext,
57
    ) -> ExitCode:
58
        pass
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc