Description
Call out in the on-path-changed
documentation that git-submodules are treated as one file and a submodule's files are not in the list of changed files which on-path-changed
references.
Since git
represents submodules using a single file which points to the repository revision, providers like Github and Gitlab do not enumerate the files changed inside of a submodule in a Pull Request, only that the submodule changed and the revision change:
Similarly, the Git{hub,lab} API returns the sub directory as a file changed with no information about its contents:
This means that when using an on-path-changed
expression, we can only check if a submodule changed and now what changed inside of the submodule.
E.g. with the following repo structure
.
├── README.md
└── test-submodule
└── README.md
if we update test-submodule
to a branch which includes new-file
like so:
.
├── README.md
└── test-submodule
├── README.md
└── new-file
The following annotation will not match: pipelinesascode.tekton.dev/on-path-change: [test-submodule/new-file]
, and neither will pipelinesascode.tekton.dev/on-path-change: [test-submodule/**]
. We instead have to use pipelinesascode.tekton.dev/on-path-change: [test-submodule]
as if it is a file
This make sense when you are aware of how git handles the submodules, Without explicitly mentioning it in the docs it could be considered "undefined" behavior to a user, since the file tree differs on their machine vs in the git API. To add more confusion, using tkn-pac info globbing
misleadingly shows that the test-submodule/new-file
and test-submodule/**
annotations should match: