-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Added support for Go's repository retrieval. #5958
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
Conversation
- Simply adds the releavant meta link in the project's show action. - Information about this meta tag can be found here: http://golang.org/cmd/go/#hdr-Remote_import_paths
Forgot to mention that this implements this suggestion: http://feedback.gitlab.com/forums/176466-general/suggestions/5252663-golang-support-or-easy-clone-via-base-url- |
This needs to use GitLab methods to link to the project (see the project model), otherwise stuff like relative url's will not work. |
- This should work correctly in all cases now. - Added a new project method that returns the web url for a project without the scheme prefix.
You are right. Changed it to use the web_url method. I had to add a similar method to get the project url without the scheme part. |
You can't reply to issues On Mon, Dec 30, 2013 at 9:19 PM, Bruno Albuquerque <notifications@github.com
|
- Previus version was still incorrect as it ignored cases where GitLab would be installed in a custom location. - This assumes that if this method can be calle, web_url will return a valid URL.
app/models/project.rb
Outdated
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.
scheme? isn't it called protocol?
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.
The formal name for this part of a URI is scheme. But I would be ok changing it to protocol if you prefer.
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.
Thanks, I learned something :-)
Please call it protocol since that is how the rest of the GitLab codebase refers to it.
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.
Done.
Sorry for the delay. I was busy with real life. Things should move more quickly from now on. |
Let me know if you need a pointer for the test. |
Yes, please. I actually asked for pointers in a previous comment. :) In any case, here is what i said: Ok, will do it. I searched but could not find where unit tests usually go in the gitlab codebase. Can you give me some pointers? |
@brunoga I saw it in an email, I just couldn't find the comment here anymore :-) Anyway, this should probably go in the project spec, just below other url functions in there https://github.com/gitlabhq/gitlabhq/blob/master/spec/models/project_spec.rb#L97 |
Got it. The test is done and i think it should work. How do I actually run gitlab tests to make sure it does? |
@brunoga You can set up your own environment https://gitlab.com/gitlab-org/cookbook-gitlab/blob/master/doc/development.md or wait for the Travis tests to run. |
ok. i will push the test so you can take a look at it. Meanwhile I will bring the development stuff up. |
@brunoga OK, I'll probably wait for Travis to test it :) |
Travis seem to like the CL: https://travis-ci.org/gitlabhq/gitlabhq/builds/17274227 This probably only means Travis is drunk tough. ;) |
Added support for Go's repository retrieval.
Thanks guys. |
Two people suddenly report problems with this on GitLab.com https://twitter.com/schmichael/status/466254402693496832 |
Thanks for the heads up. The error is weird and I would need a pointer to a On Wed May 14 2014 at 4:33:00 AM, Sytse Sijbrandij notifications@github.com
|
So what happens is that HTML is not necessarily valid XML, so go get breaks This should work but I will not be able to try to implement this in the On Fri May 30 2014 at 9:09:20 AM, Sytse Sijbrandij notifications@github.com
|
@brunoga Thanks for investigating. This would have to be community contributed and I'm not sure the technical complexity is acceptable. Can the be solved at the Golang side? |
I've submitted a bug report on the Golang side (https://code.google.com/p/go/issues/detail?id=8163); they shouldn't be using an XML parser to process HTML5. After looking through their code, a simple solution would be to move the generation of the meta tag to the top of the (or at least before the javascript is rendered). |
@jbowtie I hope you are right, I submitted https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/128 |
This should work. Thanks for doing this. On Wed Jun 18 2014 at 11:20:13 AM, Sytse Sijbrandij <
|
Fix go meta tag See #5958 (comment)
Will go out in GitLab 7.1 |
Great. On 1404289704625, Sytse Sijbrandij notifications@github.com wrote:
|
I'm still having this issue (" XML syntax error on line 6: expected attribute name in element"), trying to use go get to install something from a private gitlab repo on gitlab.com. |
@jmunson Someone will have to troubleshoot this. |
James. Can you, by any chance, post here (or mail me) the top of the HTML code for Em Wed Oct 08 2014 at 11:59:25 AM, Sytse Sijbrandij <
|
Here is the results from a project used as an example earlier in the discussion, https://gitlab.com/jbowtie/ratago?go-get=1 I tried to paste the html, but I don't think github is fond of me pasting javascript into the comment box, so here's a gist: https://gist.github.com/jmunson/cfc501461467631fde24 |
So, this is exactly the same issue. There is some javascript code being 1 - Somone did some change that added that code before the import Sytse? Em Wed Oct 08 2014 at 2:12:18 PM, James Munson notifications@github.com
|
Below is the current (088774b) state of EE (master) Seems to be the top thing to me. @jmunson What version are you on? › git grep -C 15 go-import |
Thats using whatever is live on gitlab.com, as of the time of me posting this that is currently GitLab Enterprise Edition 7.3.2-ee e4cb921 |
@jmunson Sorry, I missed that. I checked that commit but the git grep looks the same. The code inserted before contains @jacobvosmaer I don't think we use the browser time tracking from New Relic heavily and I don't like that it is inserting tracking stuff in our header. Shall we disable it? https://ellislab.com/expressionengine/user-guide/monitoring/new-relic.html |
I'm OK with not injecting NewRelic JS. I'll just have to figure out how to do that with environment variables. |
@jacobvosmaer OK, thanks. Please comment back when done. |
I added an env setting for New Relic (
|
@jacobvosmaer You mean you managed to disable RUM? |
@dosire yes, I edited my comment above. |
@jacobvosmaer Awesome, thanks! |
It seems that, golang can only recognized I still got error: |
@lfyzjck I am getting the following with Go 1.3.3:
It looks like it's working on gitlab.com at the moment. |
@jacobvosmaer I have made a mistake, in my own project, i have make it's visibility to "Internal", when i call thanks for you help! |
I'm facing the same problem @lfyzjck had. But in my case I can't change my repo visibility to public. |
Apparently, #7693 will fix that! 😄 |
http://golang.org/cmd/go/#hdr-Remote_import_paths
Note I am not sure how to do unit tests for this, but I am willing to do those if someone can point me to how to do it. Also I did not update the CHANGELOG as I am not sure where to put the change. Is it under v6.5.0?