Skip to content

PLX-248: plx-ci setup without a token and without op on the forge's runners - #93

Merged
davidjalbers merged 12 commits into
plain-pipeline-2from
davidjalbers/plx-248-setup-on-the-forges-runners
Dec 3, 2026
Merged

davidjalbers merged 12 commits into
plain-pipeline-2from
davidjalbers/plx-248-setup-on-the-forges-runners

Conversation

@davidjalbers

@davidjalbers davidjalbers commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

PLX-248: plx-ci setup on the forge's own runners, which carry no op and give a pull request from a fork no secrets. Decision § 8.4.

Two cases

A job handed no credential for the vault (no Connect server on the runner, no OP_SERVICE_ACCOUNT_TOKEN).
A repo job reads nothing from the vault and says so in one line, a ::warning:: annotation, so that a pull request of the repo itself whose secret is unset or misnamed does not go green unnoticed: no token for the vault: reading nothing from it; the job runs without the server-actions key and ..., the rest depending on the runner:

What the job without a token gets forge runner (a fork's pull request) slot without Connect slot with Connect
vault nothing read nothing read it has a credential: reads through Connect, as before, no "no token" line
server-actions key none (Next makes its own in the build) none handed
registry logins the job's own GITHUB_TOKEN's, no vault same same
cache: the line setup prints ... without the remote cache ... with the remote cache only where the cache servers of this runner's host answer not printed
cache: what #91's step then does no join, no token: without a trusted remote cache: the job is not on the overlay..., hands PLX_TURBO_TRUSTED=local asks the host's trusted server once with the slot's token: answers, nothing more is said or handed (turbow uses it); does not answer: without a trusted remote cache: the trusted server does not answer..., hands local as the slot without Connect

A fork's pull request on a slot is not decided here: a slot carries credentials no workflow hands out (Connect, the trusted cache token), so today a fork's code on a byom repo's slot runs with them. I added no refusal; the question is with the maintainer.
The steps after setup, on a forge runner: test, build, e2e run (the build without a key; Next 16.4.6 treats an empty NEXT_SERVER_ACTIONS_ENCRYPTION_KEY as unset, per the review); no image is pushed in on_commit and on_pr.

A deploy job with no credential fails, as before, in the line that names both ways (OP_CONNECT_HOST and OP_CONNECT_TOKEN, OP_SERVICE_ACCOUNT_TOKEN).
A repo job of the workflow on_push with no credential fails the same way, with on_push publishes the repo's images and cannot run without the vault in front: its images carry the repo's one key (§ 3.8). This is my reading of "where a step cannot work without a secret, fail with a clear line".

A job with a credential on a runner without op.
core/op.ts asks op --version (without the vault's credentials). Where that works, the runner's op is used and nothing is downloaded or written. Otherwise it installs the pinned version under RUNNER_TEMP/op (never the checkout), in three directories: gnupg (the keyring, 0700), download (the zip and the key), bin (what is unzipped). In order:

  1. curl --proto =https --retry 3 the zip https://cache.agilebits.com/dist/1P/op2/pkg/v<version>/op_linux_<arch>_v<version>.zip (<arch> after the machine: amd64, arm64, arm, 386) and 1Password's key file https://downloads.1password.com/linux/keys/1password.asc.
  2. gpg --no-options --no-autostart --homedir <gnupg> --batch --import the key, before the zip is opened.
  3. unzip -qo op.zip op op.sig -d <bin>: only those two members, into a directory that holds nothing else.
  4. gpg --no-options --no-autostart ... --status-fd 1 --verify op.sig op. The signature's primary key (last field of VALIDSIG) must be 3FEF9748469ADBE15DA7CA80AC2D62742012EA22. A signature that does not verify, one by another key, or output naming none fails the job in one line and runs nothing; the vault is not read.
  5. chmod 700, then op --version must say the pinned version.

curl, unzip, gpg, mkdir, chmod and the installed op --version are started without any OP_* variable. A missing curl, unzip or gpg fails with cannot install op: <tool> is not on this runner.
--no-options makes gpg read no configuration file (a planted gpg.conf naming an agent-program was the way a zip could run code, as the review showed). --no-autostart (gpg's manual: "do not start the gpg-agent or the dirmngr if it has not yet been started and its service is required") means gpg starts no daemon; importing a public key and verifying a signature need none. With gpg 2.4.9 here it prints no gpg-agent running in this session on import, exits 0, and leaves no agent behind. I did not check the flags on the gpg of ubuntu-latest (not on this machine).

How op is verified

1Password documents the Linux manual install in "Get started with 1Password CLI" (https://developer.1password.com/docs/cli/get-started/, now served from https://www.1password.dev/cli/get-started/): the zip from cache.agilebits.com/dist/1P/op2/pkg/..., then gpg --keyserver keyserver.ubuntu.com --receive-keys 3FEF9748469ADBE15DA7CA80AC2D62742012EA22 and gpg --verify op.sig op. The page names no checksum and no provenance attestation, so the signature is the only documented verification. The same page's apt instructions fetch the key from downloads.1password.com/linux/keys/1password.asc; the fingerprint of that file is the one above, and the role actions_runners already ships it (1password-signing-key.asc). I fetch it from 1Password's site and compare the signing fingerprint with the pinned one instead of trusting the keyserver or the file. That the zip holds op.sig the page implies and does not state; I looked (below).

Where the version is, and what moves it

OP_VERSION in packages/cli-ci/src/core/op.ts is the one statement in code, 2.42.0. The environment image pins the same version in its mise.toml (aqua:1password/cli; a slot installs nothing per job). The update bot cannot look that package up (the dashboard issue of this repo says so), so a person moves the two together, and a test holds them equal. I did not change the bot's configuration.

Tested

Test first, red before code, commits in order:

  • 0bee9df tests for a job without a token: red because the job failed with the job cannot read the vault (exit 1) instead of reading nothing. The deploy and with-token tests were green at once, as guards.
  • 06cb8d6 its code.
  • 432a151 tests for a runner without op (the fakes learn --output downloads, unzip, gpg, a noOp runner): red because the first read of the vault failed with op: command not found, exit 127, where it should install. The test of the image pin was green at once, being a guard.
  • 9e4f7ce its code. ffc46f4 a comment; dd0814e merges plain-pipeline-2.

Second round, after the review (it found that the first install could run a member of the zip before verification, with the service account token in its environment):

  • f83bad7 tests: red because unzip took every member into the keyring's directory, gpg ran with its configuration and agent, curl and the installed op --version saw OP_*, a missing tool ended as spawn ... ENOENT, and the no-token line was no annotation and claimed no cache on a slot. The fake unzip now honours its arguments, and can hold a planted gnupg/gpg.conf and a ../ member. Green at once, as guards: that the primary key is the one compared (the fake prints a different signing subkey), that a verification naming no signature fails, the slot with Connect.
  • 7768ac9 code, docs and the pin's comment.

mise run test: exit 0, cli-ci 89 of 89. mise run e2e not run. Two existing tests changed in the first round: "with neither" now uses a deploy job, and the op calls counted include the --version probe.
No real download, op or vault in a unit test. Outside the tests, in a scratch directory only, I ran opOf itself against the real download with a PATH holding no op (again after the fix): it downloaded 2.42.0, gpg reported a good signature of the pinned key, op --version said 2.42.0, no gpg-agent was left; a byte appended to op gave BADSIG. No secret read.

Not tried: a real forge runner or a real fork pull request; fork pull requests on slots; the flags on the gpg and unzip of ubuntu-latest; what a hostile zip may hold beyond the planted configuration and path cases tested here; the update bot's lookup of op (it fails today); GITHUB_TOKEN of a fork reading private packages; ARM runners.

Builds on #91, merged

"Runs without the remote cache" is #91's mechanism (PLX_TURBO_TRUSTED=local, handed where the job is not on the overlay or no trusted server answers); this change adds none of its own. origin/plain-pipeline-2 at 4540eac is merged in; the conflicts were the two header renumberings of commands/setup.ts (one numbering now: 1 refuse, 2 credential or none and the install, 3 to 9 as before and #91's) and the header and the TOOLS filter of testing/job.ts (it keeps without and realCurl). What a job without a token gets is the table above, which I ran on the merged code. A fork job on a forge runner prints two lines, the warning and #91's.

Readings, for the maintainer to confirm

  1. A repo job of on_push without a credential fails (above), rather than publishing images with Next's own key.
  2. op --version failing for any reason counts as "no op", and the job installs its own.
  3. With PLX-252: without a trusted cache server, a job builds each app once and publish copies what e2e tested #91 a fork job prints two lines (the warning and without a trusted remote cache: ...), where § 8.4 says one.
  4. The key file is fetched from downloads.1password.com, authenticated by its fingerprint, not from a keyserver.
  5. The registry logins are kept for a job without a token.
  6. Under --dry-run on a runner without op, the install is narrated and not done, and the reads then fail on the missing op.
  7. The line a deploy job reads the vault in setup.ts is unreachable; it is there for the type.

What a consumer notices

A repo job on a forge runner now works with a service account token and no op: one download of about 16 MB in the step. A pull request from a fork passes setup with a warning and runs the verbs without key and remote cache. A slot with op in its image changes nothing for a job with a credential; for one without, see the table. Workflows need no change.

What the compendium owes

  • approaches/delivery.md § 8, "The vaults": a job with no credential reads nothing, and plx-ci setup installs the pinned op, verified, where the runner has none.
  • approaches/delivery.md where it says plx-ci setup hands the job both fixed tokens: only where the job has a credential.
  • approaches/delivery.md where it says the vault's CLI is in the environment image: and installed per job on the forge's runners.
  • approaches/secrets.md "every job loads what it needs from the vault": the exception for a job with no credential.
  • Whatever the maintainer decides for pull requests from forks on byom.
    I did not touch the compendium.

🤖 Generated with Claude Code

davidjalbers and others added 10 commits December 3, 2026 03:07
Red: a repo job with no token fails today with "the job cannot read the vault"
where it should read nothing, say so in one line, and go on.

Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
…vault

A repo job with no credential for the vault, as a pull request from a fork
is, says so in one line and goes on with the logins, which need none. A
deploy job and a run of on_push still fail, naming the credentials missing.

Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
Red: with a token and no op on the PATH, the first read of the vault fails
with exit 127 ("op: command not found") where the step should install the
pinned version, verify it, and read with it. core/op.ts is a stub that
installs nothing; the fakes learn the download, unzip and gpg.

Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
With a token and no op on the PATH, the step downloads the pinned version
from 1Password into RUNNER_TEMP/op, checks the signature of op against the
pinned signing key in a keyring of the job's own, checks its version, and
reads the vault with it. A runner that has op is left as it is. The pin of
the environment image is held equal to the constant by a test.

Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
…e on each kind of runner

Red: unzip extracts every member into the directory of the keyring, gpg is
started with its configuration and agent, curl and the installed op see
the vault's credentials, a missing tool ends as a bare spawn error, and the
no-token line is no annotation and claims no cache on a slot that has its
host's. Green at once, as guards: the primary key being the one compared,
a verification naming no signature, a slot with Connect.

Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
…no-token line is a warning and true on a slot

unzip takes op and op.sig by name into a directory of their own, the
keyring is made and the key imported before the zip is opened, gpg runs
with --no-options and --no-autostart, curl is https-only with retries, none
of them sees OP_*, and a missing tool is named. The pin's comment no longer
promises an update bot pull request; a person moves both values.

Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
The slot's no-token line holds also where the host's servers do not answer.

Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
davidjalbers and others added 2 commits December 3, 2026 04:07
plx-ci setup asks op --version before it installs one; the stand-in
answered every call but read with an error, so setup took the runner for
one without op and downloaded the vendor's.

Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
@davidjalbers
davidjalbers merged commit c64f5fe into plain-pipeline-2 Dec 3, 2026
1 of 2 checks passed
@davidjalbers
davidjalbers deleted the davidjalbers/plx-248-setup-on-the-forges-runners branch December 3, 2026 03:34
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