Skip to content
This repository has been archived by the owner on Mar 7, 2019. It is now read-only.

Git-resolver cannot resolve the correct tag/commit hash with gitlab repo #9

Closed
huguesCarange opened this issue Apr 30, 2018 · 16 comments

Comments

@huguesCarange
Copy link

Expected Behavior

Resolve the correct tag/commit hash from the gitlab repo.

Current Behavior

Resolve master/latest instead of desired tag/commit hash.

Possible Solution

In parsePerf.js file, urlparse.hash is deleted before being used on line 35.
-Deleted at line 45

My current solution:
Save urlparse.hash to a new variable before deleting it and use it later.

Ex at line 35:
const gitCommittish = setGitCommittish(urlparse.hash != null ? urlparse.hash.slice(1) : '');
return Object.assign({ fetchSpec: urlToFetchSpec(urlparse), normalizedPref: pref }, gitCommittish);

Steps to Reproduce

pnpm install git+http://gitlab.anygitlabrepo/team/anyproject.git#anyVersionTag
OR
pnpm install git+http://gitlab.anygitlabrepo/team/anyproject.git#anyCommitHash

Context (Environment)

I do not know if it's related to my repository being private or only to gitlab/non-github repos. I did not test theses cases.

@etamponi
Copy link
Member

Thanks for reporting :) there is a bug for it in the pnpm repository too (opened by me): pnpm/pnpm#1127.

Thanks for pointing us at a possible solution too :)

@3cp
Copy link
Collaborator

3cp commented Jul 7, 2018

Could you try latest pnpm?
#12 should’ve fixed this.

@huguesCarange
Copy link
Author

Nope didn't fixed it.
My test:
pnpm install git+http://privateGitlabRepo/team/project#v0.1.19 (Not latest tag in repo)
Result:
Resolving: total 1, reused 0, downloaded 1, done
dependencies:

  • project 0.1.29 (Lastest tag in repo)

pnpm -i : 2.10.5

Thanks!

@3cp
Copy link
Collaborator

3cp commented Jul 9, 2018

@huguesCarange can u share your full url? I am not very familiar with gitlab, does it have special domain (rather than gitlab.com) for some private repo?

I suspect hosted-git-info did not recognize your url, which didn’t run the new code branch to normalize your url into ssh url. So your url was still handled by old code branch which uses the raw url.

@huguesCarange
Copy link
Author

Unfortunately, I can't share my full url. This is the best I can do:
git+http://gitlab.pnpn.net/pnpm/git-resolver#v0.1.19

Thanks for the help and feel free to ask if I could help in any ways.

@3cp
Copy link
Collaborator

3cp commented Jul 9, 2018

Sure. That looks like an on-site local gitlab server, definitely not handled by hosted-git-info. So my PR has no effect.

@huguesCarange
Copy link
Author

I just did the same test with a gitlab public repo and it worked flawlessly.
Ex : pnpm install git+https://gitlab.com/gitm8/npmpty.git#v1.1.1 (Not latest)
Resolving: total 1, reused 0, downloaded 1, done

dependencies:

  • npmpty 1.1.1 (Worked)

@huguesCarange
Copy link
Author

Yup, it's a private self-hosted/local gitlab repo.

Sorry if I didn't made that clear!

@huguesCarange
Copy link
Author

@zkochan
Do you know when you will update git-resolver from 0.3.6 to 0.3.7 in the pnpm repo?
The fix is included in 0.3.7 right?

Thanks!

@zkochan
Copy link
Member

zkochan commented Jul 16, 2018 via email

@3cp
Copy link
Collaborator

3cp commented Jul 17, 2018

@zkochan what's the command to update deep dep git-resolver from supi directory? I was trying to see the failure.

@zkochan
Copy link
Member

zkochan commented Jul 17, 2018 via email

@3cp
Copy link
Collaborator

3cp commented Jul 17, 2018

I end up with lots of (unrelated?) type error when testing supi. Tried pnpm test and pnpm run test-with-preview in supi folder, also pnpm test from the top pnpm folder.

Something like this:

src/link/index.ts:235:49 - error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'.
  Type 'number' is not assignable to type 'string'.

235         aliasesByDependencyPath[childPath].push(childAlias)

Some dep version messed up?

@zkochan
Copy link
Member

zkochan commented Jul 17, 2018

it is some issues with the latest ramda types
try pnpm m i @types/ramda@0.25.34 (the 0.25.35 has the issue)

@3cp
Copy link
Collaborator

3cp commented Jul 17, 2018

Right, I can see the errors now. But have no idea what's going on with the "unexpected store used".

From what I can see from the code of few failed test, it seems they are not related to git-resolver.

@zkochan
Copy link
Member

zkochan commented Jul 19, 2018

ok, I'll check. If they are not related, I'll fix them

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants