Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
All notable changes. Format: [Keep a Changelog](https://keepachangelog.com/); versioning: SemVer.

## [Unreleased]
### Fixed
- `new-project.sh`: 坑6 升级地雷——Status 选项已一致时跳过 `updateProjectV2Field` 重交(实测重交会清空全部条目已选值,升级有数据的仓库必踩;沙盒复现验证)
### Added
- `new-project.sh` 注入 AGENTS.md 小节(Codex 等读 AGENTS.md 的工具入口;与 CLAUDE.md 共用 `merge_section` 小节级幂等合并);`install.sh` 建兼容软链 `~/devledger`;模板路径统一为标准安装路径 `~/.agents/skills/devledger`(他人机器引用不再断裂)
### Docs
Expand Down
21 changes: 14 additions & 7 deletions scripts/new-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,20 @@ ALL_FIELDS=$(gql "query { node(id: \"${PJ_ID}\") { ... on ProjectV2 { fields(fir
STATUS_ID=$(jq -r '.[] | select(.name == "Status") | .id' <<<"${ALL_FIELDS}")
TITLE_ID=$(jq -r '.[] | select(.name == "Title") | .id' <<<"${ALL_FIELDS}")
ASSIGNEE_ID=$(jq -r '.[] | select(.name == "Assignees") | .id' <<<"${ALL_FIELDS}")
gql "mutation { updateProjectV2Field(input: {fieldId: \"${STATUS_ID}\", singleSelectOptions: [
{name: \"待办\", color: GRAY, description: \"\"},
{name: \"开发中\", color: YELLOW, description: \"\"},
{name: \"已完成\", color: GREEN, description: \"\"}
]}) { projectV2Field { ... on ProjectV2SingleSelectField { options { name } } } } }" >/dev/null
say " Status=${STATUS_ID} 选项: 待办/开发中/已完成"
sleep "${PACE}"
# 坑6:singleSelectOptions 重交会清空全部条目已选值——选项已一致时必须跳过 mutation(读回比对)
CURRENT_OPTS=$(gql "query { node(id: \"${STATUS_ID}\") { ... on ProjectV2SingleSelectField { options { name } } } }" \
--jq '[.data.node.options[].name] | join(",")')
if [ "${CURRENT_OPTS}" = "待办,开发中,已完成" ]; then
say " Status 选项已是中文,跳过(坑6:重交会清空条目已选值)"
else
gql "mutation { updateProjectV2Field(input: {fieldId: \"${STATUS_ID}\", singleSelectOptions: [
{name: \"待办\", color: GRAY, description: \"\"},
{name: \"开发中\", color: YELLOW, description: \"\"},
{name: \"已完成\", color: GREEN, description: \"\"}
]}) { projectV2Field { ... on ProjectV2SingleSelectField { options { name } } } } }" >/dev/null
say " Status=${STATUS_ID} 选项: 待办/开发中/已完成"
sleep "${PACE}"
fi

# ---------- 4. View 1 配可见列(API 建的字段不会自动进视图) ----------
say "配置 View 1 可见列"
Expand Down
5 changes: 5 additions & 0 deletions tests/test_rollout_readiness.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ def test_example_ledger_has_reqperson(self):
def test_export_no_dead_code(self):
"""export 中不留 no-op 替换死代码"""
self.assertNotIn('"query($cursor: String)", "query($cursor: String)"', EXPORT)

def test_status_options_skip_when_identical(self):
"""坑6:Status 选项重交会清空全部条目已选值——已一致必须跳过 mutation(读回比对)"""
self.assertIn("已是中文", NP)
self.assertRegex(NP, r"CURRENT_OPTS=\$\(")
Loading