-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[Contrib] Checkout a PR #6021
[Contrib] Checkout a PR #6021
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6021 +/- ##
=========================================
- Coverage 38.82% 38.8% -0.02%
=========================================
Files 355 355
Lines 50253 50253
=========================================
- Hits 19510 19502 -8
- Misses 27913 27922 +9
+ Partials 2830 2829 -1
Continue to review full report at Codecov.
|
@sapk do you think you can fix the issues you mentioned? |
@zeripath Since it is mostly to ease validating UI PR and have some data to view, I didn't take time on that part. I think it is related to fixtures but can't find exactly why. |
@zeripath I think fixing fixtures should be out of scope for this PR |
I was meaning about keeping the user logged in, but if it's too hard to fix then we can ignore it as it's only contrib |
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 couldn't for the life of me figure out how to get it to retain auth, but the rest of these nits just came about as I used the contrib. I don't think any of my nits are blocking though, so I'll just leave them as comments.
It seems to work well enough otherwise. 😄
I will say this makes checking out PRs incredibly easy!
After testing this again with latest changes, now it seems to be complaining about unstaged changes, even though I have a clean working tree. Did you run into this at all? EDIT: After changing the checkout method to err = tree.Checkout(&git.CheckoutOptions{
Branch: plumbing.ReferenceName(branch),
Force: true,
}) it worked...not sure if an issue with my setup or if it is needed for some reason. It shouldn't need to force the reset, but perhaps something else in the code is causing a "dirty" working tree before checkout? |
Would be nice to add shortcut to makefile for this, something like |
@jolheiser I did run it but it seems to not really create the branch at checkout but only checkouting the ref. |
@jolheiser did you use the command on windows ? I will debug more to find why. |
I find the mistake for the linux but still have the error on windows. The current solution is to use @lafriks To have a make target like that we should had some hacky code like :
Or we could also use format like
|
I had been testing on Windows at the time, yes. Good to know it's resolved on Linux, as that's where I will probably be doing most of my dev work going forward. The only issue I can think of is if As for the Makefile, personally I think the second option looks cleaner, and I like the idea of not making the Makefile any messier. |
I'm ok with second option for makefile |
Could be impoved, but it seems to work.
For example, to check the PR #6007 simply do :
go run contrib/pr/checkout.go 6007
OR
make pr PR=6007
This will checkout PR and start with integration tests fixtures loaded.
There still seems to have problem with auth after login the user is not kept logged (and some repo are missing but that normal)