Repository navigation
Commit 76f008d
authored
install-labels: Install the agent labels on every pipeline repository (#126)
* install-labels: Test that the workflow copy of LABELS matches
install-labels.yml has to inline the label list because gh aw add copies
it into consumer repositories without the script, so the two copies are
kept in sync by hand. Nothing checked that, and the pipeline-wide
installer coming next applies the install-labels.js copy to every
repository running the pipeline, so drift between the two would go
unnoticed. Also document agent/flake-tracker, which the scripts README
list was missing.
Prep for installing labels on every pipeline repository.
Generated-by: AI
Signed-off-by: Colin Walters <walters@verbum.org>
* install-labels: Plan label changes before applying them
installLabels() blindly PATCHed every label it found and only created
one after a getLabel 404, which means a request per label per run even
when nothing changed, and no way to see what a run would do. Split it
into a pure planLabelChanges() over the repository's current labels
and a small apply step behind a transport interface, so the planned
diff is unit tested, can be printed as a dry run, and the upcoming
multi-repository installer can reuse the same code with the gh CLI
instead of carrying its own copy of the create/update logic.
Labels are matched case-insensitively like GitHub does, so a label
that differs only in case is renamed rather than failing to create a
duplicate.
Prep for installing labels on every pipeline repository.
Generated-by: AI
Signed-off-by: Colin Walters <walters@verbum.org>
* install-labels: Install the labels on every pipeline repository
Each repository running the pipeline installs its labels from its own
copy of install-labels.yml, which only changes when that repository runs
gh aw update, so a new or renamed label can take a long time to arrive:
bcvk still lacks agent/drafter-working after the rename, and its drafter
silently skips setting its working label because gh issue edit
--add-label refuses unknown labels.
Add install-labels-org.yml, run on every push to main, that applies
LABELS to every bootc-dev repository containing any of
drafter.lock.yml, review.lock.yml or fix.lock.yml, the compiled
workflows gh aw add installs, so a repository that adopted only part of
the pipeline still counts. Today that is bootc, bcvk, infra and
gh-agentic-workflows; the other 17 repositories don't run the pipeline
and have no use for agent/* labels, so they are skipped rather than
cluttered. With --installation it only considers repositories the
pipeline's App is installed on, so an adopter the App doesn't cover yet
is not tried (and failed) on every run.
It runs as a postsubmit rather than on a schedule: label changes land
here, so a push is when there is something to apply, and syncing on
every push rather than only label changes also repairs drift (labels
edited by hand, or reverted by a repository's outdated
install-labels.yml) without polling, for one label listing per
pipeline repository when nothing changed.
bootc-dev/infra already syncs labels.toml to every bootc-dev and
composefs repository. Putting the agent labels there was considered,
but that sync is unconditional, so it would need a per-label
repository filter it doesn't have, and it would add a third copy of
LABELS in a different repository with nothing checking it against the
two here that gh aw add distributes. Keeping the agent labels here
means one repository owns their definition, distribution and sync,
while infra keeps owning org-wide labels; the two sets don't overlap.
Nothing here runs against the live organization in PR CI; the dry run
is available locally or by dispatching the workflow with dry-run.
Closes: #104
Generated-by: AI
Signed-off-by: Colin Walters <walters@verbum.org>
---------
Signed-off-by: Colin Walters <walters@verbum.org>1 parent f1b7feb commit 76f008d
5 files changed
Lines changed: 598 additions & 40 deletions
File tree
- .github/workflows
- scripts
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
96 | 107 | | |
97 | 108 | | |
98 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
88 | 117 | | |
89 | 118 | | |
90 | 119 | | |
| |||
137 | 166 | | |
138 | 167 | | |
139 | 168 | | |
140 | | - | |
141 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
0 commit comments