[Bug]: Local config override file name differs between the docs (`<id>-config.local.yml`) and ConfigManager (`local-config.yml`)

未關閉 適合新手
#5,083 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@gavenren 已經在處理了。

開始於 2026年10月28日。

  • #5159 來自 @gavenren —— 未關閉

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
72/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
python
領域
cli

研究方向

閱讀 src/specify_cli/extensions/__init__.py 中的 ConfigManager._get_local_config,接著將預期檔名與使用者指南、API 指南和開發指南,以及 src/specify_cli/shared_infra.py 中的 ignore 模式進行比較。使用 issue 中的重現腳本確認適用的檔名;當設定覆寫、hook 條件、Git ignore 行為,以及相關的移除或復原處理都與選定名稱一致時,即為完成。

由索引模型根據 Issue 內容生成。

描述

triage-must-have
Bug Description

The user-facing extension docs tell users to put local overrides in .specify/extensions/<id>/<id>-config.local.yml. ConfigManager._get_local_config reads .specify/extensions/<id>/local-config.yml instead (src/specify_cli/extensions/__init__.py:5350). A user who follows the guide gets no override, both in get_config() and in hook conditions such as config.x is set. The shared .specify/.gitignore only covers extensions/*/local-config.yml (src/specify_cli/shared_infra.py:33), so the documented file is also not ignored by git, although the guide says it is.

Either side could be the one to change. The code, design/extension.md:146 and shared_infra.py:33 use local-config.yml. These say <id>-config.local.yml:

  • extensions/EXTENSION-USER-GUIDE.md:351,361,377,910
  • extensions/EXTENSION-API-REFERENCE.md:565,887
  • extensions/EXTENSION-DEVELOPMENT-GUIDE.md:388

The remove, backup and rescue code also preserves *-config.local.yml (for example __init__.py:3523-3549).

Steps to Reproduce

Save this as repro.py and run uv run python -I repro.py from the repository root.

import os, tempfile
from pathlib import Path
from specify_cli.extensions import ConfigManager

proj = Path(tempfile.mkdtemp())
d = proj / ".specify/extensions/jira"
d.mkdir(parents=True)
(d / "jira-config.yml").write_text('project:\n  key: "MSATS"\n')
(d / "jira-config.local.yml").write_text('project:\n  key: "MYTEST"\n')
os.environ.pop("SPECKIT_JIRA_PROJECT_KEY", None)
print("with jira-config.local.yml: project.key =", ConfigManager(proj, "jira").get_value("project.key"))
(d / "jira-config.local.yml").rename(d / "local-config.yml")
print("with local-config.yml:      project.key =", ConfigManager(proj, "jira").get_value("project.key"))
Expected Behavior

Per extensions/EXTENSION-USER-GUIDE.md:359-383, jira-config.local.yml overrides jira-config.yml, so project.key is MYTEST. If local-config.yml is the intended name, the user guide, API reference and development guide should say so.

Actual Behavior
with jira-config.local.yml: project.key = MSATS
with local-config.yml:      project.key = MYTEST
Specify CLI Version

1.2.4.dev0 (main at 27d14e2)

AI Agent

Not applicable

Operating System

Linux 6.18 (Ubuntu container)

Python Version

Python 3.12.3

Additional Context

The docstring of ConfigManager itself (__init__.py:5267) names local-config.yml, so the code is at least consistent with itself and with the design document.

Also reproduced on macOS (Darwin 25.6, arm64) with Python 3.14.4 and uv run python -I repro.py against 27d14e2; the output matches the above.

AI Disclosure

Found and reproduced with Claude Code (model: Claude Opus 4.8), run autonomously under human supervision. The human reporter re-ran every reproduction above before filing.

主要語言
Python
星號
144k
分支
12.9k
平均合併
1 天 6 小時
30 天內合併 PR
194

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

github/spec-kit 的其他 Issue

查看 github/spec-kit 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。