Open lukasschwab opened 1 month ago
If I delete the root
OWNERS
file
Red herring: I encounter the same error if I delete a non-root OWNERS
files as well.
Adding the --verbose
flag doesn't change the output — just the one error message.
Ah, the issue is pretty straightforward: if you delete an OWNERS
file without staging the deletion, it remains in the git ls-files
results returned by allow_git_files
: https://github.com/andrewring/github-distributed-owners/blob/b700b84d8195b31865fb9293686c19059fa0e2d6/src/allow_filter.rs#L39-L60
Staging the file deletions with git add
resolves the errors I observed:
$ rm OWNERS
$ github-distributed-owners --output-file .github/CODEOWNERS
Error: No such file or directory (os error 2)
$ git add OWNERS
$ github-distributed-owners --output-file .github/CODEOWNERS # Succeeds
Consider adding a check for existence before parsing? Didn't find an obvious solution for excluding unstaged deletions from git ls-files
results.
Edit: gave this a shot myself. The issue is actually upstream of file-parsing: conversion to canonical paths in AllowList::from
.
Hello — encountering some strange behavior!
I have a private project with an empty
OWNERS
file at the project root and non-emptyOWNERS
files in various subdirectories. Usually this works fine.If I delete the root
OWNERS
file, this tool fails with an opaque error message:Error: No such file or directory (os error 2)
Is there some OWNERS file cacheing going on under the hood, maybe?
Ty for any help!