• 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.65
/src/python/pants/backend/codegen/thrift/tailor.py
1
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4
from __future__ import annotations
4✔
5

6
from dataclasses import dataclass
4✔
7

8
from pants.backend.codegen.thrift.subsystem import ThriftSubsystem
4✔
9
from pants.backend.codegen.thrift.target_types import ThriftSourcesGeneratorTarget
4✔
10
from pants.core.goals.tailor import (
4✔
11
    AllOwnedSources,
12
    PutativeTarget,
13
    PutativeTargets,
14
    PutativeTargetsRequest,
15
)
16
from pants.engine.intrinsics import path_globs_to_paths
4✔
17
from pants.engine.rules import collect_rules, rule
4✔
18
from pants.engine.unions import UnionRule
4✔
19
from pants.util.dirutil import group_by_dir
4✔
20
from pants.util.logging import LogLevel
4✔
21

22

23
@dataclass(frozen=True)
4✔
24
class PutativeThriftTargetsRequest(PutativeTargetsRequest):
4✔
25
    pass
4✔
26

27

28
@rule(level=LogLevel.DEBUG, desc="Determine candidate Thrift targets to create")
4✔
29
async def find_putative_thrift_targets(
4✔
30
    req: PutativeThriftTargetsRequest,
31
    all_owned_sources: AllOwnedSources,
32
    thrift_subsystem: ThriftSubsystem,
33
) -> PutativeTargets:
34
    if not thrift_subsystem.tailor:
1✔
35
        return PutativeTargets()
×
36

37
    all_thrift_files = await path_globs_to_paths(req.path_globs("*.thrift"))
1✔
38
    unowned_thrift_files = set(all_thrift_files.files) - set(all_owned_sources)
1✔
39
    pts = [
1✔
40
        PutativeTarget.for_target_type(
41
            ThriftSourcesGeneratorTarget,
42
            path=dirname,
43
            name=None,
44
            triggering_sources=sorted(filenames),
45
        )
46
        for dirname, filenames in group_by_dir(unowned_thrift_files).items()
47
    ]
48
    return PutativeTargets(pts)
1✔
49

50

51
def rules():
4✔
52
    return [
4✔
53
        *collect_rules(),
54
        UnionRule(PutativeTargetsRequest, PutativeThriftTargetsRequest),
55
    ]
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