Skip to content
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

Wrong URL to VSTS work item when using hash work item id in commit #372

Closed
Episodex opened this Issue May 17, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@Episodex
Copy link

Episodex commented May 17, 2018

I'm using work items ids as hashes in commit to automatically link commits to work items in VSTS. For example commit message: initial commit #101 will link this commit to work item number 101 in VSTS. GitLens will correctly parse this hash and will make it clickable in the commit details popup. But it goes to wrong url. The url GitLens redirects to is:

https://example.visualstudio.com/_git/MyProject/_workitems/edit/101

which gives 404, as the correct url is:

https://example.visualstudio.com/MyProject/_workitems/edit/101 (notice _git removed).

I couldn't find any way to configure base address for work items in GitLens config. Is there something wrong with my VSTS configuration or is it some kind of a bug in the extension?

@eamodio

This comment has been minimized.

Copy link
Owner

eamodio commented May 17, 2018

@Episodex in your .git/config file what does the remote url have the _git part in it? And do the other GitLens remote commands work? e.g. Open File in Remote, Open Commit in Remote, etc?

@Episodex

This comment has been minimized.

Copy link
Author

Episodex commented May 17, 2018

@eamodio Yes, remote url has _git in it. The line is:

url = https://example.visualstudio.com/_git/MyProject

Open File in Remote works. Open Commit also. It's only Open Work Item that doesn't work because on VSTS work items urls are not under _git folder. I don't know if this is true for all VSTS repos or my configuration is unusual.

@eamodio

This comment has been minimized.

Copy link
Owner

eamodio commented May 17, 2018

Honestly I don't have enough (read: much at all) experience with VSTS, but I'll look for _git in the url and strip it out. Thanks for the info!

@eamodio eamodio added this to the Soon™ milestone May 17, 2018

@eamodio eamodio self-assigned this May 17, 2018

@eamodio

This comment has been minimized.

Copy link
Owner

eamodio commented May 17, 2018

@Episodex can you try this private build and see if it resolves the issue for you:
gitlens-8.3.0.vsix.zip

To install it, remove the .zip from the filename (needed that to make GitHub attach it), and then in the Extensions view click the ... menu and choose Install from VSIX...

Thanks!

@Episodex

This comment has been minimized.

Copy link
Author

Episodex commented May 17, 2018

Yes! It's perfect now. Thank you for so fast fix :). I just hope this change doesn't break anything for other people. But it looks like VSTS does it this way, so it should rather fix the issue for everyone.

Thanks again!

@eamodio

This comment has been minimized.

Copy link
Owner

eamodio commented May 17, 2018

No problem! Yeah, hopefully this will work for everyone :)
I'll get this into the next patch release, so probably in the next day or two.

@eamodio eamodio closed this in dafa74d May 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.