kit icon indicating copy to clipboard operation
kit copied to clipboard

BC-break: working directory prepended twice to `watch` directories

Open MasonM opened this issue 11 months ago • 1 comments

v0.1.28 (specifically, https://github.com/kitproj/kit/commit/0c288100d7e6da2715de3e140a76f37910ca1465) changed the watch attribute so the workingDir is automatically prepended to each file. I think that change makes sense, but unfortunately it's backwards-incompatible, since it means the workingDir will be prepended twice if you were relying on the previous behavior. Here's a minimal reproduction example (adapted from https://github.com/argoproj/argo-workflows/blob/main/tasks.yaml):

apiVersion: kit/v1
kind: Tasks
metadata:
  name: argo-workflows
spec:
  tasks:
    - name: ui-deps
      command: yarn install
      workingDir: ui
      watch: ui/package.json ui/yarn.lock

In v0.1.27, this worked:

$ kit -v
v0.1.27

$ kit ui-deps

isCI=false
noWatch=false
[ui-deps] starting process "yarn install"
[ui-deps] waiting for process 143744 pgid 143744 ("yarn install")
[ui-deps]  yarn install v1.22.22
[ui-deps]  [1/5] Validating package.json...
[ui-deps]  [2/5] Resolving packages...
[ui-deps]  success Already up-to-date.
[ui-deps]  Done in 0.20s.
[ui-deps] process exited 143744: <nil>
[ui-deps] context cancelled, stopping process
[ui-deps] terminating process 143744
[ui-deps] waiting 3s before killing 143744

In v0.1.72, you get an error:

 $ ~/go/bin/kit -v ui-deps
v0.1.72

 $ ~/go/bin/kit ui-deps
no such file or directory

Also, it seems v0.1.46 changed the error reporting so it's less useful, because you used to get more detailed error messages for missing files, e.g.

$ ./kit -v && ./kit ui-deps
v0.1.45

[ui-deps] (running) starting process
stat ui/ui2/package.json: no such file or directory

MasonM avatar Jan 23 '25 05:01 MasonM

FYI: For Argo Workfows, this was fixed in https://github.com/argoproj/argo-workflows/pull/14105. I'm not sure if it's worth documenting this in the README.md, so feel free to close this.

MasonM avatar Feb 09 '25 17:02 MasonM