Skip to content
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

Fixes #222, using deploy_keys endpoint #261

Merged
merged 2 commits into from
Mar 14, 2017

Conversation

epintozzi
Copy link
Contributor

This PR resolves issue #222. The deploy_keys endpoints have been updated from keys. disable_deploy_key was already updated.

This has been tested against https://gitlab.com/api/v3 and is confirmed working. This does not address backwards compatibility with versions prior to 8.10.

@asedge
Copy link
Collaborator

asedge commented Mar 2, 2017

@epintozzi Looks good, thanks! Do you mind adding what you've done to the CHANGELOG.md?

@epintozzi
Copy link
Contributor Author

Following step 8 in CONTRIBUTING.md, I ran the following:

git checkout master
git pull upstream master
git checkout v4_deploy_keys
git rebase master

There now appear to be merge conflicts. Not sure how this is happening, as 15c0d29 was rebased into my branch. This is normally when I'd merge, though I know that is frowned upon. Any advice?

@asedge
Copy link
Collaborator

asedge commented Mar 9, 2017

@epintozzi I think this occurred because adc91b5 was already merged into your local repo's master branch so when you did a pull it added new commits from upstream/master on top of yours. This differs from the chain of commits on upstream/master and git could not resolve the conflicts automatically. I can't be sure though because the master branch of https://github.com/epintozzi/gitlab does not have adc91b5.

I cloned your repo and played around with it a bit to try to get your the most straight-forward way to fix your issue and I think I have it. For future reference, you may want to read this section of the Git book which outlines how to rewrite history: https://git-scm.com/book/id/v2/Git-Tools-Rewriting-History. The whole book is useful and definitely worth reading at least once if you haven't already.

Steps to fix by reordering the commits to match the commit history on upstream/master:

git checkout v4_deploy_keys
git rebase -i HEAD~3
# This will drop you into your $EDITOR and the first 3 lines will look like this:
pick adc91b5 Fixes #222, using deploy_keys endpoint
pick 3be515a (Un)subscribe to issues and merge_requests (#260)
pick 3593a2c update changelog.md
# You will want to change the order so it looks like this:
pick 3be515a (Un)subscribe to issues and merge_requests (#260)
pick adc91b5 Fixes #222, using deploy_keys endpoint
pick 3593a2c update changelog.md
# Save and quit - you should see "Successfully rebased and updated refs/heads/v4_deploy_keys."
git push -f origin v4_deploy_keys

I would also recommend going back to your master branch and fix its history so it matches your upstream remote:

git checkout master
git fetch upstream master    # You shouldn't need to do this, but lets cover all bases to be safe.
git reset --hard upstream/master

@epintozzi
Copy link
Contributor Author

@asedge Oh wow thank you so much for the help and advice. That really was above and beyond, and very much I appreciate it, especially as a beginner. That seemed to do the trick! 🤞

@asedge asedge merged commit 054a93b into NARKOZ:master Mar 14, 2017
@asedge
Copy link
Collaborator

asedge commented Mar 14, 2017

@epintozzi Thanks!

andrew added a commit to librariesio/gitlab that referenced this pull request Apr 11, 2017
* upstream/master:
  release 4.0.0
  Move .file_contents to RepositoryFiles module, matching GitlabHQ API doc.  Also update route so it actually works with APIv4.
  Fix .get_file for new APIv4 route
  Update gitignore
  Add ability to get all issues a merge_request will close (NARKOZ#271)
  Update CHANGELOG, add some missing entries.
  Block/unblock user now uses POST instead of PUT.  Fixes NARKOZ#262.
  Adds ability to create commits (NARKOZ#264)
  Rename "git hook" to "push rule".  Closes NARKOZ#233.
  Change project fork endpoint for v4 API. Closes NARKOZ#236.
  Add v4-endpoint to fetch all merge_requests for a milestone (NARKOZ#265)
  Fixes NARKOZ#222, using deploy_keys endpoint (NARKOZ#261)
  (Un)subscribe to issues and merge_requests (NARKOZ#260)
  Update merge_request endpoints to new merge_requests endpoints (NARKOZ#256)
  Fix failing test that was called with a pre-urlencoded string.
  Allow issues to use NAMESPACE/REPO identifier (NARKOZ#255)
  Feature/230 note that project id can also be a string (NARKOZ#253)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants