abrader / abrader-gms

Git management system types and providers for Puppet utilizing Github, Gitlab, Stash APIs
Apache License 2.0
26 stars 32 forks source link

Gitlab API v3 is no longer supported #43

Open ghost opened 6 years ago

ghost commented 6 years ago

OS: Centos 7.5.1804 Module version: v1.0.3 Puppet: v5.5.1 Gitlab: gitlab-ee-11.0.0-ee.0.el7.x86_64

Debug output from failed puppet run.

opening connection to gitlab.company.local:443...
opened
starting SSL for gitlab.company.local:443...
SSL established
<- "GET /api/v3/projects/0/keys HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nContent-Type: application/json\r\nPrivate-Token: PjbcSe-D_zxHynDQGNzc\r\nConnection: close\r\nHost: gitlab.company.local\r\n\r\n" 
-> "HTTP/1.1 410 Gone\r\n" 
-> "Server: nginx\r\n" 
-> "Date: Tue, 26 Jun 2018 04:41:02 GMT\r\n" 
-> "Content-Type: application/json\r\n" 
-> "Content-Length: 62\r\n" 
-> "Connection: close\r\n" 
-> "Cache-Control: no-cache\r\n" 
-> "Vary: Origin\r\n" 
-> "X-Request-Id: 50890cbc-5be0-4a1f-9003-e7ad1357268c\r\n" 
-> "X-Runtime: 0.008501\r\n" 
-> "\r\n" 
reading 62 bytes...
-> "{\"error\":\"API V3 is no longer supported. Use API V4 instead.\"}" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
read 62 bytes
Conn close
Debug: gitlab_deploy_key::api_call: REST API GET Response: #<Net::HTTPGone 410 Gone readbody=true>
sammcj commented 6 years ago

Noticed this as well, after the upgrade to 11.0.0 then 11.0.1 I realised things were borked :(

ghost commented 6 years ago

I believe #44 that I just submitted will resolve the issue.

v4ld3r5 commented 6 years ago

hi, we're getting the exact same message here, using GitLab CE 11.0.2

esalberg commented 6 years ago

It also doesn't look like the keys endpoint is available anymore in v4:

<- "GET /api/v4/projects/38/keys HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: /\r\nUser-Agent: Ruby\r\nContent-Type: application/json\r\nPrivate-Token: \r\nConnection: close\r\nHost: gitlab.server.com\r\n\r\n" -> "HTTP/1.1 404 Not Found\r\n"

Found the transition doc here: https://docs.gitlab.com/ce/api/v3_to_v4.html As of 8.17: Endpoints under GET /projects/:id/keys have been removed (use GET /projects/:id/deploy_keys) !8716

ETA: I tested against a fork of the PR after adding the updated endpoints, and it worked.

abrader commented 6 years ago

Clearly I have work to do which I want to just wrap up in a v4 support release that maintains v3 compatibility.

sammcj commented 5 years ago

Any update on this?