Repository navigation
Conversation
Regenerate the schema from argos-ci/argos#2747, which is not deployed yet: project tokens (`ProjectToken`, `CreatedProjectToken`, `ProjectTokenPermission`), their endpoints on `/projects/{owner}/{project}/tokens` and `/accounts/{accountSlug}/project-tokens`, and the optional `project` the CI endpoints take to pick one of a token's projects. The rest of the diff is what production already serves and the schema had not caught up with. Refs ARG-519 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A project token can now be linked to several projects. Such a token does not identify a project on its own, so Argos rejects it on the CI endpoints unless the request names one. When `ARGOS_PROJECT` (or the `project` option) is set, send it as `project` to `GET /project`, `POST /builds`, `POST /builds/finalize`, `POST /baseline` and `POST /deployments`. When it is not, send nothing, so a token linked to a single project behaves exactly as before. `POST /media` already took it. - `finalize` and `deploy` take a `project` parameter, like `upload`. - `argos finalize`, `skip`, `deploy` and `baseline download` take `--project`. - `@argos-ci/gitlab` reads `ARGOS_PROJECT`. Setting `ARGOS_PROJECT` to a project the token is not linked to now fails, where the SDK used to ignore it outside tokenless authentication. Needs argos-ci/argos#2747 deployed: until then the API does not know `project` on these endpoints. Refs ARG-519 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`argos project token list|create|revoke` manage a project's tokens on
`/projects/{owner}/{project}/tokens`, so CI tokens can be rotated from
the terminal: create the replacement, update the CI secret, revoke the
old one.
`argos account project-token list|create|revoke` do the same on
`/accounts/{accountSlug}/project-tokens`, the only place a token linked
to several projects can be created (`--projects web,docs`).
`create` takes `--name`, `--permissions` (comma-separated, all of them
by default) and `--expire-at <iso>` or `--expires-in <days>` (never, by
default), and prints the token: Argos returns it once. Permissions and
dates are checked before the request, and dates are sent in the UTC ISO
format the API takes.
The argos-cli and argos-upload skills cover tokens linked to several
projects, missing permissions and the rotation flow.
Needs argos-ci/argos#2747 deployed: the endpoints answer 404 until then.
Refs ARG-519
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
gregberge
added a commit
to argos-ci/docs
that referenced
this pull request
Nov 5, 2026
argos-ci/argos-javascript#411 adds `argos project token` and `argos account project-token` (list, create, revoke), and lets `finalize`, `skip`, `deploy` and `baseline download` take `--project` for a token linked to several projects. - CLI reference: add both command groups, with their defaults (every permission, no expiration) and the roles they need; drop "baseline download has no --project flag"; say what --project does for a multi-project token. - Project tokens: mention the CLI next to the API, and that ARGOS_PROJECT naming another project fails with a 401 for a single-project token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mands - `--project` / `ARGOS_PROJECT` is resolved by one `resolveProjectPath` in `lib/target.ts`, now also used by `baseline download`, which checks the `owner/project` format before calling the API. - `toPositiveInteger` and `toIsoOrFail` move to `options.ts`, shared by `--limit`, `--pr`, `analytics --from/--to` and the token expiration flags. - `--permissions` and `--projects` are variadic options, like `upload --files`: commander checks permissions against their choices, so the hand-written list parsers go. - The token body type is inferred against the generated schema, and the conflict between `--expire-at` and `--expires-in` is declared once. - Core tests record `POST /builds` and `POST /builds/finalize` bodies in the default mock handlers instead of copying them per test. Refs ARG-519 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Needs argos-ci/argos#2747 deployed before release. Until then the token commands answer 404. The
projectfield is harmless on today's API, which strips unknown fields, but it does nothing.Description
argos-ci/argos#2747 replaces the single
projects.tokenwith project tokens. A token can be linked to several projects, carries permissions and can expire. This PR makes the SDK and the CLI work with them.Name the project on the CI endpoints
A token linked to several projects does not identify a project by itself, so the API answers 400 unless the request names one. When
ARGOS_PROJECT(or theprojectoption) is set,@argos-ci/corenow sends it asprojectto:GET /project(query)POST /builds,POST /builds/finalize,POST /baseline,POST /deployments(body)POST /mediaalready took it. Whenprojectis unset, nothing is sent, so single-project tokens behave exactly as today.finalize()anddeploy()gain aprojectparameter, likeupload().skip()accepts one too.argos finalize,skip,deployandbaseline downloadtake--project.@argos-ci/gitlabreadsARGOS_PROJECTfor itsGET /project.Behaviour change: a token linked to one project used to ignore an
ARGOS_PROJECTthat named some other project. Now the API rejects it with a 401 (This project token does not have access to the project "…").Rotate tokens from the CLI
projectcommands use/projects/{owner}/{project}/tokens. Theaccountcommands use/accounts/{accountSlug}/project-tokens, the only endpoint that can create a token linked to several projects.createprints the token, since the API returns it only once. With--json, the value is intoken.--permissionsand--projectstake space-separated values, likeupload --files. If--permissionsis omitted, the API grants every permission. Commander rejects unknown permissions before the request is sent.--expire-atand--expires-incan't be used together. The date must be in the future, and it is sent as UTC ISO, the only formatz.iso.datetime()accepts.revokereturns{ revoked, tokenId }, likecontributor remove. Token names go throughsanitizeTerminalText.API client
packages/api-client/src/schema.tsis regenerated from the #2747 branch withpnpm --filter @argos/backend generate-openapi. Most of the diff is drift that production already serves (capture,Agent,awaitingReviewStatus, analyticsstorybook…). I checked this by diffing production'sopenapi.yamlagainst the PR spec: they differ only in the token changes.Skills
argos-cliandargos-uploadnow cover tokens linked to several projects, the 403 for a missing permission, and the rotation flow, which pipescreate --json | jq -r .token | gh secret set ARGOS_TOKENso the value is never echoed.No changeset files: Lerna versions from the conventional commits.
Tests
@argos-ci/core:upload,skip,finalizeanddeploysendprojectwhen it is passed or set inARGOS_PROJECT, and send no field or query param when it is not. The upload test also covers the/baselinelookup.@argos-ci/cli: unit tests for expiration handling, the request body and the token formatters.finalize,skip,deployandbaseline downloadwith and without--project/ARGOS_PROJECT.Follow-ups
argos logindoes not request theaccount:adminOAuth scope. The account endpoints require it, soargos account project-token *(like the existingaccount member|invite|domaincommands) works only with a personal access token, not with anargos loginsession.baseline downloadhas no--projectflag. It now has one, so the CLI reference needs a follow-up there.Refs ARG-519
🤖 Generated with Claude Code