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

オープン
#180 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
993
フォーク
65
平均マージ
21時間 47分
マージ済み PR(30日)
209

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cloudflare/cf のほかの issue

cloudflare/cf の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。