Applications at the repository root are not triggered by new commits

未关闭 适合新手
#7,639 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

@Daksha1611 已经在做这个了。

开始于 2026年11月14日。

  • #7640 来自 @Daksha1611 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
62/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
ci-cd

调研方向

错误位于 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:

  1. Put app.pipecd.yaml at the root of the repository and register the application.
  2. After the first deployment, push a commit that changes deployment.yaml at the root.
  3. 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:

  • piped version: master (5dc13c2b1)
  • control-plane version: 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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pipe-cd/pipecd 的其他 Issue

查看 pipe-cd/pipecd 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。