TestRunCommandHelper_RejectsPathEscapingRoot/absolute_path fails on Windows
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
阅读 internal/tools/tools_test.go 中的 TestRunCommandHelper_RejectsPathEscapingRoot,并追踪 run_command 如何通过 Go 的 filepath.IsAbs 验证其 path 参数。决定应如何处理 Windows 根路径,然后在 Windows 和另一个平台上运行该测试。完成标准是该测试在各个平台上的预期一致且经过明确设计,并且通过。
由索引模型根据 Issue 内容生成。
描述
TestRunCommandHelper_RejectsPathEscapingRoot/absolute_path fails on Windows.
What happens
The test passes "/etc" as the path argument to run_command and expects an error result before any confirm prompt. On Windows, /etc is not an absolute path to filepath.IsAbs, so the path is not rejected there. The command reaches the interactive y/n confirm instead, and the test gets a different result.
The other three cases in the same test (../outside, a/../../etc, sub/../../secrets) pass on Windows.
Where this showed up
- Seen on Windows in #21 and #23 (each PR's test run). Both PR authors noted that the same failure happens on the base branch (
1bff3dfin #23). - The test is in
internal/tools/tools_test.goatTestRunCommandHelper_RejectsPathEscapingRoot.
Suggested direction
Decide what "absolute" means for path arguments on Windows. Either treat a leading / or \ as rooted when checking path (so /etc is rejected on every platform), or change the test to use a Windows-absolute path such as C:\Windows on Windows only. The first keeps one expectation across platforms.
I have not run this on the current main (335144d); the report above is from the PR runs.
- 主要语言
- Go
- 星标
- 1
- 派生
- 2
- 平均合并
- 16 小时 20 分钟
- 30 天内合并 PR
- 13
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Edwin-metcalf/MetCode 的其他 Issue
-
documentation enhancement help wanted
难度 2/5 1-3 小时 新手友好度 62/100
Edwin-metcalf/MetCode#19 ·
维护者通常 1 天内回复
-
testing
难度 2/5 1-3 小时 新手友好度 88/100
Edwin-metcalf/MetCode#9 ·
维护者通常 1 天内回复
-
Add a Makefile未关闭enhancement good first issue help wanted
难度 2/5 1-3 小时 新手友好度 76/100
Edwin-metcalf/MetCode#8 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 84/100
Edwin-metcalf/MetCode#7 ·
维护者通常 1 天内回复
-
security
难度 3/5 1-2 天 新手友好度 35/100
Edwin-metcalf/MetCode#17 ·
维护者通常 1 天内回复
查看 Edwin-metcalf/MetCode 的全部 Issue
相似的 Issue
-
automation models
难度 1/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 91/100
维护者通常 1 天内回复
-
confirmed enhancement go
难度 2/5 1-3 小时 新手友好度 78/100
DennisVlaanderen/aerendil#154 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
crossplane-contrib/provider-mongodbatlas#236 ·
维护者通常 1 天内回复
-
Generated README and SKILL omit HTTP-transport security settings and what local data the CLI keeps未关闭
难度 2/5 1-3 小时 新手友好度 82/100
mvanhorn/cli-printing-press#5181 ·
维护者通常 1 天内回复