diff --git a/.agent/rules/issue_management.md b/.agent/rules/issue_management.md index e46aaa3..bac62fc 100644 --- a/.agent/rules/issue_management.md +++ b/.agent/rules/issue_management.md @@ -11,7 +11,7 @@ - **同期方向**: 原則として上流の Issue トラッカーが正(Source of Truth)です。 - **自動同期**: `node tools/scripts/sync_issues.mjs` を実行して、リモートの最新状態を `docs/issues/` に反映、またはローカルの新規 Issue をリモートに作成します。 - **Git追跡除外**: `docs/issues/` は `.gitignore` により Git 追跡から除外されています。 -- **Issue 編集と 404**: GitBucket の多くのバージョンでは、Issue 本体の PATCH(編集)API が未実装で 404 になります。同期スクリプトは 404 時に **Create an issue comment** API で本文をコメントとして投稿するフォールバックを行うため、編集内容は Issue のコメントとしてリモートに残ります。 +- **Issue 編集と 404**: 公式 GitBucket では、Issue 本体の PATCH(編集)API は全バージョンで未実装のため 404 になります。同期スクリプトは 404 時に **Create an issue comment** API で本文をコメントとして投稿するフォールバックを行うため、編集内容は Issue のコメントとしてリモートに残ります。 ### 2. 記述規約 @@ -40,6 +40,7 @@ - **Direction**: As a rule, the upstream issue tracker is the Source of Truth. - **Auto-sync**: Run `node tools/scripts/sync_issues.mjs` to reflect the latest remote state in `docs/issues/` or create new local issues on the remote. - **Git Ignore**: `docs/issues/` is excluded from Git tracking via `.gitignore`. +- **Issue edit and 404**: Official GitBucket does not implement the PATCH (edit) API for issues in any version, so it returns 404. The sync script falls back to posting the body as a comment via **Create an issue comment** API, so the edited content remains on the remote as an issue comment. ### 2. Writing Conventions diff --git a/tools/scripts/sync_issues.mjs b/tools/scripts/sync_issues.mjs index a01c93f..4310165 100644 --- a/tools/scripts/sync_issues.mjs +++ b/tools/scripts/sync_issues.mjs @@ -87,7 +87,7 @@ return await apiCall(`${API_BASE}?state=all`); } -// GitBucket の多くのバージョンでは Issue の PATCH(編集)が未実装のため 404 になる。 +// 公式 GitBucket では Issue の PATCH(編集)API は全バージョンで未実装のため 404 になる。 // 代替: Issue にコメントを投稿する API(Create an issue comment)は対応している。 const COMMENTS_BASE = "https://gitbucket.tmworks.club/api/v3/repos/dtmoyaji/TelosDB/issues"; @@ -111,7 +111,7 @@ } catch (err) { if (err.message.includes('404')) { const htmlUrl = `https://gitbucket.tmworks.club/dtmoyaji/TelosDB/issues/${number}`; - console.warn(`\n[Info] GitBucket API (PATCH) returned 404. Issue edit may not be supported in your version.`); + console.warn(`\n[Info] GitBucket API (PATCH) returned 404. Issue edit is not implemented in official GitBucket.`); console.warn(`Posting current body as a comment instead...`); const posted = await postIssueComment(number, body); if (posted) {