Applications at the repository root are not triggered by new commits
维护者通常 2 天内回复
评估
调研方向
错误位于 pkg/app/pipedv1/trigger/determiner.go 和 pkg/app/piped/trigger/determiner.go 中的 isTouchedByChangedFiles,该函数会在应用路径后追加斜杠,因此 . 变成 ./,永远无法匹配 deployment.yaml 这类变更路径。先阅读该函数并运行现有的触发器测试,然后为根路径添加一个用例。完成的标准是:isTouchedByChangedFiles(".", nil, nil, []string{"deployment.yaml"}) 在两个包中都返回 true,并且 onCommit.ignores 仍然会排除匹配的文件。
由索引模型根据 Issue 内容生成。
描述
What happened:
When an application config is placed at the root of the repository, the application path is .. New commits that change files in the repository do not trigger a deployment for it, unless onCommit.paths matches the changed file. The first deployment still runs because there is no previous commit to compare with.
isTouchedByChangedFiles adds a slash to the application path, so . becomes ./, and then checks whether each changed file starts with it. Git returns paths like deployment.yaml, so the check never matches. The same code is in pkg/app/pipedv1/trigger/determiner.go and pkg/app/piped/trigger/determiner.go.
What you expected to happen:
A change anywhere in the repository should trigger an application at the root, the same way a change under app/demo triggers an application in app/demo. onCommit.ignores should still apply.
How to reproduce it:
- Put
app.pipecd.yamlat the root of the repository and register the application. - After the first deployment, push a commit that changes
deployment.yamlat the root. - No new deployment is triggered.
I found this while reading the trigger code and checked it with a unit test. isTouchedByChangedFiles(".", nil, nil, []string{"deployment.yaml"}) returns false. I have not tried it on a running piped.
Environment:
pipedversion: master (5dc13c2b1)control-planeversion: not applicable- Others: affects both piped and pipedv1
I have a fix ready and will open a pull request for it.
- 主要语言
- Go
- 星标
- 1.4k
- 派生
- 391
- 平均合并
- 4 天 1 小时
- 30 天内合并 PR
- 58
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pipe-cd/pipecd 的其他 Issue
-
pipedv1 kubernetes plugins ignore trafficRouting.istio.host in K8S_TRAFFIC_ROUTING可能已有人在做 @Dhirenderchoudhary 今天认领。 未关闭
难度 2/5 半天 新手友好度 74/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
pipectl transfer restore application drops backed-up labels可能已有人在做 @bhavishyajain545 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 2 天内回复
相似的 Issue
-
needs-triage typo
难度 1/5 1 小时以内 新手友好度 88/100
llm-d-incubation/llm-d-scaling-manager#122 ·
维护者通常 1 天内回复
-
good first issue severity: low tech-debt
难度 2/5 半天 新手友好度 75/100
TMHSDigital/subenum#329 ·
维护者通常 1 天内回复
-
[Bug] Backend summarize min() / max() panics when a field has no numeric values可能已有人在做 @weng5e 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 64/100
grafana/grafana-infinity-datasource#1832 ·
维护者通常 1 天内回复
-
tech-debt
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
GillMacedo/godebugdiff#13 ·