-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow PRs to delete files, fix error passing #787
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the first test change is correct.
]) | ||
).toEqual({ | ||
errors: [ | ||
`Unexpected file added: oooooooooooops.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't figure out why getNotNeededPackages was complaining about added files in the first place. Maybe it was left over from when gitDiff also processed added files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still does here: https://github.com/microsoft/DefinitelyTyped-tools/pull/787/files#diff-851343706958307266e65b65ada1241e0e87962c124efbd7a501d219d724a534R67
Needed to make sure we attempt to run tests on dirs that look like they're supposed to be packages. Otherwise CI passes for old style without package.json (the original change was fixing that).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But, the test doesn't seem to show that we are adding a package here for oops
, so something may still be wrong...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may not matter since almost all additions are going to be (1) a single file to an existing types directory (2) multiple files attempting to add a new types directory. Mostly what we want to catch are incomplete cases of (2), and I don't think that's happening here in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, no, I can't find any other tests for incomplete packages. I don't even know anymore.
So generally I think that this part of the infra may be overkill:
I think this PR improves things, though doesn't remove the complexity, so it's hard to say if I've really fixed it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your summary is correct.
Especially as we switch toward naming .d.ts files things besides index.d.ts, deletes and moves are going to get a lot more common.
An effect of #761 was to make PRs fail if they ever deleted a file, no matter where. This means PRs like my PR that deletes scripts fails because deleting files is now banned, which doesn't feel right.
Also, fix a case where errors were not propagated upward, which was the root cause of the tooling hiding the error for the script PR. I think we may want to consider using a real generic result type; working with these error arrays and ensuring they're nonempty is getting a little fickle...