Skip to content

Admins link an app to GitHub and bring in its changes; apps use keys from Keys; notes for 0.0.52 - #191

Merged
TigerYWang merged 8 commits into
mainfrom
dev/admin-github
Nov 12, 2026
Merged

TigerYWang merged 8 commits into
mainfrom
dev/admin-github

Conversation

@TigerYWang

Copy link
Copy Markdown
Contributor

What changes

An Admin, or a Member given App secrets in Team (the switch Publish already uses), can now do from a shared workspace's Your Apps what only the owner's own window could, with the owner's Mac off:

  • Set where an app publishes on GitHub (repo, branch, folder, files left alone, workflow), or put it back on Orgo. Bops Cloud checks who asked and writes it on the owner's state itself (cloud/members.ts githubHere). A new repo, branch, folder or workflow needs a GitHub key of the workspace's own (This workspace, in Keys): the owner's key for all their workspaces stays the owner's to point (403 member_owner_only). The same folder with more files left alone keeps its link (cloud/github-config.ts keepsPoint, now one rule for the owner's Mac and Bops Cloud).
  • Link it, and bring GitHub's changes in. Bops Cloud owes the job to the app's own computer as a chat turn that carries it (TurnMember.job, cloud/turns.ts takeAppJob): no migration, waking, leases, one at a time per chat and cancel on a removal all come from the turns. The runner does it (lib/server/runner-chat.ts runJob → lib/server/hosted-apps.ts githubJob) with its own Ingot token and its own sign in for the GitHub key, which never leaves Orgo's broker, says it in the bot's chat as Bops' own, and posts its result with the turn's end. Bops Cloud keeps it on the app (going, then how it went), and so does every way a job can end without its computer saying (can't wake, lost partway, access taken away, a runner from before).
  • When the computer can't (runner older than the gate, none, app lost its computer, or no bot there given GITHUB_TOKEN), the owner's Mac does it as a member's other app acts, in the person's name (lib/server/member-acts.ts). Only the key missing with the Mac off is said at once (409 github_no_key: give the bot the GitHub key).
  • Link takes files only Ingot has (lib/server/github-mirror.ts linkAndSay): a new client's own folder in a shared repo links, and goes up with the first Publish. A file GitHub has that Ingot lacks, or has otherwise, still gives LINK_DIFFERS.
  • Your Apps gets a GitHub part for whoever may (SharedWsSlice.appGithub): where it publishes and when it was last the same, Bring in (asked first: GitHub's version wins where both changed a file), Link, Change where it publishes (Save and link), Publish on Orgo instead. An Admin's Publish waits, greyed with why, while the app isn't linked. The form moved to components/app/github-form.tsx so the owner's menu and Your Apps share it.
  • The owner's own GitHub buttons say "Change it in this workspace's Your Apps." while a shared workspace is open (the guard stays: a viewer's own Bops never acts on its own app of that name).
  • The owner's Mac merge keeps an app's GitHub setting whole (lib/server/state-merge.ts githubWhole): never a new repo with the old one's link point, never one side's commit with the other's changeset.

Why

A workspace whose apps publish to a shared GitHub repo needs its Admins to link a new client app and bring GitHub's changes in without waiting for the owner's Mac, and the work has to run where Ingot and the GitHub key both are: the app's own computer. Decisions followed: Admins always, a Member only with Your Apps at Write and App secrets; Link may accept files only Ingot has; a new destination only with the workspace's own GITHUB_TOKEN; the token never leaves the broker.

Versions

GITHUB_ACTS_MIN_VERSION = "0.0.52" (0.0.51 is being prepared without this). Bops Cloud refuses the acts (409 owner_bops_old) and shows no GitHub part until the owner's last Mac is at it; owes a job only to a runner at it (else the owner's Mac); shows the GitHub acts only to a viewer Bops at it (an older window would read one as a domain's). Older runners never get a job; one that did would read a system note and answer nothing, and a done with no result is kept as not done. Deploy order: Bops Cloud first (safe: gated on the owner's Mac version), then the release; the owner's Mac must open it once to roll the runners.

How I checked it

  • npx tsc --noEmit -p . and npx tsc -p cloud/tsconfig.json --noEmit: clean. eslint on every touched file: no errors (the 4 warnings in scripts/test-hosted-apps.mjs are main's).
  • Bops Cloud on a throwaway Postgres 18: node --test --test-concurrency=1 "cloud/test/core-*.test.ts" 380/380; "cloud/test/edge-*.test.ts" cloud/test/server.test.ts 196/196. New: 4 in core-members (cleanAct shapes, the slice's GitHub fields and flag, who may, the owner's own key), 5 in edge-turns (an Admin's Bring in end to end with the Mac shut, runner claim and result, a runner's state write moving only the point; Save and link with and without the workspace's key; keepsPoint and null; who may and the fallbacks; job ends the computer never says).
  • Scripts: test-github-mirror 26 (2 new), test-runner-chat 13 (2 new), test-member-acts 41 (1 new), test-hosted-apps 143 (1 new), test-state-merge 42 (1 new), test-shared 71 (1 new), test-hosted-apps-ui 74 (1 new), and unchanged suites test-computer-scope 19, test-app-restore 22, test-keys 48, test-plain-words 9, test-members-ui 28, test-preview-password-ui 10. All pass.
  • scripts/check-public.sh: OK.

Not done, and limits

  • Built on main's Your Apps card: Your Apps: review changes before publishing #186 (AppReview) isn't merged. Its destination and status props should take this GitHub part when it lands.
  • A job cancelled while it runs (access taken away mid pull) still finishes its Ingot write on the computer; Your Apps then says it didn't go. Ingot keeps the history.
  • A Link or Bring in waits behind a chat answer running in the same bot chat (one at a time per chat).
  • A viewer whose Bops doesn't say its version (a dev build) isn't shown the GitHub acts' rows.
  • Not tried against a real Orgo, Ingot or GitHub: every service is a fake in the tests. The runner path needs a computer that can wake, an Ingot token for the workspace on it, and GITHUB_TOKEN given to a bot on it (that grant reaches orgo-web through the owner's Mac's access sync).
  • No bot tool for it yet (the design's optional github_app).

…at a time

A key saved for This workspace in Keys now has a switch, "Every app in this workspace
can use it". Each app gets the key as a variable of the same name when it's built,
new apps too, with nobody acting and the owner's Mac off. An app's Variables gain
"From Keys": its keys from Keys by name, every app's and its own, and "Use a key from
Keys" to give it one under a name of its choosing.

orgo-web keeps the links and fills the value in at each build from the owner's vault,
whoever deployed it, so only names pass through Bops: the owner's Mac, a member's Bops,
Bops Cloud and runners never see the value. The owner, an Admin or a Member given Keys
may link; one app's link in a shared workspace also needs Your Apps at Write. The
owner's keys for all their workspaces stay theirs and are never offered.

When Keys gets a new value, Previews that use it are built again at once and Published
gets it at its next Publish. The window says that anyone who can change an app's code
can read its keys. An Orgo without the new route gets "Orgo can't link keys to apps
yet." and no switches. A bot working on an app is told to read keys from the
environment and never write one into the folder, a commit or a chat.
…Apps, with the owner's Mac off

An Admin, or a Member given App secrets in Team (the switch Publish uses), can now do from a shared workspace's
Your Apps what only the owner's own window could:
- Set where an app publishes on GitHub (repo, branch, folder, files left alone, workflow). Bops Cloud checks who
  asked and writes it on the owner's state itself, Mac on or off. Pointing the GitHub key at a new repo, branch,
  folder or workflow needs a GitHub key of the workspace's own (This workspace, in Keys): the owner's key for all
  their workspaces stays theirs to point. The same folder with more left alone keeps its link.
- Link it, and bring GitHub's changes in. Bops Cloud owes the job to the app's own computer as a turn, which its
  runner does with its own Ingot token and its own sign in for the GitHub key (the key never leaves Orgo's broker),
  says in the bot's chat, and Your Apps shows as going, then how it went. When that computer can't (its runner
  older than this release, or no bot on it given the GitHub key), the owner's Mac does it when it opens, in the
  person's name; only the key missing with the Mac off is said at once: give the bot the GitHub key.
- Link now takes files only Ingot has (a new client's own folder in a shared repo): they go up with the first
  Publish. A file GitHub has that Ingot lacks, or has otherwise, still stops it.

Older versions keep working: Bops Cloud refuses these acts and shows no GitHub part until the owner's last Mac is
on GITHUB_ACTS_MIN_VERSION (0.0.52), gives a job only to a runner at it, and shows the new acts only to a Bops at
it. The owner's Mac keeps a GitHub setting whole when it merges (never a new repo with the old one's link point).
The owner's own GitHub buttons say "Change it in this workspace's Your Apps." while a shared workspace is open.
…where it publishes, Link, and Bring in GitHub's changes

For an Admin, or a Member with App secrets, at Your Apps Write, once the owner's Bops takes it (SharedOpen.appGithub),
an app's details have a GitHub part:
- Where it publishes (repo, branch, folder) and when it was last the same as GitHub, or that it isn't linked yet.
- "Bring in GitHub's changes", asked first ("GitHub's version wins where both changed a file"), and "Link to GitHub".
  Its computer does them: the app's line says so while it works, then how it went, with what it said.
- "Change where it publishes" (or "Publish to GitHub instead"): the owner's own form, saved and linked in one go, with
  a line saying a new repo, branch, folder or workflow needs a GitHub key of the workspace's own; and "Publish on Orgo
  instead". An app of more sites says why it stays on Orgo.
- An Admin's Publish waits, greyed with why, while the app isn't linked yet.
The owner's Your Apps reads members' GitHub acts the same way. The form moved to components/app/github-form.tsx so both
pages share it. Built on main's Your Apps card: the review card rewrite (#186) isn't merged yet.
@TigerYWang
TigerYWang marked this pull request as ready for review November 12, 2026 15:17
@TigerYWang TigerYWang changed the title Admins link an app to GitHub and bring GitHub's changes in from Your Apps, with the owner's Mac off Admins link an app to GitHub and bring in its changes; apps use keys from Keys; notes for 0.0.52 Nov 12, 2026
@TigerYWang
TigerYWang merged commit 64b241c into main Nov 12, 2026
8 checks passed
TigerYWang added a commit that referenced this pull request Nov 12, 2026
…#191)

Brings in #191 and releases 0.0.51 and 0.0.52. Where they meet the new Your Apps:

- An Admin's (or a Member's with App secrets) GitHub part sits in Technical details,
  where the owner's GitHub menu is. While its computer links the app or brings
  GitHub's changes in, Publish waits ("Its computer is busy with GitHub. Publish once
  it's done."); Update preview doesn't. Not linked yet, Publish says "Link it to GitHub
  first."
- Bops Cloud says the changeset last sent to GitHub (`at`) at every level, beside
  #191's `linked` at Write, so a Read member's review reads Live from GitHub too. A
  Bops Cloud with only `linked` (0.0.52) is read from that, at Write.
- The refusal for an app not linked yet reads "Link it first, from Technical details
  in Your Apps.", where both the owner and an Admin find Link.
- #191's GitHub part checks are ported to the new page, with the words check the old
  shared page test had. The browser run answers /api/keys/apps for the sample, as it
  answers the other app routes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant