@clerk/upgrade detect binaries and gitignore during scan#8324
@clerk/upgrade detect binaries and gitignore during scan#8324rofinn wants to merge 3 commits intoclerk:mainfrom
Conversation
NOTE: Since tinyglobby doesn't support gitignore out-of-the-box we're shelling out as is currently recommend in the docs. - https://superchupu.dev/tinyglobby/migration#gitignore - SuperchupuDev/tinyglobby#92 Alternatives, would be to use the `ignore` package, but this seems to work for now without adding an additional dependency. I've left this as a separate commit in case this behaviour isn't desired, but the binary handling is.
|
|
@rofinn is attempting to deploy a commit to the Clerk Production Team on Vercel. A member of the Team first needs to authorize it. |
|
NOTE: I have not created a changeset yet because I think the version bump may depend on whether the last commit (gitignore) is included. |
📝 WalkthroughWalkthroughThe changes implement binary file detection and Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
rofinn
left a comment
There was a problem hiding this comment.
Just noticed a few test cleanup items on a second review.
|
|
||
| it('skips binary files that are not covered by ignore globs', async () => { | ||
| const config = await loadConfig('nextjs', 6); | ||
| config.changes = config.changes.filter(change => change.matcher); |
There was a problem hiding this comment.
I got a bit lazy while testing. If folks want I can add a concrete config for each test to be more specific?
| config.changes = config.changes.filter(change => change.matcher); | ||
|
|
||
| const binaryPath = path.join(fixture.path, 'binary'); | ||
| fs.writeFileSync(binaryPath, Buffer.from([0x7f, 0x45, 0x4c, 0x46, 0x00])); |
There was a problem hiding this comment.
I guess this would be a stronger test if I added Buffer.from('afterSignInUrl') to it.
Description
Fixes #8323 (sorry didn't notice you prefer having issues created first)
As outlined in the issue and linked gist to reproduce the issue, this PR attempts to address 3 particular issues faced while using the
@clerk/upgradecli..gitignorefiles to reduce the scanning scope. And falls through ifgitis not available or no.gitignorefile is present.NOTES:
gitis not available (or not a repo) or if--skip-ignoreis used.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Just updated the README and the CLI help output.
Type of change