Commit Graph

14 Commits

Author SHA1 Message Date
Rémy Coutable 7833d3fb29
Improve & simplify GitHub's representation classes
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-05 11:05:45 +02:00
Rémy Coutable a55e150177 Set `label_ids` and `assignee_ids` after the initial `save!`.
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-05 10:48:26 +02:00
Rémy Coutable 43b75b3808 Don't even check if the branch exists locally as we only use its name in GH import
The benefit is that we don't even have to create temp source/target
branches.

Also, when the source branch of the imported MR is from a fork, name it
"user:branch" to mimic how we display it for MR when forks actually
exists.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-05 10:48:25 +02:00
Rémy Coutable f8184cec85 Don't check for commit existence in Github::Representation::Branch#exists?
We don't need to check if the existing branch contains a specific SHA
since we only use the branch's name, the SHA is taken from the pull
request raw `sha` data.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-05 10:48:25 +02:00
Rémy Coutable 324f672eef Keep only the changes that are known to work well
Also, improved a bit the method names in
Github::Representation::PullRequest.

Last but not least, ensure temp branch names doesn't contain a `/` as
this would create the ref in a subfolder in `refs/heads` (e.g.
`refs/heads/gh-123/456/rymai/foo`), and would leave empty directories
upon branch deletion (e.g. `refs/heads/gh-123/456/rymai/`.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-05 10:48:25 +02:00
James Lopez 149adcd120 Fetch and map refs/pull to refs/merge-requests in the GH import
update MR diff
2017-10-05 10:48:25 +02:00
Douglas Barbosa Alexandre be108ae6f0 Add a comment explaining how the branch clean up happens 2017-06-21 11:42:08 -03:00
Douglas Barbosa Alexandre 7c85d6af96 Fix Github::Representation::PullRequest#source_branch_exists? 2017-06-21 11:42:08 -03:00
Douglas Barbosa Alexandre 0e298c55ad Fix GitHub importer performance on branch existence check 2017-06-21 11:42:08 -03:00
Douglas Barbosa Alexandre 5d106f2597 Use the base initiliazer for representations 2017-04-24 21:13:51 -03:00
Douglas Barbosa Alexandre 782aab1319 Pass a options hash to Github::Client 2017-04-24 16:17:52 -03:00
Douglas Barbosa Alexandre 00e3d60c3d Extract Github::Representation::Issuable 2017-04-24 16:17:52 -03:00
Douglas Barbosa Alexandre f35573f12e Extract common attributes to Github::Representation::Base 2017-04-24 16:17:52 -03:00
Douglas Barbosa Alexandre b43ecca906 Add basic representations for the Github API results 2017-04-24 16:17:52 -03:00