-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Migrations API support #1141
Migrations API support #1141
Conversation
@ryangribble The build is failing for other projects, do I need add all the files there too? |
Yeah, you have to run the build script locally, with "FixProjects" target - this adds any new files added to octokit project, to the other mono/core/etc projects Instructions in the contributors doc |
So I was reading the documentation about this feature and it turns out I was incorrect in saying you need github enterprise for this API These API calls cover the process of extracting repositories from github.com or github enterprise, that can later be imported into github enterprise. The API is in preview mode only and on covers the export side, there doesn't appear to be anything on import side yet. Also this preview API isn't yet available on github enterprise as of latest 2.5 version (according to docs at least) so at the moment it seems only possible to do against github.com (usually new features make it into the next ghe feature release so I'd expect to see them in 2.6, potentially with the import side implemented as well or possibly not) Good news is this means you should be able to do all the testing and integration tests etc yourself @devkhan |
Thanks @ryangribble, I will try my best. And I'd would still need your and others' help. |
@ryangribble @shiftkey Can anybody tell me why Stack trace: It fails here: |
Hey @devkhan Great job getting a good head start on this 😀 Implementing a whole new "client" is a pretty maojr job, so there are quite a few things we'll need to cover to get you over the line! We really appreciate your contribution so please don't be put off by the following feedback, I'm trying to make it as detailed and explanatory as possible so that we can quickly get you into the "mindset" of an octokit developer 🚀 API Client StructureWe try to structure the API clients in octokit to be inline with the GitHub API. If you have a look at the sidebar in the API docs, the As an aside, it looks like this Migration/Migrations API actually got moved to this top level location late February, previously it was under the Naming things (TM)If you have a look at some other Order of MethodsIn a similar line of thought, I personally try to have the "order" of the method calls in my client, match those shown in the API. So in your case, you've listed them as Other Notes
|
@ryangribble Thanks for the detailed feedback. I was also eagerly waiting for someone to get me into the "mindset". Now that I know much better about the philosophy of Octokit, I'll adhere to it.
Thankfully, it came up before running Also, a question, does it mean we have to create an IMigrationsClient and an ISourceImportClient (may be in the future) inside an IMigrationClient and that will go under the IGitHubClient?
I was having a hard time Naming Things (TM), its now cleared now, and I'll follow the conventions from now on. 👍 And, I was about to ask where to put the AcceptHeader, thanks for clearing that out.
That was such a nightmare. Thank you so much. 💯 |
Indeed! We have an open issue #1092 suggesting to make "FixProjects" build task remove items from the slave projects, if the items no longer exist on disk... we've all "been there" when we rename something and have to go hacking around in those other projects to set the world right again. Unfortunately I am too chicken to tackle the F# build script to see what's involved in doing that!
Yep! I think this is the first time they've given us 2 such similarly named things as parent/child, but the structure is a "Migration" entry, with "Migrations" and "Source Import" under that. So although it's a bit odd to have |
@ryangribble The GitHub API docs list the Migration->Migrations API as the "Enterprise Migrations API", but does not list it under the Enterprise section, so should I add into a new section for Migration or let it stay in the Enterprise section? |
Yeah, I mentioned earlier it is confusing since they doi call it the "Enterprise Migrations API" but with octokit.net, we base the Clients class structure on the API structure (as shown in the sidebar on the doc site) and not the name... so |
Also from a consistency point of view, in the Client interfaces and implementations you've got method parameters on separate lines Task<Migration> Start(
string org,
StartMigrationRequest migration); Whereas to be consistent with the existing Clients in the code base, they should be Task<Migration> Start(string org, StartMigrationRequest migration); |
Thanks. As the GitHub API docs says. And, I just put them on the next line to improve readability because of long parameters list. But project's conventions are more important, I'll change them. Should I change this in the tests also? |
""octocat/Hello-World"" | ||
], | ||
""lock_repositories"": true | ||
}"; |
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.
indentation
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.
👍
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, to clarify I'm saying the indentation here doesn't look correct...
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 know, I just copy-pasted from the docs, I'll correct them.
I was only referring to the method declarations, and the test methods dont take any parameters so it;s not applicable to those... |
@ryangribble The GitHub API docs refer the Migrations API as the "Enterprise Migrations API", so while I will keep it out of the enterprise directory, should I prefix it with Enterprise or not as ...
So, what should I do? |
The mentions of "Enterprise Migrations" is only at the landing page for the parent "Migration" page. Everywhere else shows "Migrations" - eg the URL, the sidebar, the actual page title etc. This seems to be the first example I can find where the "title" of an API as shown on it's parent's landing page is not consistent with it's name in the side bar and on it's own page! This API was already only recently moved/relocated to this spot, so I assume this is it's new home now, and if anything it may be losing the "Enterprise" nomenclature... Perhaps @shiftkey or @haacked can get the inside word on whether this is being renamed "to" or "away" from "Enterprise" Migrations API on it's parent page? This is the only place it's called "Enterprise Migrations" Everywhere else it's just "Migrations" I think your latest revision is great though - But I do think the way you've got it now is the most consistent and inline with the standards set throughout octokit (rather than breaking the singular property naming rule or calling it EnterpriseMigration eventhough its not called that in most places in the doc)... so Im happy with how it's ended up! |
This PR is looking great now!!! Great effort on the testing coverage and everything is looking nicely consistent and thorough! 👍 I think there's just the one indentation issue with the json in the model test... and the fact that other PR merges have caused you to be out of date with master which you'll need to rebase or merge (sorry!) Ill pull this down and run through the tests etc myself in the next couple of days |
@ryangribble I still have to write the integration tests, though. I'll try to get them done as soon as possible. |
@ryangribble I've added the integration tests but I have a couple of questions:
|
@devkhan ill pull your stuff down and have a look through it in the next couple of days thanks! |
88dc203
to
eee826f
Compare
{ | ||
readonly IGitHubClient _gitHub; | ||
|
||
public TheStartNewMethod() |
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 reflect the method name which was renamed, so TheStartMethod()
Following the API sidebar structure, the migrations client is pulled out and put into another Migration client.
- `StartMigration()` not considered as a test. - Creating repo with timestamp for uniqueness.
dde430f
to
05bdbab
Compare
Yeah, another PR has been merged since my rebase. Fixed. |
I'm going to merge this in as it's been a long hard slog for you @devkhan! Good work on implementing a brand new API from scratch! |
It was a great experience, I hope to contribute more in future. |
Refer #1029 .
Migrations API: https://developer.github.com/v3/migration/migrations/
About migrations: https://help.github.com/enterprise/2.4/admin/guides/migrations/about-migrations/
To-do:
IEnterpriseMigrationsClient
.IEnterpriseMigrationsClient
.in progress, help needed).I don't have access to an Enterprise instance, some pointers needed)..\build.cmd FixProjects
(for Mono and Xamarin projects).I also need to discuss some of things which pop-up in my head every now and then. 🙏
/cc @ryangribble @shiftkey