Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Does this work with onpremise Git server such as Atlassian Stash ? #39

Closed
donnib opened this issue Apr 25, 2014 · 9 comments
Closed

Does this work with onpremise Git server such as Atlassian Stash ? #39

donnib opened this issue Apr 25, 2014 · 9 comments
Labels

Comments

@donnib
Copy link

donnib commented Apr 25, 2014

Does this work with onpremise Git server such as Atalssian Stash ?

@ctaggart ctaggart changed the title Does this work with onpremise Git server such as Atalssian Stash ? Does this work with onpremise Git server such as Atlassian Stash ? Apr 25, 2014
@ctaggart
Copy link
Owner

If the on-premise Git servers exposes a raw URL and has compatible authentication, then it should. It would be worth trying out. A quick search shows that it does expose a raw url:

https://jira.atlassian.com/browse/STASH-3082
http://stash_server/projects/TEST/repos/test/browse/images/test.jpg?at=8ae6d97b5e8186cfbb0f514de01e869113b1cb96&raw

So in build.fsx, you would create the srcsrv with something like:

proj.CreateSrcSrv "http://stash_server/projects/TEST/repos/test/browse/%var2%?at={0}&raw" repo.Revision (repo.Paths files)

@donnib
Copy link
Author

donnib commented Apr 30, 2014

@ctaggart thank you for your quick response, we will try this out and let you know how it goes but i have some basic questions about SourceLink in general :

  • How does SourceLink know about the specific SHA of the Sourcecode file so that when one makes a new NuGet pack with a different source code SHA file it points to that ? I guess what i am looking for is that when i debug version 1 of the NuGet pack i get the source code for version one and not latest code which doesn't make sense.
  • Do i understand correct that whenever i will try to to debug a file which has this information somebody (i don't know who) will get the file from SCM ? Will this happen on the fly when debugging in VS ?
  • Regarding authentication, STASH authenticates thru CROWD which is also a Atlassian product and this conencts to LDAP so the user authenticates with domain username and password (like the one they use when they log onto their windows machine), do you think this will be compatible ?

@ctaggart
Copy link
Owner

SourceLink is just a library that helps automate source indexing of pdb files. Source indexing is something that the Microsoft debuggers already support. I recommend including the pdb files with the dll files in the NuGet packages. pdb files include the md5 checksums for the source files. The source index is just a map of how to get the source files used. The debuggers, including Visual Studio, will download the source file on the fly when debugging. The debuggers support several ways to authenticate. I recommend simply trying it out.

@donnib
Copy link
Author

donnib commented May 1, 2014

thanks for the update.

We have figured out that we can't use your NuGet package because it depends on F Sharp and MSbuild where both cann't be referenced for the projects we use which is Windows Phone 8 and some projects for Xamarin for iOS and Android so we have to make our own changes to PDB and put the GIT info in there. We just don't know how to solve the Authentication problem like how do you make a command that access the Git repo thru an URL and get the authentication details from the user which has to end up in the PDB file, any ideas ? How did you solve this in your solution ?

@ctaggart
Copy link
Owner

ctaggart commented May 1, 2014

Yes, SourceLink.Fake uses FAKE, the F# Make build system. It does not add any references to your project. Mono doesn't use pdb files. Just create a URL and Windows debuggers support various authentication types. My blog has a SourceLink label. Check out the first post.

@donnib
Copy link
Author

donnib commented May 1, 2014

Thanks,
Not sure what you mean about mono not having PDB files. We have them in Xamarin. And it's in these PDB files we are trying to retrieve the .cs file which corresponds to the PDB file.
What i have got to work is to run a powershell command getting the .cs file from our Git server (which can provide source files in raw format) and then use this command in the datastream that pdbstr.exe used to put in the PDB file. At the moment i have not solved the authentication issue. I have just made the repo internally read-only. I don't think the debugger will ask for password /username when i run a powershell command so when you say URL do you actually put an URL in the data stream in the variable SRCSRVTRG ?
We followed this article : http://www.codeproject.com/Articles/115125/Source-Indexing-and-Symbol-Servers-A-Guide-to-Easi

@ctaggart
Copy link
Owner

ctaggart commented May 1, 2014

SourceLink builds on the source indexing HTTP support. srcsrv.dll, just like symsrv.dll can obtain the "source using the logon information provided by the operating system." It "supports HTTPS sites protected by smartcards, certificates, and regular logins and passwords." Using SymSrv

I recommend using the more secure HTTP support than running commands like powershell.

@pauldotknopf
Copy link

Atlassian Stash doesn't support raw files. You have to use the HTTP API with basic authentication to get a JSON response of LINES, that you must output to a file on your own.

This is one of the reasons I started this project.

https://github.com/theonlylawislove/SourceIndexingSharp

This will eventually (not yet), support indexing source files from Stash's API.

You can see the code I got to extract a file at an exact commit from the HTTP API here.

https://github.com/theonlylawislove/SourceIndexingSharp/tree/master/src/SourceIndexingSharp/Indexing/Stash

My project (SourceIndexingSharp) will require that a "SourceIndexingSharpExtractor.exe" to be placed in your system's PATH somewhere. Using my own exe to do the extracting, we could extract for a wider array of sources, including custom providers, and even CodePlex.

@ctaggart
Copy link
Owner

ctaggart commented Oct 1, 2014

Correct, it work with on-premise git servers that support serving the raw files via http/https. For example, it works with TFS on-premise. I'm surprised Stash doesn't support that. It would be great to request that feature from Atlassian.

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

No branches or pull requests

3 participants