Commit b4e3c9e
committed
korg: add userinfo command for org and OWNERS lookup
Adds `korg userinfo <user>...` to answer the recurring question this
repo exists for: which Kubernetes orgs is a user in, what role, and
where do they appear in OWNERS files.
Sources:
- GitHub user API for company / profile
- config/<org>/org.yaml (Members / Admins) for k8s org membership
- cs.k8s.io (hound) for OWNERS file references
Behavior:
- Honors GITHUB_TOKEN / GH_TOKEN to avoid the 60/hr unauth limit
- Per-request context with a 30s timeout; SIGINT cancels in flight
- Multi-user batches run concurrently (errgroup, bounded to 4) with
output preserved in input order
- One bad username does not kill the batch; per-user errors render
and the process exits non-zero
- Hound failures degrade to a warning instead of dropping org info
- OWNERS results render as an aligned REPO / PATH / URL table; URL
uses /blob/HEAD/ so the link resolves to the default branch
- `--output json` for scripting
Dependencies:
- google/go-github v17 (untagged) -> v88
- spf13/cobra v0.0.5 -> v1.10.2 (for ExecuteContext)
- adds golang.org/x/sync for errgroup
- go directive bumped to 1.22+
Signed-off-by: Nabarun Pal <pal.nabarun95@gmail.com>1 parent 8a7295b commit b4e3c9e
5 files changed
Lines changed: 976 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| |||
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
61 | 85 | | |
62 | 86 | | |
63 | 87 | | |
| |||
222 | 246 | | |
223 | 247 | | |
224 | 248 | | |
225 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
226 | 275 | | |
227 | 276 | | |
228 | 277 | | |
0 commit comments