aboutsummaryrefslogtreecommitdiff
path: root/compute-status-counts.awk
blob: a7da4c046ae85d06121918f0d806111e0a1e77b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
## SPDX-License-Identifier: CC0-1.0
##
## Copyright (C) 2025 Woj. Kosior <koszko@koszko.org>

// {
    if (first_skipped) {
        what = "???.";
    }
    first_skipped = 1;
}

## Ones to skip.

/ST-experiment-limitation/ {
    what = 0;
}

/ST-not-a-real-package/ {
    what = 0;
}

## Ones to include for plotting.

/ST-failure,FR-failed-to-checkout,/ {
    what = "1,Failed to clone";
}

/ST-failure,FR-failed-to-checkout-revision-not-found/ {
    what = "2,Git revision not found";
}

/ST-failure,FR-failed-to-resolve/ {
    what = "3,Failed to resolve dependencies";
}

/ST-failure,FR-invalid-lockfile-supplied/ {
    what = "4,Invalid upstream lockfile";
}

/ST-failure,FR-no-(package.json|build-script)/ {
    what = "5,Conventions not followed";
}

/ST-failure,FR-expects-network/ {
    what = "6,Expects network access";
}

/ST-failure,FR-needs-other-build-sys/ {
    what = "7,Requires Yarn or pnpm";
}

/ST-failure,FR-has-deps-external-to-npm/ {
    what = "8,Has dependencies outside npm";
}

/ST-failure,FR-misc-build-failure/ {
    what = "9,Miscellaneous build failure";
}

/ST-built-once/ {
    what = "10,Built only with upstream lockfile";
}

/ST-built-with-lockfiles-removed/ {
    what = "11,Built with re-generated lockfile";
}

// {
    if (what) {
        counts[what]++;
    }

    if (what == "???.") {
        print "##### " $0 > "/dev/stderr";
    }
}

END {
    print "ID,CATEGORY,COUNT";

    for (key in counts) {
        print key "," counts[key];
    }
}