Read TELEGRAM_CHAT_ID from OpenBao in the five notify jobs that still use a repository secret #88
Labels
No labels
priority/P0
priority/P1
priority/P2
priority/P3
size/L
size/M
size/S
size/XL
size/XS
state/blocked
state/done
state/in-progress
state/in-review
state/needs-refinement
state/ready
type/bug
type/chore
type/feature
type/refactor
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
amtronics/platform-actions#88
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Five repositories' notify jobs read
TELEGRAM_CHAT_IDfrom a Forgejo repository secret (${{ secrets.TELEGRAM_CHAT_ID }}):ahmad/larda,ahmad/expiro,bayan/bayan-web,amtronics/forgejo-mcp,amtronics/agent-bus. The other ten fetch it from OpenBao withopenbao-fetch, so a change inapps/<app>/secrets.vault.ymlreaches them on the next run. For the five, nothing writes the secret: the alerts/CI-CD split (infrastructure-vps#449) had to set them by hand.Scope
TELEGRAM_CHAT_IDfrom the fetched secrets like the rest; the hand-set repository secrets removed once each is merged.Acceptance criteria
TELEGRAM_CHAT_IDin an app's vault file, when the sync has run, then that app's next pipeline notification uses the new value with no hand step.TELEGRAM_CHAT_IDrepository secret.Plan, and a correction to the scope
It is fifteen workflow files, not five notify jobs. Each of the five repositories reads
secrets.TELEGRAM_CHAT_IDin three workflows, not the two the scope names —pr.ymlas well asrelease.ymlanddeploy.yml. Criterion 2 says no repository carries the secret, and that cannot be true while apr.ymlstill reads it, so all three move or the secret stays. Counted, not assumed:One pull request per repository, three files each — that keeps every change inside the size this estate takes in one PR, and a repository whose pipeline breaks is isolated to its own change. Starting with
ahmad/larda.The pattern is
ahmad/trip's, copied rather than invented: anopenbao-fetchstep withrequired: false, then a step that reads the key out of the rendered.env, masks it, writes it toGITHUB_ENVand deletes the file.required: falseis the important half and it is already reasoned out intrip's own comment — a notification is worth sending and not worth reddening the run it exists to report on.Two things I checked rather than assumed:
OPENBAO_ROLE_IDandOPENBAO_SECRET_IDas repository secrets, so none needs a secret created to do this.bayan/bayan-webhas noopenbao-fetchanywhere and noOPENBAO_ADDR/OPENBAO_PATH, so its change adds the workflow env as well as the steps. The other four already fetch from OpenBao inrelease.ymlanddeploy.yml; in all five,pr.ymlhas no OpenBao wiring at all and gains the env too.The bot token stays as it is, per the scope. In
lardathat means the fetch takesTELEGRAM_CHAT_IDonly andtoken:keeps reading the repository secret.I am not deleting the repository secrets. Criterion 2's second half is a remote mutation on secret storage that cannot be undone from a repository, and it is only safe once a repository's replacement has actually run green. Once all five are merged I will report which are ready to remove and leave the removal to you, under Needs you.
One observation, out of scope and not touched:
ahmad/expiro's notify jobs readsecrets.TELEGRAM_BOT_TOKEN, expiro has no such repository secret, andahmadis a user rather than an organisation, so there is no org secret behind it either. If that resolves empty then expiro's pipeline notifications are being skipped silently —notify-telegramtreats an empty token as a skip. I could not confirm it (the user-secrets endpoint answers 404 on this instance), so it is worth a look rather than a claim, and it is a separate issue from this one either way.First repository done, and one question that gates the other four
ahmad/larda: ahmad/larda#206 — all three notify jobs fetch the chat id from OpenBao, no path left reading the repository secret, pipeline green,docs/CONFIGURATION.mdmoved in the same change. Left asWIP:on purpose.The gap. A green
notifydoes not prove the notification was sent:required: falseplus an empty value is a clean skip, and a skip succeeds. I could not close it from here — this Forgejo exposes no Actions log endpoint to a token (every/logsand artifacts shape answers 404), and the app vaults are encrypted under a vault id whose password the workspace does not hold, so I could not read the key's presence either. My first attempt at that reported the key missing from all seven vaults I checked, which was a suppressedDecryption failedrather than an answer —tripandportfoliofetch this key today, so a result saying it is absent from their vaults refuted itself.One glance settles it for all five: did the CI/CD chat receive a
CInotification forahmad/larda#206?#206out ofWIP:and do the remaining four the same way.infrastructure-vpschange and out of this loop's scope. Nothing should merge before that, or notifications stop silently in five repositories at once.The alternative, if you would rather not be the check:
chat-id: ${{ env.TELEGRAM_CHAT_ID || secrets.TELEGRAM_CHAT_ID }}in all five makes the change strictly non-regressive — vault first, existing secret as the fallback — and then criterion 2's deletions happen later, once something has actually proven the vault value arrives. It costs keeping the secret a while longer and reads slightly worse; it cannot regress anything.Remaining:
ahmad/expiro,bayan/bayan-web,amtronics/forgejo-mcp,amtronics/agent-bus— three workflow files each,bayan-webalso needing theOPENBAO_ADDR/OPENBAO_PATHenv it has nowhere today.The expiro observation from my plan comment is now verified and filed as
ahmad/expiro#96. I raised it here as "worth a look rather than a claim" and then did not file it, which was the mistake; this is the correction.It is real: expiro's three notify jobs send with
secrets.TELEGRAM_BOT_TOKEN, that secret is not among its repository secrets, andahmadis a user namespace rather than an organisation (GET /orgs/ahmad→ 404), so there is nothing to inherit from. An empty token is a clean skip insidenotify-telegram, and a skip succeeds — so the job has been green while sending nothing.It is expiro alone, which I checked rather than assumed:
lardaandnameyalso readsecrets.and both hold the secret;trip,portfolio,imamahandlaunchpadfetch theirs from OpenBao.It touches this issue at one point. The clean fix is to fetch the token from OpenBao the way four sibling repositories already do — which depends on
secret/expirocarrying it, the same unverified question that holds this issue. So whichever way the vault question is answered here, it answers that too. The bot token stays out of scope for this issue; the dependency is recorded on#96rather than folded in.Correcting my own scope above: it is four repositories, not five
bayan/bayan-webis already done and should come out of this issue. All four of its workflows that callnotify-telegram—pr,release,deploy,monitoring— already fetch the value from OpenBao and readenv.TELEGRAM_CHAT_ID. It was converted in its ownBayan/bayan-web#32, "ci: Let a vault outage skip the notification".Why I said otherwise. My plan comment counted "fifteen workflow files across five repositories". I measured that by grepping the local
main-wtworktrees — andbayan-web's is 11 commits behind its remote, so I read the version from before the conversion. Measured again against each repository's actual head, verified equal tols-remotein every case:So: twelve files across four repositories, one of which already has its pull request open.
bayan-web#32is the precedent worth copying rather than re-deriving. It is the same change, already reviewed and merged in this estate, and its title records the same conclusion I reached independently on#206— a vault outage must skip the notification rather than fail the run.One trap for anyone repeating this measurement.
amtronics/agent-bus's bare clone has norefs/remotes/origin/*at all — its fetch lands inFETCH_HEADand the ref to read ismain. A sweep keyed onorigin/mainreports zero matches for it and looks like a clean result, which is how it dropped out of my first recount. Its localmainis current with the remote and it does readsecrets.TELEGRAM_CHAT_IDin three files, so it stays in scope.Nothing about the approach changes — only the count, the list, and where to look for the precedent.
Resuming: the remaining three repositories
ahmad/larda#206merged on 2026-09-18 with the vault value proven from its own notify job log, so the pattern is settled and the same change goes toahmad/expiro,amtronics/forgejo-mcpandamtronics/agent-busnext — one pull request each,WIP:until that repository's own notify log shows the chat id arrived from the vault. The three changes are prepared; the pull requests follow.Same shape as
#206in every file:openbao-fetchwithrequired: false, a masked load into the job env,notify-telegramreadingenv.TELEGRAM_CHAT_ID;pr.ymlgains theOPENBAO_ADDR/OPENBAO_PATHenv the other two workflows already declare;docs/CONFIGURATION.mdmoves the row. The bot token stays as it is.One thing the docs had wrong on the two
amtronicsrepositories: theirCONFIGURATION.mdlistsTELEGRAM_CHAT_IDas a Forgejo org secret, but the org holds onlyTELEGRAM_BOT_TOKENand the chat id is a repository secret in each (read back from the secrets endpoints). The moved row corrects that as a side effect.ahmad/expiro's notification still cannot be observed delivered from here —ahmad/expiro#96(no bot token) is what stops it, not this change — so for that one the log can only show the fetch succeeding, and that is what will be reported.The last three consumers now have a WIP PR: ahmad/expiro#99, amtronics/forgejo-mcp#21, amtronics/agent-bus#17. Each will be marked ready once its own notify job shows the vault fetch and a delivered notification (expiro: fetch only, see expiro#96).
All four consumers merged — one hand step left, yours
Merged on the bot's approval with green checks:
ahmad/expiro#99(df13d75),amtronics/forgejo-mcp#21(d3e513b),amtronics/agent-bus#17(2219776);ahmad/larda#206earlier, andBayan/bayan-webwas already done (#32).openbao-fetch: wrote … from secret/<app>; forgejo-mcp and agent-bus thenTelegram notification delivered.(expiro skips sending: it has no bot token,ahmad/expiro#96).mainin any of the five readssecrets.TELEGRAM_CHAT_IDany more (grepped eachorigin/main), but the repository secret still exists in all five:ahmad/larda,ahmad/expiro,Bayan/bayan-web,amtronics/forgejo-mcp,amtronics/agent-bus. Deleting secrets is outside what the loop may do. Safe to delete now; bayan-web'sNOTIFY_TELEGRAM_*pair is a separate question, not touched.Moving this to
state/blockedon that step; close it once the five are gone.