Repository navigation
Fix for Cloning gitlab URL chooses GitHub repository with same name - #4362
JordanMussi wants to merge 13 commits into
Conversation
|
Hmm not sure why Travis is failing this test, it works for me and the other two CIs... desktop/app/test/unit/find-account-test.ts Lines 46 to 50 in 9931007 |
|
I'm a bit stumped by these tests... When doing it manually in the app I am getting the results which I expect but with the tests I'm getting odd results. The builds for 1138c31 gives I can't see any way that the order of the tests would impact their results so any help would be appreciated. |
|
@JordanMussi I've added some tracing to those tests - I couldn't trigger the same error on my Ubuntu VM, and I'm not sure what Linux-specific thing you might have tripped with these changes... |
|
@shiftkey I'm running the tests locally on Windows. Is there any reason there might be discrepancies caused by the order of the tests in the file? (See the builds of my previous commits to this branch) Please could you also address some of the points I raised in the first post? 😃 |
Not that I'm aware of - Mocha tests should be run in the order they're declared in the file.
This seems fine.
My gut feeling at this point is that
If you've given a full URL we'll look for an existing account associated with that host. I think the latter check is there to confirm that |
|
@JordanMussi Any idea when this will be merged? :) |
| @@ -0,0 +1,17 @@ | |||
| module.exports = function (wallaby) { | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@denitsa-cm we just need to figure out how to properly test this before merging :) As long as @shiftkey is fine with the strange problem I was having with the tests which then started passing only after adding |
I'm not, and I'm assigning myself back to this to dig into it more. The tests are great here, and I might get them reviewed and merged separately to figuring out what we're doing with this fix. |
|
Alright, I went a slightly different path with #5200 but I think that addresses all the outstanding issues here. I'm going to close this out in favour of that, but feel free to 👀 it over and add your feedback there. Thanks again @JordanMussi for the time spent here! |
Fixes #4154
I have also added some unit tests for the
findAccountForRemoteURLmethod and would like some feedback:https://gitlab.com/inkscape/inkscape.git/https://github.com/inkscape/inkscape.git) or use one provided by the desktop team?desktop/app/test/unit/find-account-test.ts
Lines 31 to 34 in 9931007
desktop/app/test/unit/find-account-test.ts
Lines 52 to 57 in 9931007
canAccessRepositoryreturns false so the account is ignored and the "anonymous" account is returned instead.Also there is a discrepancy between how an account is identified for a parsed GitHub URL (
https://github.com/inkscape/inkscape.git) and an owner/name (inkscape/inkscape).For the former
canAccessRepositoryis not called, so the first GitHub account found is returned.desktop/app/src/lib/find-account.ts
Lines 90 to 104 in 9931007
Whereas
canAccessRepositoryis called when identifying from owner/name.desktop/app/src/lib/find-account.ts
Lines 56 to 61 in 9931007
Except for those queries this is good to go 🙃