-
Notifications
You must be signed in to change notification settings - Fork 57
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
Fix over recursion of git serve #810
Conversation
internal/servegit/serve.go
Outdated
@@ -62,6 +62,7 @@ var indexHTML = template.Must(template.New("").Parse(`<html> | |||
type Repo struct { | |||
Name string | |||
URI string | |||
Bare bool |
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.
Related to the changes here
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.
I'm not sure about this, commented here https://github.com/sourcegraph/sourcegraph/pull/40170/files#r952907457
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.
Leaving final review to @keegancsmith but let some formatting drive-by comments
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.
This behaviour change is changelog worthy incase it breaks someone who is now relying on this new behaviour.
@mike-r-mclaughlin anyone you know who is using src serve-git on non-bare repos with subrepos? (maybe reply in slack, public PR)
internal/servegit/serve.go
Outdated
@@ -62,6 +62,7 @@ var indexHTML = template.Must(template.New("").Parse(`<html> | |||
type Repo struct { | |||
Name string | |||
URI string | |||
Bare bool |
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.
I'm not sure about this, commented here https://github.com/sourcegraph/sourcegraph/pull/40170/files#r952907457
I can't think of anyone off the top of my head. I don't know of anyone that is using src-serve-git with subrepos. But, still good idea to call it out in changelog. |
* Fix over recursion of git serve
Fixes https://github.com/sourcegraph/customer/issues/1210
So there was some weird behavior circling around this change.
Before the change:
After the change:
In this PR I have removed the support for subprojects making the code return the moment it finds either a git or a bare git repo. My assumption here was that because it was broken before this change, there didn't seem to be much of a need for us to support subprojects, and once reverted, the performance is now back to where it was previously.
I am open to feedback on if it is important for us to server subprojects this way, in which case we would need to think about a significantly more performant way of doing so.
Test plan
Tested manually to validate the improved runtime. Existing non-removed tests pass.