tools: introduce git-change-exec tool - #4202
Conversation
97865b3 to
51a141e
Compare
|
No, this is not possible with what gh checks out here, so closing ... |
a9877ab to
575f3f0
Compare
hmm, seems it is possible, but I don't know what I am doing with those gh actions ... |
575f3f0 to
2dd51fe
Compare
|
Do you know how you're going to use it? Will developers use it for local runs, or will you make it part of CI? |
It is used by |
|
I am a little bit confused. Is this tool's purpose to check which directories have changed files, and thus determine where we should run Does it actually execute the $ gce ./...
pkg/a
pkg/c
pkg/qthus telling us which dirs changed? And we always can choose to ignore it and run all tests? And with it, I would run A README would help, along with some sample of what it would look like when run. |
|
Aha! I've got the idea. I like it. Good luck with the implementation =) I find it easier to write such tools in interpreted languages, but okay, let it be =) |
It does not do magic, it just looks in Let me just be lazy with the example: https://github.com/lf-edge/eve/actions/runs/10699251983/job/29660387351?pr=4202#step:3:120 :-) |
6a6c964 to
ea1bf18
Compare
| return dir | ||
| } | ||
|
|
||
| dir = filepath.Join(dir, "..") |
There was a problem hiding this comment.
I remember the case when Eden removed my home dir because it accessed something in .., and I'm afraid of such patterns now. Could you consider using git rev-parse --show-toplevel instead?
There was a problem hiding this comment.
There was a problem hiding this comment.
Doesn't git rev-parse --show-toplevel just do the same?
45077 newfstatat(AT_FDCWD, "/home/christoph/projects/eve/pkg/pillar/agentlog", {st_mode=S_IFDIR|0755, st_size=226, ...}, 0) = 0
45077 newfstatat(AT_FDCWD, "/home/christoph/projects/eve/pkg/pillar/agentlog/.git", 0x7ffe67413ec0, 0) = -1 ENOENT (No such file or directory)
45077 newfstatat(AT_FDCWD, "/home/christoph/projects/eve/pkg/pillar/agentlog/.git/HEAD", 0x7ffe67413d70, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
45077 newfstatat(AT_FDCWD, "/home/christoph/projects/eve/pkg/pillar/agentlog/HEAD", 0x7ffe67413d70, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
45077 newfstatat(AT_FDCWD, "/home/christoph/projects/eve/pkg/pillar", {st_mode=S_IFDIR|0755, st_size=1204, ...}, 0) = 0
45077 newfstatat(AT_FDCWD, "/home/christoph/projects/eve/pkg/pillar/.git", 0x7ffe67413ec0, 0) = -1 ENOENT (No such file or directory)
45077 newfstatat(AT_FDCWD, "/home/christoph/projects/eve/pkg/pillar/.git/HEAD", 0x7ffe67413d70, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
45077 newfstatat(AT_FDCWD, "/home/christoph/projects/eve/pkg/pillar/HEAD", 0x7ffe67413d70, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
45077 newfstatat(AT_FDCWD, "/home/christoph/projects/eve/pkg", {st_mode=S_IFDIR|0755, st_size=804, ...}, 0) = 0
45077 newfstatat(AT_FDCWD, "/home/christoph/projects/eve/pkg/.git", 0x7ffe67413ec0, 0) = -1 ENOENT (No such file or directory)
45077 newfstatat(AT_FDCWD, "/home/christoph/projects/eve/pkg/.git/HEAD", 0x7ffe67413d70, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
45077 newfstatat(AT_FDCWD, "/home/christoph/projects/eve/pkg/HEAD", 0x7ffe67413d70, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
45077 newfstatat(AT_FDCWD, "/home/christoph/projects/eve", {st_mode=S_IFDIR|0755, st_size=824, ...}, 0) = 0
45077 newfstatat(AT_FDCWD, "/home/christoph/projects/eve/.git", {st_mode=S_IFDIR|0755, st_size=240, ...}, 0) = 0
45077 newfstatat(AT_FDCWD, "/home/christoph/projects/eve/.git/HEAD", {st_mode=S_IFREG|0644, st_size=49, ...}, AT_SYMLINK_NOFOLLOW) = 0
I am not sure what you mean.
There was a problem hiding this comment.
I'm afraid of manually adding logic to reverse directories. If there is a tool that does it for us, I would prefer it.
There was a problem hiding this comment.
There was a problem hiding this comment.
Yay, thanks! Will take a look at the rest of the script later...
ea1bf18 to
d55a98b
Compare
d55a98b to
112ed2d
Compare
|
I didn't have time lately to work on it, so I move it into draft state. |
d6a6fec to
a481ba0
Compare
|
Some updates:
Still there are some things I have to make nicer:
|
a481ba0 to
b5ac4b0
Compare
Yes, for example you can run: This output can be imported into another tool, f.e. this way: BUT: the actions have to be written in a way so that no state is saved in the first step and will be accessed in the second step. |
b5ac4b0 to
01d4402
Compare
01d4402 to
7a8dd82
Compare
7a8dd82 to
d391765
Compare
d391765 to
637449a
Compare
also allow to use this tool directly with a path as a parameter Signed-off-by: Christoph Ostarek <christoph@zededa.com>
The option is called `ignore-words` according to https://github.com/codespell-project/codespell?tab=readme-ov-file#using-a-config-file Also add `OptionAll` as is not a misspelled `optionally` Signed-off-by: Christoph Ostarek <christoph@zededa.com>
add this to have a somehow similar interface as other parts in the repo to run the tests Signed-off-by: Christoph Ostarek <christoph@zededa.com>
This new tool detects if in your git tree changed files (compared to master branch and local-only changed files) and uses this information to run only the specified actions. Here it is used to run pillar's go-tests only if something changed there, same for this tool itself and the get-deps tool. Signed-off-by: Christoph Ostarek <christoph@zededa.com>
necessary after the recent changes Signed-off-by: Christoph Ostarek <christoph@zededa.com>
actions/checkout takes the PR head from the contributor's fork, leaving origin/master stale, fix it Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Christoph Ostarek <christoph@zededa.com>
637449a to
43a6294
Compare
This new tool detects if in your git tree changed files (compared to master branch and local-only changed files) and uses this information to run only the specified actions.
Here it is used to run pillar's go-tests only if something changed there, same for this tool itself and the get-deps tool.