-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Github Enterprise support #234
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
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 for the PR!
b79f770
to
ce348f1
Compare
@dhui Let me know what you think π€ Had to export |
979568f
to
0a8a416
Compare
migrations *source.Migrations | ||
} | ||
|
||
type Config struct { |
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.
Since Github
struct fields are now unexported, I've used Config
struct as a way to pass paths and things to the Github driver. WithInstance()
method sets the values from config.
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 seems redundant to me. Doesn't the github.Client
already contain all of this information?
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 I follow? π€ I'm using Config
struct, to set pathOwner
, pathRepo
and path
on the github
migration source driver. WithInstance()
takes Config
, so I thought, this was a good way to do that without need to export the fields. github.Client
doesn't contain this info.
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.
Oh yeah, you're right! I confused our Github driver w/ the underlying one...
I'd rather not have fields duplicated. So let's move the pathOwner
, pathRepo
, path
, and ref
fields from the Github
struct to the Config
struct, export them, and add a config *Config
field to the Github
struct. I think we should leave options
unexported to avoid any conflicting sources of truth.
Also, we'll need to properly initialize any pointers so they're not nil
. It may make sense to do this in an unexported method (like ensureFields()
) and run that before each relevant method.
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.
Sorry! I should have noticed this in the last review...
Let's drop the URL
field (since it's not being used) and rename PathOwner
and PathRepo
to Owner
and Repo
respectively, since the path prefixes don't make sense anymore...
https://godoc.org/github.com/google/go-github/github#RepositoriesService.GetContents
migrations *source.Migrations | ||
} | ||
|
||
type Config struct { |
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 seems redundant to me. Doesn't the github.Client
already contain all of this information?
source/github_ee/github_ee_test.go
Outdated
} | ||
|
||
g := &GithubEE{} | ||
_, err = g.Open("github-ee://foo:bar@" + u.Host + "/mattes/migrate_test_tmp/test?skipSSLVerify=true#452b8003e7") |
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.
Get the response and check that the status code is http.StatusOK
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.
Open()
returns Driver
and error
types, so there isn't really a way to check for http.StatusOK
. If err
is null
, the migrations then run, but that's tested in the github
source driver. Unless I misunderstood the suggestion?
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 for incorporating the feedback! We're almost there!
migrations *source.Migrations | ||
} | ||
|
||
type Config struct { |
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.
Oh yeah, you're right! I confused our Github driver w/ the underlying one...
I'd rather not have fields duplicated. So let's move the pathOwner
, pathRepo
, path
, and ref
fields from the Github
struct to the Config
struct, export them, and add a config *Config
field to the Github
struct. I think we should leave options
unexported to avoid any conflicting sources of truth.
Also, we'll need to properly initialize any pointers so they're not nil
. It may make sense to do this in an unexported method (like ensureFields()
) and run that before each relevant method.
@dhui thanks for your feedback man. I think I addressed them π€ |
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 should be the last one! We only have minor struct field renames and removals.
migrations *source.Migrations | ||
} | ||
|
||
type Config struct { |
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.
Sorry! I should have noticed this in the last review...
Let's drop the URL
field (since it's not being used) and rename PathOwner
and PathRepo
to Owner
and Repo
respectively, since the path prefixes don't make sense anymore...
https://godoc.org/github.com/google/go-github/github#RepositoriesService.GetContents
@dhui |
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 again for the PR and for seeing it all the way through!
@dhui no worries πThanks for your feedback! π€ |
Hey π
This PR is related to #92.
I understand that the way I implemented, introduces a breaking change, since you now have to specify the host, e.g.
github.com
. But maybe that's ok?Alternatively, perhaps it could be implemented as a separate driver (
github-ee://
) that uses thegithub
driver as core.Would like to get some thoughts on this? π