Help

xoid for GitHub admins

xoid lets designers change your team's real iPhone app on live iPhone previews and send the changes to developers as pull requests. It reaches your repositories through the xoid GitHub App, which you install and control. This page explains what the App can do, which branches designers create, and how to keep your default branch and your xoid setup protected. It's version 0 (plan P4.14). Where something isn't built yet, it says so. Questions: hello@xoid.design.

Related pages: Developer prep guide for the developer who prepares the app, and IT guide for setting up designers' Macs.

1. The xoid GitHub App

The App is xoid-design (https://github.com/apps/xoid-design). It's public, so any organization can install it. xoid supports github.com only; GitHub Enterprise Server and ghe.com aren't supported yet.

What it can access

Permission Access Why
Contents Read and write Download the app's code (and private packages and submodules on github.com), and push designers' design/… branches
Pull requests Read and write Open designers' pull requests, request reviewers, add labels and comments
Metadata Read List the repositories xoid can see, and read which branches are protected and which rules apply to a branch, before pushing

It asks for nothing else: no administration, workflows, secrets or organization permissions, and no webhooks or events.

How it acts

  • As each person, never as the App. Every designer and developer connects their own GitHub account in xoid (Account › Connect GitHub…). xoid then acts with that person's user token. Commits and pull requests are theirs, and your rules and reviews apply to them as usual. xoid never uses the App's installation token.
  • Only where both agree. A user token reaches only the repositories you've given the App and that the person can access themselves.
  • Commits are authored as the person's GitHub name and <id>+<login>@users.noreply.github.com.
  • Git is xoid's own bundled git, over HTTPS to github.com only. It ignores the person's own git settings, and SSH remotes are rewritten to HTTPS.

2. Installing it on your organization

  1. Open https://github.com/apps/xoid-design/installations/new and choose your organization.
  2. Choose Only select repositories, and pick:
    • each app repository designers will work on;
    • any private repositories those apps need to build: Swift packages and submodules hosted on github.com.
  3. Review the permissions above and install.

You can change the repository list at any time in your organization's settings, under GitHub Apps › xoid-design › Configure.

Designers who try an app you haven't allowed see "xoid hasn't been allowed for your company yet", with a request to copy for you. It contains the install link and the permissions. A designer whose build needs a private package they can't reach sees "xoid can't get part of the app", with a request to copy for you.

People

  • Designers need write access to the app repository (forks aren't used). Giving it through a GitHub team is easiest.
  • Designers without a GitHub account get a guided path in xoid ("I Don't Have a GitHub Account"): an account with their work email, two-step verification using their Mac's Passwords app, and a request to you to add them to the organization.
  • SAML single sign-on: if your organization requires it, xoid shows "Sign in with your company's single sign-on" and opens GitHub's sign-on page for the person.

3. User tokens

How a person connects In their browser, with GitHub's own authorization page. GitHub sends the browser back to xoid on the Mac (http://127.0.0.1:<port>/github/callback).
Access token Expires after 8 hours. Kept in xoid's memory.
Refresh token Expires after about 6 months (182 days), and GitHub replaces it every time it's used. Kept in the Mac's Keychain (xoid-github:<installId>), readable only by xoid.
xoid's cloud Exchanges and refreshes tokens with the App's client secret, which never leaves xoid's backend. It doesn't store tokens and never logs them.

xoid refreshes the access token as needed. If a refresh fails because the token expired or was revoked, the person sees "Connect GitHub again" and connects again. Account › Disconnect GitHub deletes the Keychain item and revokes the token with GitHub.

4. The design/** branches

Designers' work lives on branches under design/. The prefix comes from share.branchPrefix in the app's .xoid/ios.json (default design/); <login> is the designer's GitHub login.

Branch Created when What it holds
design/<login>/<topic> A designer shares The Draft: one commit per share, and the pull request's head branch
design/<login>/<topic>--review-assets A designer shares with live previews Before and after pictures for the pull request
design/<login>/<topic>--autosave Automatically, while a designer works A backup of unshared work, at most every 15 minutes

The developer's one-time prep also pushes xoid/prepare-for-designers, from the developer's own account.

What xoid guarantees on every push:

  • Never forced: these branches only ever move forward.
  • Never to the default branch, a protected branch, tags, or any branch outside the designer's own design/<login>/….
  • Refused before anything moves if GitHub's rules for the branch restrict creating or updating it.
  • Refused if the designer's changes touch .xoid/ios.json, .github/** or a private file the developer set up.

Each shared Draft makes up to three branches. Keep the --review-assets branches: older pull requests show their pictures from them, and deleting one can remove the pictures from those reviews. A tool to clean up old ones is coming in a later release.

Recommended rulesets

Rulesets on private repositories need GitHub Team or Enterprise. On a Free plan, xoid's own checks above still apply, but GitHub won't enforce anything.

  1. Keep designers to design/**. A branch ruleset targeting all branches, excluding refs/heads/design/**, with "Restrict creations", "Restrict updates" and "Restrict deletions". Add your developers' team to the bypass list.
  2. Protect design/**. A branch ruleset targeting refs/heads/design/** with "Block force pushes". Don't add "Require linear history" there.
  3. Protect your default branch as you do today: required pull requests, reviews and status checks.

Don't add rules to design/** that restrict creating or updating branches, require a pull request, or require signed commits: designers then can't share (section 7). Don't use classic branch protection on design/** either: xoid won't push to a protected branch.

Importable ruleset files are coming in a later release.

5. CODEOWNERS for .xoid/ios.json

.xoid/ios.json is the developer's description of how xoid builds and opens the app: the scheme, the screens, approved Swift macros and plugins, private file mappings, which files designers may change, and the assistant setting. Only the iOS team should change it.

# .github/CODEOWNERS
/.xoid/ios.json            @acme/ios
/.xoid/designer-files/     @acme/ios

Then require code owner review on your default branch (in its ruleset or branch protection), so a change to these files needs the iOS team's approval.

xoid also guards them itself: designer mode can't edit them, designers' commits leave .xoid/ios.json out, and a share whose changes touch it, .github/** or a private file is refused.

6. Required reviews

Designers' changes reach your default branch only through a pull request that someone merges. xoid never merges, and never pushes to the base branch.

  • Your required reviews, code owner reviews and status checks apply to designers' pull requests like any other.
  • xoid requests the reviewers listed in share.reviewers and adds share.labels from .xoid/ios.json.
  • Git hooks aren't run on designers' machines; the pull request says so, and your CI checks the change.
  • "Allow edits by maintainers" is off on designers' pull requests.
  • xoid checks that each designer's commit builds on its own before pushing it.

7. Repositories that require signed commits

If a rule requires signed commits (required_signatures) on the Draft's branch, xoid doesn't share yet. Before anything is pushed, the designer sees "This app only accepts verified changes, which xoid can't send yet", and their work stays on their Mac. The same happens when .xoid/ios.json sets share.commitMethod to github-api.

Sending designers' commits and backups through GitHub's API, which signs them, is coming in a later release. Until then, either:

  • leave design/** out of your signed-commit rule, and keep requiring signatures on your default branch; or
  • wait for that release before designers share from this repository.

Backups are pushed with ordinary git, so a signed-commit rule on design/** also stops them. Designers see "Backup paused" in xoid's status bar. You can turn backups off for the app instead (section 8).

8. Turning backups off

Backups keep a designer's unshared work safe if their Mac is lost or replaced: xoid pushes it to design/<login>/<topic>--autosave after a successful build, at most every 15 minutes, and a designer can open it on another Mac.

To turn them off for an app, the developer sets this in its .xoid/ios.json:

"share": { "backup": false }

Designers of that app then see "Saved on this Mac only (your team turned off backups)", and their unshared work exists only on their Mac. Shares still work. Existing --autosave branches stay on GitHub until you delete them.

9. Revoking access

To Do this
Stop xoid reaching one repository Remove it from the App's repositories: GitHub Apps › xoid-design › Configure
Stop xoid reaching your organization Uninstall the App in the same place
Stop one person Remove their write access or organization membership, as for any other tool
Disconnect one Mac In xoid, Account › Disconnect GitHub. It deletes the Keychain item and revokes the token. A person can also revoke xoid in their GitHub settings, under authorized GitHub Apps.
Remove someone from the xoid team A developer uses Account › Team… › [Remove]. They can no longer use the assistant through your team.

After access is removed, xoid can't download, update or share that app for that person. A new download shows "xoid can't download this app", with a request to copy for you. Copies already downloaded stay on designers' Macs until they remove them.

10. Help