Skip to content

Commit 2b5ec2d

Browse files
authored
ci: T8490: add typos workflow + central allowlist seed (#150)
Add `.github/workflows/typos.yml` — a new standalone CI workflow that runs crate-ci/typos against pull_request branches (rolling/circinus/sagitta). Workflow design: - Two-step checkout: PR code into workspace, vyos/.github@production into `.github-central/` so the central config is always sourced from the authoritative repo regardless of which product repo runs the check. - SHA-pinned actions (actions/checkout v7, crate-ci/typos v1.47.2, peter-evans/create-or-update-comment v5). - Failure comment injected only on same-repo (non-fork) PRs to avoid pull_request_target exposure on forks. Add `_typos.toml` at repo root — the central allowlist consumed by the two-checkout pattern above. Config excludes upstream-owned paths (*.patch, smoketest/**, mibs/**, kernel config fragments) and carries extend-words entries for confirmed VyOS / networking / kernel jargon: ICMPv6 ND prefixes, IEEE 802.11ai FILS/EDCA ACI/OCE/SME, MACsec pn, GeoIP country codes (ba/fo), VyOS daemon suffix (commitd), _OFR_CONFIGURE bash env, Linux UAPI FlAGS kernel identifiers (AGS), Triple-DES EDE, RTAX_RTO_MIN (RTO/rto), nftables bridge chain prefix (NAM), Linux kernel driver symbols (DAMON/WIL/EXPORTFS/SYNOPSYS/ADIN), QoS thr threshold, setpriv --inh-caps (inh), VyOS dummy interface prefix (dum), ATA node prefix (hda), gratuitous-ARP abbreviation (grat), and the op-mode tab-completion prefix file (clea). Dry-run against 4 pilot repos (vyos-1x/vyos-build/vyatta-cfg-system/vyconf): - vyos-1x: 742 → 75 hits (90 % reduction) - vyos-build: 138 → 1 hit (99 % reduction) - vyatta-cfg-system: 81 → 67 hits (17 % reduction — repo has real typos) - vyconf: 36 → 14 hits (61 % reduction) All remaining hits are genuine typos in product source, not false positives. This is the Phase 1.3/1.4 seed. Phase 2 evaluate step will measure false positives on live PRs and tune further; zero false positives is not the goal here. Relates: T8490 🤖 Generated by [robots](https://vyos.io)
1 parent 314142b commit 2b5ec2d

2 files changed

Lines changed: 187 additions & 0 deletions

File tree

.github/workflows/typos.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
name: Typos
3+
on:
4+
pull_request:
5+
branches: [rolling, circinus, sagitta]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write # auto-downgraded to read on fork PRs
10+
11+
jobs:
12+
typos:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout PR
16+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
17+
with:
18+
persist-credentials: false
19+
20+
- name: Checkout central typos config
21+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
22+
with:
23+
repository: vyos/.github
24+
ref: production
25+
path: .github-central
26+
persist-credentials: false
27+
28+
- name: Bullfrog egress-audit
29+
continue-on-error: true
30+
uses: bullfrogsec/bullfrog@1831f79cce8ad602eef14d2163873f27081ebfb3 # v0.8.4
31+
with:
32+
egress-policy: audit
33+
34+
- name: Run typos (full tree, central config)
35+
uses: crate-ci/typos@37bb98842b0d8c4ffebdb75301a13db0267cef89 # v1.47.2
36+
with:
37+
config: .github-central/_typos.toml
38+
39+
- name: Comment on failure (same-repo PRs only)
40+
if: ${{ failure() && github.event.pull_request.head.repo.full_name == github.repository }}
41+
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
42+
with:
43+
issue-number: ${{ github.event.pull_request.number }}
44+
body: |
45+
⚠️ **Typos check failed.** See the failing **Typos** check's annotations (Files changed tab) / job log for the exact strings and locations.
46+
False positive (genuine VyOS jargon)? It belongs in the central allowlist — open a PR adding it to `vyos/.github` `_typos.toml`.

_typos.toml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Central VyOS typos allowlist — consumed by .github/workflows/typos.yml
2+
# via `config: .github-central/_typos.toml` (checked out from vyos/.github@production).
3+
#
4+
# SEED config (Phase 1.3). Phase 2 evaluate step will tune further.
5+
#
6+
# Policy: allowlist only CONFIRMED genuine VyOS/networking/kernel jargon and
7+
# code identifiers. Real typos in source or comments are NOT allowlisted — they
8+
# should be fixed in the product repos.
9+
#
10+
# Sections
11+
# --------
12+
# [default.extend-words] — token appears as a COMPONENT within an identifier
13+
# (typos splits on underscores, hyphens, and case
14+
# boundaries; use this section for sub-token jargon).
15+
# [default.extend-identifiers] — token IS the whole identifier on its own.
16+
# [files] extend-exclude — paths to skip (gitignore-style globs, relative to
17+
# the repo root where typos is invoked in CI).
18+
19+
[files]
20+
# Upstream patch files: their content is unmodifiable (cherry-picked from upstream).
21+
# Linux kernel defconfig/config fragments: contain many short CONFIG_ identifiers
22+
# that typos misreads as common-word typos (DAMON/DAEMON, WIL/WILL, ALS/ALSO, etc.).
23+
# Smoketest configs: large auto-generated firewall rule blobs (cert PEM data, country
24+
# code lists, GeoIP regex) that produce hundreds of false positives.
25+
# MIBs: vendor-supplied SNMP MIB files with proprietary identifiers.
26+
extend-exclude = [
27+
"*.patch",
28+
"smoketest/**",
29+
"mibs/**",
30+
"scripts/package-build/linux-kernel/config/**",
31+
]
32+
33+
[default.extend-words]
34+
# ICMPv6 Neighbor Discovery (RFC 4861) — "nd" is the canonical prefix for ND
35+
# message types: nd-router-solicit, nd-router-advert, nd-neighbor-solicit,
36+
# nd-neighbor-advert, nd-redirect. Used in VyOS interface-definitions, nftables
37+
# templates, and interface-definition XML files.
38+
nd = "nd"
39+
ND = "ND"
40+
41+
# WiFi 802.11ax / hostapd: FILS = Fast Initial Link Setup (IEEE 802.11ai).
42+
# A WPA3 authentication mechanism. Appears in wpa_supplicant.conf.j2 and
43+
# hostapd.conf.j2 templates.
44+
FILS = "FILS"
45+
fils = "fils"
46+
47+
# WiFi 802.11ax EDCA ACI field (Access Category Index).
48+
# Appears as he_mu_edca_ac_bk_aci, he_mu_edca_ac_be_aci, etc. in hostapd.conf.j2.
49+
aci = "aci"
50+
51+
# MACsec / 802.1AE "pn" = Packet Number (sequence counter).
52+
# Used in `ip macsec add … tx sa 0 pn 1 on key …` commands and in hostapd.
53+
pn = "pn"
54+
Pn = "Pn"
55+
56+
# ISO 3166-1 alpha-2 country codes used in GeoIP constraint <regex> and <list>
57+
# elements in interface-definition XML files. "ba" = Bosnia and Herzegovina;
58+
# "fo" = Faroe Islands. The GeoIP lists contain every valid two-letter code
59+
# and are auto-generated — fixing them individually is impractical.
60+
ba = "ba"
61+
fo = "fo"
62+
63+
# vyos-commitd: the VyOS commit daemon. The "commitd" suffix follows the Linux
64+
# daemon-naming convention (sshd, named, …). Appears in systemctl unit files,
65+
# test helpers, and the daemon source itself.
66+
commitd = "commitd"
67+
68+
# _OFR_CONFIGURE: VyOS bash env variable set in vyatta-op bash completion
69+
# to detect configure mode. OFR is a component of this identifier split by _.
70+
OFR = "OFR"
71+
72+
# RT_FlAGS / NTF_FlAGS: Linux UAPI kernel headers (rtnetlink.h, neighbour.h)
73+
# vendored into vyos-1x. The mixed-case "FlAGS" is upstream kernel source;
74+
# typos splits it into "Fl" + "AGS" — "AGS" is the flagged component.
75+
AGS = "AGS"
76+
77+
# Triple DES EDE (Encrypt-Decrypt-Encrypt) — standard crypto mode name used
78+
# in IPsec cipher suites (DES-EDE3-CBC, des-ede3-cbc) and OpenVPN config.
79+
EDE = "EDE"
80+
ede = "ede"
81+
82+
# TCP/SCTP Retransmission Timeout (RTO). Used as RTAX_RTO_MIN netlink
83+
# attribute name in network-event-logger and as an rto_min route attribute.
84+
RTO = "RTO"
85+
rto = "rto"
86+
Rto = "Rto"
87+
88+
# nftables chain-name prefix used in VyOS bridge firewall templates (nftables-bridge.j2).
89+
# "NAM_" is an internal VyOS shortcode for named-ruleset chains (cf. "NAME_" chain type).
90+
NAM = "NAM"
91+
92+
# Linux kernel Data Access MONitor (CONFIG_DAMON). Appears in linux-kernel
93+
# defconfig fragments. Belt-and-braces allowlist for files outside the excluded path.
94+
DAMON = "DAMON"
95+
96+
# Qualcomm 60 GHz WiFi driver (CONFIG_WIL6210). Same rationale as DAMON.
97+
WIL = "WIL"
98+
99+
# CONFIG_EXPORTFS: Linux kernel export-filesystem support (NFSd kernel module).
100+
EXPORTFS = "EXPORTFS"
101+
102+
# Synopsys Inc.: semiconductor IP vendor (DWC USB, DesignWare Ethernet, etc.).
103+
# Appears as CONFIG_SYNOPSYS_* in kernel defconfigs.
104+
SYNOPSYS = "SYNOPSYS"
105+
106+
# CONFIG_ADIN_PHY: Analog Devices ADIN1300/ADIN1200 Ethernet PHY driver.
107+
ADIN = "ADIN"
108+
109+
# QoS token bucket / WRED threshold parameters: max_thr (maximum threshold)
110+
# and min_thr (minimum threshold). Standard abbreviations in tc(8) / iproute2.
111+
thr = "thr"
112+
113+
# hostapd / IEEE 802.11ai Optimized Connectivity Experience (OCE).
114+
# Config parameter family: oce_sta, oce_ap, etc. in hostapd.conf.j2.
115+
OCE = "OCE"
116+
117+
# inh-caps: setpriv(1) flag for inheritable Linux capabilities.
118+
# Used in kea-vrf-helper to set inheritable capabilities before exec.
119+
inh = "inh"
120+
121+
# hostapd SME = Station Management Entity (IEEE 802.11 internal protocol layer).
122+
# Appears in comments in hostapd.conf.j2: "driver SME is used".
123+
SME = "SME"
124+
125+
# Prefix-match completion file (src/opt/vyatta/etc/shell/level/users/allowed-op)
126+
# lists progressive prefixes of op-mode commands for tab completion:
127+
# c, cl, cle, clea, clear — "clea" is a valid entry, not a typo.
128+
clea = "clea"
129+
130+
# VyOS dummy interface short prefix: VyOS names dummy interfaces "dumX" (dum0, dum1,
131+
# dum8000, etc.) per the sysconf/netdevice mapping "dum -> dummy".
132+
# See ChangeLog: "Rename dummy interfaces to dumX to avoid confusion".
133+
dum = "dum"
134+
135+
# ATA/IDE hard disk device node prefix (hda, hdb, hdc, …).
136+
# Used in install scripts to enumerate available disk devices.
137+
hda = "hda"
138+
139+
# "grat." = gratuitous (as in "gratuitous ARP" / GARP). Conventional networking
140+
# abbreviation used in changelogs (e.g. "Extra grat. arps are not needed for vmac").
141+
grat = "grat"

0 commit comments

Comments
 (0)