artifacts fork: no way to name the target repo; derived name fails the repo-name regex

Abierto
#180 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Start with the cf artifacts namespaces repos fork command and cf schema artifacts namespaces repos fork output, then compare its request shape with the Workers binding's repo.fork(name, opts). Determine whether a target name can be supported or whether the unnamed behavior and derived value need clearer handling; done means the fork succeeds predictably or the limitation and offending name are reported clearly.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

upstream

cf artifacts namespaces repos fork cannot be given a target repository name. The REST operation derives one that violates the Artifacts repo-name rule, so every fork attempt fails with a 400.

Version: cf v1.0.0-beta.10

Actual

$ cf artifacts namespaces repos fork ingress-probe --namespace spike --description "..." --default-branch-only true
┌ APIError
│ [10101] Invalid repo name: must match /^[a-zA-Z0-9][a-zA-Z0-9._-]*$/
│ 400 Bad Request · HTTP /accounts/<acct>/artifacts/namespaces/spike/repos/ingress-probe/fork

cf schema confirms there is no field to supply a target name:

$ cf schema artifacts namespaces repos fork
{
  "operationId": "artifacts_repos_fork",
  "httpMethod": "POST",
  "path": "/accounts/{account_id}/artifacts/namespaces/{namespace}/repos/{name}/fork",
  "pathParams": [ account_id, namespace, name ],
  "queryParams": [],
  "requestBodyFields": [
    { "name": "default-branch-only", "type": "boolean", "required": false },
    { "name": "description",        "type": "string",  "required": false },
    { "name": "read-only",          "type": "boolean", "required": false }
  ]
}

There is no name or target field. Passing one anyway is silently ignored rather than rejected, which makes the failure look like a server-side naming bug:

$ cf artifacts namespaces repos fork ingress-probe --namespace spike --body '{"name":"ingress-probe-fork", ...}'
┌ APIError
│ [10101] Invalid repo name: must match /^[a-zA-Z0-9][a-zA-Z0-9._-]*$/

The derived name appears to contain a / (consistent with a namespace/name-style default), which the repo-name regex forbids.

Expected

Either the REST operation accepts a target name — the Workers binding's repo.fork(name, opts) does exactly this, so the capability exists on the platform — or the CLI documents that forks are unnamed and the API error names the offending derived value instead of only restating the regex.

Impact

Fork is unusable from the CLI and REST API today, so the only working path is a deployed Worker using the binding. That is a meaningful gap: for one-repo-per-agent or one-fork-per-task patterns there is no way to predict or control the resulting repo name, and no way to look the fork up by name afterwards.

Lenguaje dominante
TypeScript
Estrellas
960
Forks
62
Merge medio
19 h 17 min
PR fusionados (30 d)
183

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cloudflare/cf

Todos los issues de cloudflare/cf

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.