fix(cli): marketplace add --overwrite removes the old marketplace before the new one resolves

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

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, typescript
領域
backend, cli

調査の方向性

Read cli/src/contexts/distribution/application/marketplace-add-use-case.ts, focusing on execute and the order of removal, resolution, validation, trust confirmation, and save. Add red-first tests for resolve failure, a null catalog, and denied trust; verify the old registry entry and installed plugin files remain intact in each case. Then run the relevant CLI tests and confirm successful overwrite still works.

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

説明

Description

aidd marketplace add --overwrite removes the existing marketplace of the same name before it fetches and validates the new source. If the fetch fails, or the source has no marketplace.json, the command errors and the previous entry is already gone.

Affected file(s)
  • next: cli/src/contexts/distribution/application/marketplace-add-use-case.ts (execute: assertNotRegistered runs before resolveMarketplace.execute; assertNotRegistered calls removeUseCase.execute with autoConfirm: true).
  • refactor/cli-target: cli/src/contexts/distribution/application/add-marketplace.ts (same order, remover.remove).
Expected behaviour

The existing marketplace is replaced only once the new one resolved and its marketplace.json was found (ideally after trust is confirmed). A failed add leaves the registry as it was.

Observed behaviour

Order in execute: remove the old entry, Marketplace.create, resolveMarketplace.execute, catalog === null check (throws InvalidPluginManifestError), ensureTrust, registry.save. Any throw after the first step, including a denied trust prompt, loses the old entry. Removal also deletes installed plugin files, so the loss is not limited to the registry line.

AI tool

All

aidd-cli version

unreleased, next

OS

Any

Additional context

Red-first test: register marketplace m from source A; run add with overwrite: true and a source whose resolve throws (and a second case where catalog is null, and a third where trust is denied). Assert the registry still lists m with source A and its installed plugin files are untouched. Fix direction: resolve and validate the new marketplace first, then remove and save.

主要言語
TypeScript
スター
481
フォーク
45
平均マージ
1日 13時間
マージ済み PR(30日)
91

環境構築

はじめの一歩

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

ai-driven-dev/framework のほかの issue

ai-driven-dev/framework の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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