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時間
- マージ済み PR(30日)
- 58
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pipe-cd/pipecd のほかの issue
-
pipedv1 kubernetes plugins ignore trafficRouting.istio.host in K8S_TRAFFIC_ROUTING対応中かも @Dhirenderchoudhary が今日担当しました。 オープン
難易度 2/5 半日 初心者へのやさしさ 74/100
pipe-cd/pipecd#7626 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
pipectl transfer restore application drops backed-up labels対応中かも @bhavishyajain545 が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
pipe-cd/pipecd#7622 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
docker-compose: postgres healthcheck should probe TCP (pg_isready -h localhost)対応中かも @zezo-mohamed22 が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
OneBusAway/watchdog#305 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
self-care self-care:agent-discoverability
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
githubnext/gh-cao#20928 ·
メンテナーはふだん 1 日以内に返信
-
automation documentation
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
SocialGouv/iterion#3287 ·
メンテナーはふだん 1 日以内に返信