paularmstrong/onerepo

Workspace is not included as an affected workspace if only change is a file deletion

Opened this issue · 0 comments

What version of oneRepo are you using?

1.1.0

Environment info

System:
    OS: macOS 14.4.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 60.38 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.19.1 - /usr/local/opt/node@18/bin/node
    Yarn: 4.0.2 - /usr/local/opt/node@18/bin/yarn
    npm: 10.2.4 - /usr/local/opt/node@18/bin/npm

Command

getWorkspaces()

What did you expect to happen?

Deleting a file under src/pages, staging the change, and then calling getWorkspaces() from a custom command handler with a builder that uses both withWorkspaces and withAffected should include that workspace that had the file deleted in the returned getWorkspaces() call.

What actually happened?

The workspace is not returned as an affected workspace. Running the debug logs, it does pick up the file change, but not the deletion as a modification.

DBG Running command:
 │ DBG {
 │ DBG   "name": "Checking for changes",
 │ DBG   "cmd": "git",
 │ DBG   "args": [
 │ DBG     "status",
 │ DBG     "-z"
 │ DBG   ]
 │ DBG }
 │ DBG /Users/jeffzhong/Documents/Development/frontend
 │ LOG D  apps/marketing/src/pages/sweeps.astro
 │ LOG Running: Getting modified files
 │ DBG Running command:
 │ DBG {
 │ DBG   "name": "Getting modified files",
 │ DBG   "cmd": "git",
 │ DBG   "args": [
 │ DBG     "diff",
 │ DBG     "--name-only",
 │ DBG     "-z",
 │ DBG     "--diff-filter",
 │ DBG     "ACMR",
 │ DBG     "b2edeecf338e5da99e8ee1c64d3dece7cb2afd51"
 │ DBG   ]
 │ DBG }

Participation

  • I am willing to submit a pull request for this issue.