wbtiger
7d706f4e4c
Merge pull request #406 : fix(api): 修复 Windows Git Bash 下 API 路径被 MSYS2 污染导致 404
...
# Conflicts:
# cmd/api/api.go
2026-07-14 21:57:33 +08:00
chroe
bf9ecc4ba2
docs(api): add MSYS2 path fix doc; extract restoreAPIPath for testability
...
- 新增命令帮助文档 doc/changes/api-msys2-path.md(问题/根因/修复/影响/测试)。
- 将 runAPI 内联的路径还原逻辑抽成纯函数 restoreAPIPath,便于单元测试;
并修正一个边界缺陷:路径含多个已知前缀时(如 /api/v1/users)改为取
最早出现的位置,避免误截到 /v1/。
- 新增表驱动 TestRestoreAPIPath 覆盖:正常路径不变、v1/v2/api 污染还原、
无已知前缀保留、空路径。
2026-07-09 22:27:52 +08:00
luwanzhou
81d30d6741
fix(api): resolve :owner/:repo and --var placeholders in single calls
...
gitlink-cli api <METHOD> <PATH> 单次调用此前直接发送原始路径,不替换
REST 风格的 :owner/:repo 占位符——导致该命令自身的 Example
(api POST /:owner/:repo/issues)以及依赖该写法的 Skill/文档无法使用。
- 新增 resolveAPIPath:先按 --var 渲染 {{var}} 模板(复用批处理模板引擎),
再用 context.ResolveOwnerRepo(--owner/--repo → git remote,与所有 shortcut
一致)替换 :owner/:repo,最后补全前导 /。
- :owner/:repo 正则用 \b 边界避免误伤 :owner_id;ReplaceAllLiteralString
避免 owner/repo 中的 $ 被当作正则替换引用。
- 不含占位符且无 --var 的调用行为不变。
- 更新命令 Example;新增单元测试(占位符解析、单次 --var 渲染、缺失变量报错)。
修复 Issue: api 命令单次调用不替换 :owner/:repo 占位符。
2026-06-15 12:36:58 +08:00
Mengz
35e50a1828
feat: 新增 Raw API 批处理执行器
2026-06-06 11:55:20 +08:00
wbtiger
0170b5b063
test: add comprehensive test coverage across all packages (88.5% → 90.3%)
...
Add 18 new test files covering formatter, envelope, config, auth,
client, context, register, and all shortcut group packages.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-31 15:41:54 +08:00
wbtiger
898b7f59d1
feat: add milestone, compare, pr reopen shortcuts and api enhancements ( #45 )
...
- milestone shortcuts: list, create, view, update, delete, close, reopen
- compare shortcuts: view, files (compare branches/tags/commits)
- pr +reopen: reopen closed pull requests
- api: add --body-file and --body-stdin for reading JSON from file/stdin
- comprehensive tests for all new shortcuts
Co-authored-by: wangyue111 <wangyue111>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 00:44:39 +08:00