From b914e3879b753bae161bd8f0dbaae13a558e3576 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2019 07:38:20 +0000 Subject: [PATCH 1/4] Bump github.com/google/go-github/v26 from 26.0.9 to 26.1.3 Bumps [github.com/google/go-github/v26](https://github.com/google/go-github) from 26.0.9 to 26.1.3. - [Release notes](https://github.com/google/go-github/releases) - [Commits](https://github.com/google/go-github/compare/v26.0.9...v26.1.3) Signed-off-by: dependabot-preview[bot] --- go.mod | 2 +- go.sum | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 3f544903..159e5254 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/gogo/protobuf v1.3.0 // indirect github.com/google/btree v1.0.0 // indirect github.com/google/go-cmp v0.3.1 // indirect - github.com/google/go-github/v26 v26.0.9 + github.com/google/go-github/v26 v26.1.3 github.com/hashicorp/go-cleanhttp v0.5.1 // indirect github.com/hekmon/cunits v2.0.1+incompatible // indirect github.com/hekmon/transmissionrpc v0.0.0-20190525133028-1d589625bacd diff --git a/go.sum b/go.sum index de0170ce..eb6b826d 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,11 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github/v26 v26.0.9 h1:RDv6xjhoFvGuAeYJwsIOC69nCfRna8cdoGw9hvX/Pc0= github.com/google/go-github/v26 v26.0.9/go.mod h1:v6/FmX9au22j4CtYxnMhJJkP+JfOQDXALk7hI+MPDNM= +github.com/google/go-github/v26 v26.1.3 h1:n03e8IGgLdD78L+ETWxvqpBIBWEZLlTBCQVU2yImw1o= +github.com/google/go-github/v26 v26.1.3/go.mod h1:v6/FmX9au22j4CtYxnMhJJkP+JfOQDXALk7hI+MPDNM= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= From 9de738362a1edbe25b45dc13d44d816a57d0b2d0 Mon Sep 17 00:00:00 2001 From: Steven Whitehead Date: Mon, 23 Sep 2019 21:50:06 -0400 Subject: [PATCH 2/4] support enterprise Travis endpoints --- modules/travisci/client.go | 12 +++++++++--- modules/travisci/settings.go | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/travisci/client.go b/modules/travisci/client.go index 10d5adb7..a7ad3eb3 100644 --- a/modules/travisci/client.go +++ b/modules/travisci/client.go @@ -17,6 +17,9 @@ func BuildsFor(settings *Settings) (*Builds, error) { builds := &Builds{} travisAPIURL.Host = "api." + TRAVIS_HOSTS[settings.pro] + if settings.baseURL != "" { + travisAPIURL.Host = settings.baseURL + } resp, err := travisBuildRequest(settings) if err != nil { @@ -39,6 +42,9 @@ var ( func travisBuildRequest(settings *Settings) (*http.Response, error) { var path string = "builds" + if settings.baseURL != "" { + travisAPIURL.Path = "/api/" + } params := url.Values{} params.Add("limit", settings.limit) params.Add("sort_by", settings.sort_by) @@ -46,15 +52,15 @@ func travisBuildRequest(settings *Settings) (*http.Response, error) { requestUrl := travisAPIURL.ResolveReference(&url.URL{Path: path, RawQuery: params.Encode()}) req, err := http.NewRequest("GET", requestUrl.String(), nil) + if err != nil { + return nil, err + } req.Header.Add("Accept", "application/json") req.Header.Add("Content-Type", "application/json") req.Header.Add("Travis-API-Version", "3") bearer := fmt.Sprintf("token %s", settings.apiKey) req.Header.Add("Authorization", bearer) - if err != nil { - return nil, err - } httpClient := &http.Client{} resp, err := httpClient.Do(req) diff --git a/modules/travisci/settings.go b/modules/travisci/settings.go index 29e5bea5..3de7a3a3 100644 --- a/modules/travisci/settings.go +++ b/modules/travisci/settings.go @@ -16,6 +16,7 @@ type Settings struct { common *cfg.Common apiKey string + baseURL string `help:"Your TravisCI Enterprise API URL." optional:"true"` compact bool limit string pro bool @@ -27,6 +28,7 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig), apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_TRAVIS_API_TOKEN"))), + baseURL: ymlConfig.UString("baseURL", ymlConfig.UString("baseURL", os.Getenv("WTF_TRAVIS_BASE_URL"))), pro: ymlConfig.UBool("pro", false), compact: ymlConfig.UBool("compact", false), limit: ymlConfig.UString("limit", "10"), From d913936970e1d4c9b554c0ea819746e8c7e72e86 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Tue, 24 Sep 2019 07:58:14 -0700 Subject: [PATCH 3/4] Add @scw007 as a contributor --- .all-contributorsrc | 7 +++++++ README.md | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 6193f951..1ef57dcf 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -679,6 +679,13 @@ "name": "Victor Hugo Avelar Ossorio", "avatar_url": "https://avatars3.githubusercontent.com/u/7926849?v=4", "profile": "https://victoravelar.com", + "contributions": [] + }, + { + "login": "scw007", + "name": "Steven Whitehead", + "avatar_url": "https://avatars3.githubusercontent.com/u/4001640?v=4", + "profile": "https://github.com/scw007", "contributions": [ ] } diff --git a/README.md b/README.md index 368d067a..8960982e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![All Contributors](https://img.shields.io/badge/all_contributors-96-orange.svg?style=flat-square)](#contributors) +[![All Contributors](https://img.shields.io/badge/all_contributors-97-orange.svg?style=flat-square)](#contributors) [![Build Status](https://travis-ci.com/wtfutil/wtf.svg?branch=master)](https://travis-ci.com/wtfutil/wtf) [![Twitter](https://img.shields.io/badge/follow-on%20twitter-blue.svg)](https://twitter.com/wtfutil) [![Go Report Card](https://goreportcard.com/badge/github.com/wtfutil/wtf)](https://goreportcard.com/report/github.com/wtfutil/wtf) @@ -192,7 +192,7 @@ Dependency management in WTF is handled by [Go modules](https://github.com/golan | [Sean DuBois
Sean DuBois](http://siobud.com)
| [Gary Kim
Gary Kim](https://github.com/gary-kim)
| [Dylan
Dylan](https://dylanbartels.com)
| [Dmytro Prokhorenkov
Dmytro Prokhorenkov](http://liet.me)
| [Elliot
Elliot](https://github.com/elliotrushton)
| [chenrui
chenrui](http://chenrui.dev)
| [Andrew Suderman
Andrew Suderman](https://github.com/sudermanjr)
| | [Bob 'Wombat' Hogg
Bob 'Wombat' Hogg](https://github.com/rwhogg)
| [Christopher Hall
Christopher Hall](https://github.com/hxw)
| [Heitor Neiva
Heitor Neiva](https://github.com/hneiva)
| [Herby Gillot
Herby Gillot](https://github.com/herbygillot)
| [James Canning
James Canning](http://brudil.com)
| [jeffz
jeffz](https://twitter.com/jeffz4000)
| [Mikkel Jeppesen Juhl
Mikkel Jeppesen Juhl](https://mikkeljuhl.com)
| | [Erik
Erik](https://github.com/lesteenman)
| [Nate Yourchuck
Nate Yourchuck](https://github.com/nyourchuck)
| [Casey Primozic
Casey Primozic](https://cprimozic.net/)
| [Alvaro [Andor]
Alvaro [Andor]](http://pierdelacabeza.com/maruja)
| [Joel Valentine
Joel Valentine](https://github.com/Midnight-Conqueror)
| [Viktor Braun
Viktor Braun](https://www.viktor-braun.de)
| [ChrisDBrown
ChrisDBrown](https://www.chrisdbrown.co.uk/)
| -| [Narendra L
Narendra L](https://narengowda.github.io/)
| [ibaum
ibaum](https://github.com/ibaum)
| [Tim Scheuermann
Tim Scheuermann](https://github.com/noxer)
| [Indradhanush Gupta
Indradhanush Gupta](https://indradhanush.github.io/)
| [Victor Hugo Avelar Ossorio
Victor Hugo Avelar Ossorio](https://victoravelar.com)
| +| [Narendra L
Narendra L](https://narengowda.github.io/)
| [ibaum
ibaum](https://github.com/ibaum)
| [Tim Scheuermann
Tim Scheuermann](https://github.com/noxer)
| [Indradhanush Gupta
Indradhanush Gupta](https://indradhanush.github.io/)
| [Victor Hugo Avelar Ossorio
Victor Hugo Avelar Ossorio](https://victoravelar.com)
| [Steven Whitehead
Steven Whitehead](https://github.com/scw007)
| ## Acknowledgments From 42137fef2ead38ee0da57798dd65093b82d324e2 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Tue, 24 Sep 2019 08:00:13 -0700 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7bba65a..ab6df7cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,8 @@ ### ⚡️ Added * [Azure DevOps](https://wtfutil.com/modules/azure-devops/) module added by [@v-braun](https://github.com/v-braun) -* [Dev.to](https://wtfutil.com/modules/devto/) modiule added by [@VictorAvelar](https://github.com/VictorAvelar) +* [Dev.to](https://wtfutil.com/modules/devto/) module added by [@VictorAvelar](https://github.com/VictorAvelar) +* [TravisCI]() module now supports enterprise endpoints, [#652](https://github.com/wtfutil/wtf/issues/652) by [@scw007](https://github.com/scw007) ### 🐞 Fixed