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

Bump all dependencies #133

Merged
merged 1 commit into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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