Skip to content

feat: add e auto-roll#869

Merged
jkleinsc merged 2 commits into
mainfrom
sam/e-auto-roll
May 28, 2026
Merged

feat: add e auto-roll#869
jkleinsc merged 2 commits into
mainfrom
sam/e-auto-roll

Conversation

@MarshallOfSound
Copy link
Copy Markdown
Member

@MarshallOfSound MarshallOfSound commented May 27, 2026

Depends on electron/agent-workflows#11 (merged), which roots the roll
bundle at a fetchable base commit. Without that, the bundle's base is a
local-only commit and apply fails with Repository lacks these prerequisite commits.

What

Adds e auto-roll — list the Chromium auto-rolls produced by the
agent-workflows service, pick one interactively, download its git bundle,
and apply the proposed commits on top of your local roller/chromium/main.

e auto-roll [--branch <name>] [--remote <name>] [--no-fetch] [--limit <n>] [--run <id>] [--no-apply]
  • Authenticates with the service's Cloudflare Access (browser SSO the first
    time; token cached under ~/.cloudflared, reused after).
  • Lists recent successful runs, shows the agent's summary + base → head, and
    asks before doing anything.
  • Fetches the latest roller branch, then applies the roll: fast-forward when the
    branch is exactly at the roll's base, otherwise cherry-picks the commits on
    top. Conflicts stop with the bundle ref left at refs/auto-roll/<run> so you
    can resolve and git cherry-pick --continue.

How the Cloudflare Access auth works (no cloudflared dependency)

src/utils/cf-access.ts ports cloudflared's browser-login token-transfer flow:
discover the Access app via the login redirect, open the login URL, long-poll
login.cloudflareaccess.org for the encrypted token, and decrypt it (NaCl box,
via tweetnacl). The token is sent in the Cf-Access-Token header, and cached
in ~/.cloudflared so it interops with the real binary if present.

Notes

  • New dependency: tweetnacl (audited, zero-dep, no install scripts) for the
    NaCl box decryption — Node's crypto has X25519 but not XSalsa20/Poly1305.
  • git-level apply mechanics (bundle verify, fetch-by-sha, fast-forward vs
    cherry-pick) were validated against synthetic repos locally.

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 27, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedtweetnacl@​1.0.310010010075100

View full report

@MarshallOfSound MarshallOfSound marked this pull request as ready for review May 27, 2026 23:55
@MarshallOfSound MarshallOfSound requested review from a team and ckerr as code owners May 27, 2026 23:55
@dsanders11 dsanders11 changed the title feat: add e auto-roll (blocked on agent-workflows#11) feat: add e auto-roll May 28, 2026
Comment thread src/utils/cf-access.ts Outdated
Comment thread src/e-auto-roll.ts Outdated
Comment thread src/e-auto-roll.ts Outdated
Adds an `e auto-roll` command that lists the Chromium auto-rolls produced
by the agent-workflows service (agents.electronjs.org), lets you pick one,
downloads its git bundle, and applies the proposed commits on top of the
local roller/chromium/main branch (fast-forward when the branch is at the
roll's base, otherwise cherry-pick).

The service is behind Cloudflare Access. Rather than depend on the
`cloudflared` binary, src/utils/cf-access.ts ports the browser-login
token-transfer flow: it discovers the Access app, opens the login page,
long-polls the transfer service, and decrypts the returned token (NaCl
box, via tweetnacl). The token is cached under ~/.cloudflared and sent in
the Cf-Access-Token header on each request.
- cf-access: a per-poll fetch timeout now falls through to the retry loop
  instead of bubbling an abort error out of runTransfer; use
  AbortSignal.timeout and catch the TimeoutError.
- e-auto-roll: drop the unnecessary bundle.meta type assertion (the guard
  + fatal() already narrows base/head to string).
- e-auto-roll: pipe the fetch web stream straight into pipeline and drop
  the now-unused node:stream import.
@jkleinsc jkleinsc merged commit 9e84750 into main May 28, 2026
14 checks passed
@jkleinsc jkleinsc deleted the sam/e-auto-roll branch May 28, 2026 20:52
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.

3 participants