Skip to content

Commit

Permalink
Bump all dependencies (prometheus-community#133)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan-Otto Kröpke <[email protected]>

Signed-off-by: Jan-Otto Kröpke <[email protected]>
  • Loading branch information
jkroepke authored Nov 22, 2022
1 parent 43a23d5 commit f58ae33
Show file tree
Hide file tree
Showing 13 changed files with 390 additions and 282 deletions.
2 changes: 1 addition & 1 deletion .errcheck_excludes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(github.com/go-kit/kit/log.Logger).Log
(github.com/go-kit/log.Logger).Log
fmt.Fprintln
fmt.Fprint
6 changes: 3 additions & 3 deletions .github/workflows/build-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.15.x
- uses: actions/checkout@v2
go-version-file: 'go.mod'
- name: Login to quay.io Docker Image Registry
uses: docker/login-action@v1
with:
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.15.x
- uses: actions/checkout@v2
- run: make
env:
GO111MODULE: "on"
GOBIN: "/tmp/bin"
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- run: make
env:
GOBIN: "/tmp/bin"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.15 AS builder
FROM golang:1.19 AS builder
WORKDIR /go/src/github.com/prometheus-community/jiralert
COPY . /go/src/github.com/prometheus-community/jiralert
RUN GO111MODULE=on GOBIN=/tmp/bin make
Expand Down
4 changes: 2 additions & 2 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_

GOLANGCI_LINT :=
GOLANGCI_LINT_OPTS ?=
GOLANGCI_LINT_VERSION ?= v1.39.0
GOLANGCI_LINT_VERSION ?= v1.50.0
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64.
# windows isn't included here because of the path separator being different.
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386))
ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 arm64 i386))
GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint
endif
endif
Expand Down
7 changes: 3 additions & 4 deletions cmd/jiralert/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ import (
"encoding/json"
"flag"
"fmt"
"github.com/andygrunwald/go-jira"
"net/http"
"os"
"runtime"
"strconv"

"github.com/andygrunwald/go-jira"

"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus-community/jiralert/pkg/alertmanager"
"github.com/prometheus-community/jiralert/pkg/config"
"github.com/prometheus-community/jiralert/pkg/notify"
Expand Down
33 changes: 25 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
module github.com/prometheus-community/jiralert

go 1.15
go 1.19

require (
github.com/andygrunwald/go-jira v1.15.1
github.com/go-kit/kit v0.10.0
github.com/golang/protobuf v1.4.1 // indirect
github.com/andygrunwald/go-jira v1.16.0
github.com/go-kit/log v0.2.1
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.6.0
github.com/prometheus/common v0.10.0 // indirect
github.com/stretchr/testify v1.5.1
github.com/prometheus/client_golang v1.13.0
github.com/stretchr/testify v1.7.0
github.com/trivago/tgo v1.0.7
gopkg.in/yaml.v2 v2.3.0
golang.org/x/text v0.4.0
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
golang.org/x/sys v0.1.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
)
563 changes: 328 additions & 235 deletions go.sum

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package config

import (
"fmt"
"io/ioutil"
"net/url"
"os"
"path/filepath"
Expand All @@ -24,11 +23,11 @@ import (
"strings"
"time"

"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"

"github.com/trivago/tgo/tcontainer"
"gopkg.in/yaml.v2"
yaml "gopkg.in/yaml.v3"
)

// Secret is a string that must not be revealed on marshaling.
Expand Down Expand Up @@ -61,7 +60,7 @@ func Load(s string) (*Config, error) {
// LoadFile parses the given YAML file into a Config.
func LoadFile(filename string, logger log.Logger) (*Config, []byte, error) {
level.Info(logger).Log("msg", "loading configuration", "path", filename)
content, err := ioutil.ReadFile(filename)
content, err := os.ReadFile(filename)
if err != nil {
return nil, nil, err
}
Expand Down
9 changes: 4 additions & 5 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@
package config

import (
"io/ioutil"
"os"
"path"
"reflect"
"testing"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v2"
yaml "gopkg.in/yaml.v3"
)

const testConf = `
Expand Down Expand Up @@ -80,11 +79,11 @@ template: jiralert.tmpl

// Generic test that loads the testConf with no errors.
func TestLoadFile(t *testing.T) {
dir, err := ioutil.TempDir("", "test_jiralert")
dir, err := os.MkdirTemp("", "test_jiralert")
require.NoError(t, err)
defer func() { require.NoError(t, os.RemoveAll(dir)) }()

require.NoError(t, ioutil.WriteFile(path.Join(dir, "config.yaml"), []byte(testConf), os.ModePerm))
require.NoError(t, os.WriteFile(path.Join(dir, "config.yaml"), []byte(testConf), os.ModePerm))

_, content, err := LoadFile(path.Join(dir, "config.yaml"), log.NewNopLogger())

Expand Down
11 changes: 6 additions & 5 deletions pkg/notify/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package notify

import (
"bytes"
"crypto/sha512"
"fmt"
"io/ioutil"
"github.com/andygrunwald/go-jira"
"io"
"reflect"
"strings"
"time"

"github.com/andygrunwald/go-jira"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/pkg/errors"
"github.com/prometheus-community/jiralert/pkg/alertmanager"
"github.com/prometheus-community/jiralert/pkg/config"
Expand Down Expand Up @@ -376,7 +377,7 @@ func handleJiraErrResponse(api string, resp *jira.Response, err error, logger lo

if resp != nil && resp.StatusCode/100 != 2 {
retry := resp.StatusCode == 500 || resp.StatusCode == 503
body, _ := ioutil.ReadAll(resp.Body)
body, _ := io.ReadAll(resp.Body)
// go-jira error message is not particularly helpful, replace it
return retry, errors.Errorf("JIRA request %s returned status %s, body %q", resp.Request.URL, resp.Status, string(body))
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/notify/notify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ package notify

import (
"fmt"
"github.com/andygrunwald/go-jira"
"os"
"sort"
"testing"
"time"

"github.com/trivago/tgo/tcontainer"

"github.com/andygrunwald/go-jira"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/pkg/errors"
"github.com/prometheus-community/jiralert/pkg/alertmanager"
"github.com/prometheus-community/jiralert/pkg/config"
Expand Down
7 changes: 4 additions & 3 deletions pkg/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ import (
"strings"
"text/template"

"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/pkg/errors"
"golang.org/x/text/cases"
)

type Template struct {
Expand All @@ -32,7 +33,7 @@ type Template struct {
var funcs = template.FuncMap{
"toUpper": strings.ToUpper,
"toLower": strings.ToLower,
"title": strings.Title,
"title": cases.Title,
// join is equal to strings.Join but inverts the argument order
// for easier pipelining in templates.
"join": func(sep string, s []string) string {
Expand Down

0 comments on commit f58ae33

Please sign in to comment.