Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mszostok committed Jan 25, 2024
1 parent 0829b0b commit 0db81f4
Show file tree
Hide file tree
Showing 81 changed files with 137 additions and 237 deletions.
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,23 @@ test: system-check
@go test -v -race ./...

test-integration-slack: system-check
@go test -timeout=20m -v -tags=integration -race -count=1 ./test/e2e/... -run "TestSlack"
@cd ./test; go test -timeout=20m -v -tags=integration -race -count=1 ./e2e/... -run "TestSlack"

test-integration-discord: system-check
@go test -timeout=20m -v -tags=integration -race -count=1 ./test/e2e/... -run "TestDiscord"
@cd ./test; go test -timeout=20m -v -tags=integration -race -count=1 ./e2e/... -run "TestDiscord"

test-integration-teams: system-check
@go test -timeout=20m -v -tags=integration -race -count=1 ./test/e2e/... -run "TestTeams"

@cd ./test; go test -timeout=20m -v -tags=integration -race -count=1 ./e2e/... -run "TestTeams"

test-cli-migration-e2e: system-check
@go test -v -tags=migration -race -count=1 ./test/e2e/...
@cd ./test; go test -v -tags=migration -race -count=1 ./e2e/...

test-cloud-slack-dev-e2e: system-check
@go test -tags=cloud_slack_dev_e2e -race -p 1 -v -timeout 30m ./test/cloud-slack-dev-e2e/...
@cd ./test; go test -tags=cloud_slack_dev_e2e -race -p 1 -v -timeout 30m ./cloud-slack-dev-e2e/...

test-cloud-slack-dev-e2e-show-browser: system-check
@go test -tags=cloud_slack_dev_e2e -race -p 1 -v -timeout 30m -rod=show ./test/cloud-slack-dev-e2e/...
@cd ./test; go test -tags=cloud_slack_dev_e2e -race -p 1 -v -timeout 30m -rod=show ./cloud-slack-dev-e2e/...

# Build Botkube official plugins for all supported platforms.
build-plugins: pre-build gen-plugins-goreleaser
Expand Down
4 changes: 2 additions & 2 deletions cmd/botkube-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"context"
"errors"
"fmt"
"github.com/kubeshop/botkube/pkg/httpx"
"github.com/kubeshop/botkube/pkg/loggerx"
"net/http"
"time"

Expand Down Expand Up @@ -44,6 +42,8 @@ import (
"github.com/kubeshop/botkube/pkg/config"
"github.com/kubeshop/botkube/pkg/controller"
"github.com/kubeshop/botkube/pkg/execute"
"github.com/kubeshop/botkube/pkg/httpx"
"github.com/kubeshop/botkube/pkg/loggerx"
"github.com/kubeshop/botkube/pkg/maputil"
"github.com/kubeshop/botkube/pkg/multierror"
"github.com/kubeshop/botkube/pkg/notifier"
Expand Down
2 changes: 1 addition & 1 deletion cmd/executor/exec/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"context"
"fmt"
"github.com/kubeshop/botkube/pkg/loggerx"
"strings"

"github.com/MakeNowJust/heredoc"
Expand All @@ -18,6 +17,7 @@ import (
"github.com/kubeshop/botkube/pkg/api"
"github.com/kubeshop/botkube/pkg/api/executor"
"github.com/kubeshop/botkube/pkg/formatx"
"github.com/kubeshop/botkube/pkg/loggerx"
"github.com/kubeshop/botkube/pkg/pluginx"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/executor/flux/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package main

import (
"context"
"github.com/kubeshop/botkube/pkg/loggerx"
"time"

"github.com/allegro/bigcache/v3"
"github.com/hashicorp/go-plugin"

"github.com/kubeshop/botkube/internal/executor/flux"
"github.com/kubeshop/botkube/pkg/api/executor"
"github.com/kubeshop/botkube/pkg/loggerx"
)

// version is set via ldflags by GoReleaser.
Expand Down
2 changes: 1 addition & 1 deletion cmd/executor/gh/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import (
"context"
_ "embed"
"fmt"
"github.com/kubeshop/botkube/pkg/loggerx"
"text/template"

"github.com/hashicorp/go-plugin"

"github.com/kubeshop/botkube/pkg/api"
"github.com/kubeshop/botkube/pkg/api/executor"
"github.com/kubeshop/botkube/pkg/config"
"github.com/kubeshop/botkube/pkg/loggerx"
"github.com/kubeshop/botkube/pkg/pluginx"
)

Expand Down
5 changes: 3 additions & 2 deletions hack/gen-plugin-index.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package main

import (
"flag"
"github.com/kubeshop/botkube/internal/plugin"
"github.com/kubeshop/botkube/pkg/loggerx"
"os"
"path/filepath"

"github.com/kubeshop/botkube/internal/plugin"
"github.com/kubeshop/botkube/pkg/loggerx"

"github.com/sirupsen/logrus"
"gopkg.in/yaml.v3"
)
Expand Down
3 changes: 2 additions & 1 deletion hack/target/build-plugins/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package main
import (
"flag"
"fmt"
"github.com/kubeshop/botkube/pkg/loggerx"
"log"
"os"
"os/exec"
"strings"

"github.com/kubeshop/botkube/pkg/loggerx"

"github.com/mattn/go-shellwords"
)

Expand Down
3 changes: 2 additions & 1 deletion hack/target/gen-goreleaser/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package main

import (
"fmt"
"github.com/kubeshop/botkube/pkg/loggerx"
"os"
"text/template"

"github.com/kubeshop/botkube/pkg/loggerx"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/analytics/segment_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/kubeshop/botkube/pkg/ptr"
"time"

segment "github.com/segmentio/analytics-go"
Expand All @@ -15,6 +14,7 @@ import (

"github.com/kubeshop/botkube/internal/analytics/batched"
"github.com/kubeshop/botkube/pkg/config"
"github.com/kubeshop/botkube/pkg/ptr"
"github.com/kubeshop/botkube/pkg/version"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/analytics/segment_reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/kubeshop/botkube/pkg/loggerx"
"sync"
"testing"
"time"
Expand All @@ -30,6 +29,7 @@ import (
"github.com/kubeshop/botkube/internal/analytics"
"github.com/kubeshop/botkube/pkg/config"
"github.com/kubeshop/botkube/pkg/execute/command"
"github.com/kubeshop/botkube/pkg/loggerx"
"github.com/kubeshop/botkube/pkg/version"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/analytics/segment_reporter.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package analytics

import (
"github.com/kubeshop/botkube/pkg/loggerx"
"runtime"

"github.com/denisbrodbeck/machineid"
Expand All @@ -11,6 +10,7 @@ import (

"github.com/kubeshop/botkube/internal/analytics"
"github.com/kubeshop/botkube/internal/cli"
"github.com/kubeshop/botkube/pkg/loggerx"
)

var _ Reporter = &SegmentReporter{}
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/config/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"github.com/kubeshop/botkube/pkg/ptr"
"os"
"strings"
"time"
Expand All @@ -28,6 +27,7 @@ import (
"github.com/kubeshop/botkube/internal/cli/printer"
"github.com/kubeshop/botkube/internal/config/remote"
"github.com/kubeshop/botkube/pkg/formatx"
"github.com/kubeshop/botkube/pkg/ptr"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/helmx/action_cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package helmx

import (
"fmt"
"github.com/kubeshop/botkube/pkg/ptr"

"helm.sh/helm/v3/pkg/action"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/client-go/rest"

"github.com/kubeshop/botkube/internal/cli"
"github.com/kubeshop/botkube/pkg/ptr"
)

const helmDriver = "secrets"
Expand Down
3 changes: 2 additions & 1 deletion internal/cli/install/helm/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package helm

import (
"fmt"
"github.com/kubeshop/botkube/pkg/httpx"
"io"
"net/url"

"github.com/pkg/errors"
"helm.sh/helm/v3/pkg/repo"
"sigs.k8s.io/yaml"

"github.com/kubeshop/botkube/pkg/httpx"
)

// GetLatestVersion loads an index file and returns version of the latest chart. Sort by SemVer.
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/migrate/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package migrate
import (
"encoding/json"
"fmt"
"github.com/kubeshop/botkube/pkg/ptr"
"strings"

"github.com/xyproto/randomstring"

gqlModel "github.com/kubeshop/botkube/internal/remote/graphql"
bkconfig "github.com/kubeshop/botkube/pkg/config"
"github.com/kubeshop/botkube/pkg/multierror"
"github.com/kubeshop/botkube/pkg/ptr"
)

// Converter converts OS config into GraphQL create input.
Expand Down
3 changes: 2 additions & 1 deletion internal/command/guard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ package command

import (
"errors"
"github.com/kubeshop/botkube/pkg/loggerx"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/discovery"

"github.com/kubeshop/botkube/pkg/loggerx"
)

func TestCommandGuard_GetAllowedResourcesForVerb(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/config/reloader/in_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package reloader

import (
"context"
"github.com/kubeshop/botkube/pkg/loggerx"
"sync"
"testing"
"time"
Expand All @@ -22,6 +21,7 @@ import (

"github.com/kubeshop/botkube/internal/analytics"
"github.com/kubeshop/botkube/pkg/config"
"github.com/kubeshop/botkube/pkg/loggerx"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion internal/config/reloader/remote_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package reloader

import (
"github.com/kubeshop/botkube/pkg/loggerx"
"testing"
"time"

Expand All @@ -10,6 +9,7 @@ import (
"github.com/stretchr/testify/require"

"github.com/kubeshop/botkube/pkg/config"
"github.com/kubeshop/botkube/pkg/loggerx"
)

func TestRemote_ProcessConfig(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/config/reloader/restarter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package reloader_test
import (
"context"
"fmt"
"github.com/kubeshop/botkube/pkg/loggerx"
"testing"

"github.com/stretchr/testify/assert"
Expand All @@ -14,6 +13,7 @@ import (

"github.com/kubeshop/botkube/internal/config/reloader"
"github.com/kubeshop/botkube/pkg/config"
"github.com/kubeshop/botkube/pkg/loggerx"
)

func TestRestarter_Do_HappyPath(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/executor/doctor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
_ "embed"
"errors"
"fmt"
"github.com/kubeshop/botkube/pkg/loggerx"
"regexp"
"strings"
"sync"
Expand All @@ -17,6 +16,7 @@ import (
"github.com/kubeshop/botkube/pkg/api"
"github.com/kubeshop/botkube/pkg/api/executor"
"github.com/kubeshop/botkube/pkg/config"
"github.com/kubeshop/botkube/pkg/loggerx"
"github.com/kubeshop/botkube/pkg/pluginx"
)

Expand Down
3 changes: 2 additions & 1 deletion internal/executor/flux/diff_ks_cmd_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package flux

import (
"github.com/kubeshop/botkube/pkg/loggerx"
"testing"
"time"

"github.com/stretchr/testify/assert"

"github.com/kubeshop/botkube/pkg/loggerx"
)

func TestNewKustomizeDiffCmd(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/executor/flux/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
_ "embed"
"fmt"
loggerx2 "github.com/kubeshop/botkube/pkg/loggerx"

"github.com/allegro/bigcache/v3"

Expand All @@ -14,6 +13,7 @@ import (
"github.com/kubeshop/botkube/internal/executor/x/state"
"github.com/kubeshop/botkube/pkg/api"
"github.com/kubeshop/botkube/pkg/api/executor"
"github.com/kubeshop/botkube/pkg/loggerx"
"github.com/kubeshop/botkube/pkg/pluginx"
)

Expand Down Expand Up @@ -100,7 +100,7 @@ func (d *Executor) Execute(ctx context.Context, in executor.ExecuteInput) (execu
return executor.ExecuteOutput{}, fmt.Errorf("while merging input configuration: %w", err)
}

log := loggerx2.New(cfg.Logger)
log := loggerx.New(cfg.Logger)

kubeConfigPath, deleteFn, err := pluginx.PersistKubeConfig(ctx, in.Context.KubeConfig)
if err != nil {
Expand Down Expand Up @@ -165,7 +165,7 @@ func (d *Executor) Help(context.Context) (api.Message, error) {
return api.Message{}, fmt.Errorf("while registering message renderers: %v", err)
}

runner := x.NewRunner(loggerx2.NewNoop(), renderer)
runner := x.NewRunner(loggerx.NewNoop(), renderer)

templates, err := commands.LoadTemplates()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/executor/kubectl/builder/kubectl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package builder_test
import (
"context"
"errors"
"github.com/kubeshop/botkube/pkg/loggerx"
"testing"

"github.com/slack-go/slack"
Expand All @@ -16,6 +15,7 @@ import (
"github.com/kubeshop/botkube/internal/executor/kubectl/builder"
"github.com/kubeshop/botkube/pkg/api"
"github.com/kubeshop/botkube/pkg/execute/kubectl"
"github.com/kubeshop/botkube/pkg/loggerx"
)

const (
Expand Down
Loading

0 comments on commit 0db81f4

Please sign in to comment.