Skip to content
This repository was archived by the owner on May 15, 2023. It is now read-only.

Commit 29936d3

Browse files
author
Stig Lindqvist
committed
replace gitlab API v3 with v4
1 parent 725a20a commit 29936d3

File tree

252 files changed

+25713
-6872
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+25713
-6872
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [0.8.0] - 2018-09-18
8+
9+
- Use gitlab API v4 instead of v3
10+
711
## [0.7.0] - 2017-12-07
812

913
- Configuration format for whitelisting users has been changed to make it easier to

gitlab.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ func trawlGitLab(conf *Config, log Logger) <-chan *PullRequest {
1515
var wg sync.WaitGroup
1616

1717
client := gitlab.NewClient(nil, conf.GitLabToken)
18-
if err := client.SetBaseURL(conf.GitlabURL + "/api/v3"); err != nil {
18+
if err := client.SetBaseURL(conf.GitlabURL + "/api/v4"); err != nil {
1919
usageAndExit(err.Error(), 1)
2020
}
2121

22-
status := "opened"
23-
options := &gitlab.ListMergeRequestsOptions{State: &status}
22+
const status = "opened"
2423

2524
// spin out each request to find PR on a repo into a separate goroutine
2625
for _, repo := range conf.GitLabRepos {
@@ -32,7 +31,10 @@ func trawlGitLab(conf *Config, log Logger) <-chan *PullRequest {
3231
defer wg.Done()
3332
log.Debugf("fetching GitLab PRs for %s\n", repoName)
3433

35-
pullRequests, _, err := client.MergeRequests.ListMergeRequests(repoName, options)
34+
opts := &gitlab.ListProjectMergeRequestsOptions{
35+
State: gitlab.String(status),
36+
}
37+
pullRequests, _, err := client.MergeRequests.ListProjectMergeRequests(repoName, opts)
3638
if err != nil {
3739
log.Infof("Couldn't fetch PRs from GitLab (%s): %s\n", repoName, err)
3840
return

glide.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import:
33
- package: github.com/bluele/slack
44
- package: github.com/dustin/go-humanize
55
- package: github.com/xanzy/go-gitlab
6-
version: ~0.5.1
6+
version: ~0.11.0
77
- package: golang.org/x/oauth2
88
- package: github.com/google/go-github

vendor/github.com/google/go-github/.travis.yml

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/google/go-github/AUTHORS

Lines changed: 45 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)