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

pantsbuild / pants / 25441711719

06 May 2026 02:31PM UTC coverage: 92.915%. Remained the same
25441711719

push

github

web-flow
use sha pin (with comment) format for generated actions (#23312)

Per the GitHub Action best practices we recently enabled at #23249, we
should pin each action to a SHA so that the reference is actually
immutable.

This will -- I hope -- knock out a large chunk of the 421 alerts we
currently get from zizmor. The next followup would then be upgrades and
harmonizing the generated and none-generated pins.

Notice: This idea was suggested by Claude while going over pinact output
and I was surprised to see that post processing the yaml wasn't too
gross.

92206 of 99237 relevant lines covered (92.91%)

4.04 hits per line

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

95.45
/src/python/pants/backend/codegen/thrift/apache/subsystem.py
1
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3
from __future__ import annotations
2✔
4

5
import os
2✔
6

7
from pants.engine.env_vars import EnvironmentVars
2✔
8
from pants.option.option_types import StrListOption, StrOption
2✔
9
from pants.option.subsystem import Subsystem
2✔
10
from pants.util.ordered_set import OrderedSet
2✔
11
from pants.util.strutil import softwrap
2✔
12

13

14
class ApacheThriftSubsystem(Subsystem):
2✔
15
    options_scope = "apache-thrift"
2✔
16
    help = "Apache Thrift IDL compiler (https://thrift.apache.org/)."
2✔
17

18
    expected_version = StrOption(
2✔
19
        default="0.15",
20
        help=softwrap(
21
            """
22
            The major/minor version of Apache Thrift that  you are using, such as `0.15`.
23

24
            Pants will only use Thrift binaries from `--thrift-search-paths` that have the
25
            expected version, and it will error if none are found.
26

27
            Do not include the patch version.
28
            """
29
        ),
30
    )
31

32
    class EnvironmentAware:
2✔
33
        _thrift_search_paths = StrListOption(
2✔
34
            default=["<PATH>"],
35
            help=softwrap(
36
                """
37
                A list of paths to search for Thrift.
38

39
                Specify absolute paths to directories with the `thrift` binary, e.g. `/usr/bin`.
40
                Earlier entries will be searched first.
41

42
                The special string `"<PATH>"` will expand to the contents of the PATH env var.
43
                """
44
            ),
45
        )
46

47
        def thrift_search_paths(self, env: EnvironmentVars) -> tuple[str, ...]:
2✔
48
            def iter_path_entries():
2✔
49
                for entry in self._thrift_search_paths:
2✔
50
                    if entry == "<PATH>":
2✔
51
                        path = env.get("PATH")
2✔
52
                        if path:
2✔
53
                            yield from path.split(os.pathsep)
2✔
54
                    else:
55
                        yield entry
×
56

57
            return tuple(OrderedSet(iter_path_entries()))
2✔
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