You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 1, 2017. It is now read-only.
Copy file name to clipboardExpand all lines: content/changes/2016-02-19-source-import-preview-api.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Preview the Source Import API
3
3
author_name:spraints
4
4
---
5
5
6
-
We've added an API for source imports, which will let you start an import from a Git, Subversion, Mercurial, or Team Foundation Server source repository. This is the same functionality as[the GitHub Importer](https://import.github.com/).
6
+
We've added an API for source imports, which will let you start an import from a Git, Subversion, Mercurial, or Team Foundation Server source repository. This is the same functionality as[the GitHub Importer](https://help.github.com/articles/importing-from-other-version-control-systems-to-github/).
7
7
8
8
To access[the Source Import API][docs] during the preview period, you must provide a custom[media type][media-type] in the`Accept` header:
Copy file name to clipboardExpand all lines: content/v3/migration/source_imports.md
+29-17Lines changed: 29 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ This API is not currently available on GitHub Enterprise.
24
24
25
25
{{/tip}}
26
26
27
-
The Source Import API lets you start an import from a Git, Subversion, Mercurial, or Team Foundation Server source repository. This is the same functionality as[the GitHub Importer](https://import.github.com/).
27
+
The Source Import API lets you start an import from a Git, Subversion, Mercurial, or Team Foundation Server source repository. This is the same functionality as[the GitHub Importer](https://help.github.com/articles/importing-from-other-version-control-systems-to-github/).
28
28
29
29
A typical source import would[start the import](#start-an-import) and then (optionally)[update the authors](#map-a-commit-author) and/or[set the preference](#set-git-lfs-preference) for using Git LFS if large files exist in the import. A more detailed example can be seen in this diagram:
30
30
@@ -156,11 +156,17 @@ An import that does not have errors will progress through these steps:
156
156
157
157
If there are problems, you will see one of these in the`status` field:
158
158
159
-
*`auth_failed` - the import requires authentication in order to connect to the original repository.Make an "Update Existing Import" request, and include`vcs_username` and`vcs_password`.
159
+
*`auth_failed` - the import requires authentication in order to connect to the original repository.To update authentication for the import, please see the[Update Existing Import](#update-existing-import) section.
160
160
*`error` - the import encountered an error. The import progress response will include the`failed_step` and an error message.[Contact support](https://github.com/contact?form%5Bsubject%5D=Source+Import+API+error) for more information.
161
-
*`detection_needs_auth` - the importer requires authentication for the originating repository to continue detection. Make an "Update Existing Import" request, and include`vcs_username` and`vcs_password`.
162
-
*`detection_found_nothing` - the importer didn't recognize any source control at the URL.
163
-
*`detection_found_multiple` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a`project_choices` field with the possible project choices as values. Make an "Update Existing Import" request, and include`vcs` and (if applicable)`tfvc_project`.
161
+
*`detection_needs_auth` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the[Update Existing Import](#update-existing-import) section.
162
+
*`detection_found_nothing` - the importer didn't recognize any source control at the URL. To resolve,[Cancel the import](#cancel-an-import) and[retry](#start-an-import) with the correct URL.
163
+
*`detection_found_multiple` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a`project_choices` field with the possible project choices as values. To update project choice, please see the[Update Existing Import](#update-existing-import) section.
164
+
165
+
###The`project_choices` field
166
+
167
+
When multiple projects are found at the provided URL, the response hash will include a`project_choices` field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type.
168
+
169
+
<%= json:source_import_project_choices %>
164
170
165
171
###Git LFS related fields
166
172
@@ -173,15 +179,10 @@ This section includes details about Git LFS related fields that may be present i
173
179
174
180
##Update existing import
175
181
176
-
An import can be updated with credentials or a`project_choice` by passing in the appropriate parameters in this API request. If no parameters are provided, the import will be restarted.
182
+
An import can be updated with credentials or aproject choice by passing in the appropriate parameters in this API request. If no parameters are provided, the import will be restarted.
`tfvc_project`|`string`|For a tfvc import, the name of the project that is being imported.
207
+
Some servers (e.g. TFS servers) can have several projects at a single URL. In those cases the import progress will have the status`detection_found_multiple` and the Import Progress response will include a`project_choices` array. You can select the project to import by providing one of the objects in the`project_choices` array in the update request.
208
+
209
+
The following example demonstrates the workflow for updating an import with "project1" as the project choice. Given a`project_choices` array like such:
210
+
211
+
<%= json:source_import_project_choices %>
210
212
211
213
###Example
212
214
213
215
<%= json\
214
-
:vcs => "tfvc",
215
-
:tfvc_project => "project"
216
+
"vcs": "tfvc",
217
+
"tfvc_project": "project1",
218
+
"human_name": "project1 (tfs)"
216
219
%>
217
220
218
221
###Response
219
222
220
223
<%= headers 200 %>
221
224
<%= json:source_import_update_project_choice %>
222
225
226
+
###Parameters for restarting import
227
+
228
+
To restart an import, no parameters are provided in the update request.
Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username`hubot` into something like`hubot <hubot@12341234-abab-fefe-8787-fedcba987654>`.