Skip to content

Commit

Permalink
chore: extract code to new library (#1109)
Browse files Browse the repository at this point in the history
* chore: remove code extracted to lib
* chore: replace internal refs with lib refs
* chore: remove disused make targets and scripts
* chore: downgrade color and strip color

Downgrade fatih/color to keep the 1.15 space insertion behavior.

Strip color from command output in tests for simpler string comparison.

* chore: get github.com/kong/go-database-reconciler@v1.0.0
  • Loading branch information
rainest committed Nov 22, 2023
1 parent f7e0a17 commit 254aff8
Show file tree
Hide file tree
Showing 213 changed files with 82 additions and 38,945 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ jobs:
go-version: '^1.20'
- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v3.7.0
- name: Verify Codegen
run: make verify-codegen
- name: Run tests with Coverage
run: make coverage
- name: Upload Code Coverage
Expand Down
12 changes: 1 addition & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ lint:
build:
CGO_ENABLED=0 go build -o deck main.go

.PHONY: verify-codegen
verify-codegen:
./scripts/verify-codegen.sh
./scripts/verify-deepcopy-gen.sh

.PHONY: update-codegen
update-codegen:
./scripts/update-deepcopy-gen.sh
go generate ./...

.PHONY: coverage
coverage:
go test -race -v -count=1 -coverprofile=coverage.out.tmp ./...
Expand All @@ -49,4 +39,4 @@ setup-kong-ee:
test-integration:
go test -v -count=1 -tags=integration \
-race \
./tests/integration/...
./tests/integration/...
12 changes: 6 additions & 6 deletions cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
"sort"

"github.com/blang/semver/v4"
"github.com/kong/deck/cprint"
"github.com/kong/deck/diff"
"github.com/kong/deck/dump"
"github.com/kong/deck/file"
"github.com/kong/deck/state"
"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/cprint"
"github.com/kong/go-database-reconciler/pkg/diff"
"github.com/kong/go-database-reconciler/pkg/dump"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/kong/go-database-reconciler/pkg/state"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/kong/go-kong/kong"
"github.com/spf13/cobra"
)
Expand Down
12 changes: 6 additions & 6 deletions cmd/common_konnect.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"os"
"strings"

"github.com/kong/deck/diff"
"github.com/kong/deck/dump"
"github.com/kong/deck/file"
"github.com/kong/deck/konnect"
"github.com/kong/deck/state"
"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/diff"
"github.com/kong/go-database-reconciler/pkg/dump"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/kong/go-database-reconciler/pkg/konnect"
"github.com/kong/go-database-reconciler/pkg/state"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/kong/go-kong/kong"
"golang.org/x/sync/errgroup"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/common_konnect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"testing"

"github.com/kong/deck/konnect"
"github.com/kong/go-database-reconciler/pkg/konnect"
"github.com/kong/go-kong/kong"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"reflect"
"testing"

"github.com/kong/deck/dump"
"github.com/kong/deck/file"
"github.com/kong/go-database-reconciler/pkg/dump"
"github.com/kong/go-database-reconciler/pkg/file"
)

func TestDetermineSelectorTag(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions cmd/file_convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"strings"

"github.com/kong/deck/convert"
"github.com/kong/deck/cprint"
"github.com/kong/deck/file"
"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/cprint"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/file_render.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"

"github.com/kong/deck/convert"
"github.com/kong/deck/file"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/spf13/cobra"
)

Expand Down
8 changes: 4 additions & 4 deletions cmd/gateway_dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"os"
"strings"

"github.com/kong/deck/dump"
"github.com/kong/deck/file"
"github.com/kong/deck/state"
"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/dump"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/kong/go-database-reconciler/pkg/state"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/kong/go-kong/kong"
"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/gateway_ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"os"

"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/gateway_reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"os"

"github.com/kong/deck/state"
"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/state"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/spf13/cobra"
)

Expand Down
8 changes: 4 additions & 4 deletions cmd/gateway_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"fmt"
"os"

"github.com/kong/deck/dump"
"github.com/kong/deck/file"
"github.com/kong/deck/state"
"github.com/kong/deck/utils"
"github.com/kong/deck/validate"
"github.com/kong/go-database-reconciler/pkg/dump"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/kong/go-database-reconciler/pkg/state"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/kong/go-kong/kong"
"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/konnect.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/kong/deck/cprint"
"github.com/kong/go-database-reconciler/pkg/cprint"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/konnect_dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"strings"

"github.com/kong/deck/file"
"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/konnect_ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"fmt"

"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"strings"

"github.com/fatih/color"
"github.com/kong/deck/utils"
"github.com/kong/go-apiops/deckformat"
"github.com/kong/go-database-reconciler/pkg/utils"
homedir "github.com/mitchellh/go-homedir"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down
4 changes: 2 additions & 2 deletions cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package cmd

import (
"github.com/fatih/color"
"github.com/kong/deck/cprint"
"github.com/kong/deck/diff"
"github.com/kong/go-database-reconciler/pkg/cprint"
"github.com/kong/go-database-reconciler/pkg/diff"
"github.com/spf13/pflag"
)

Expand Down
10 changes: 5 additions & 5 deletions convert/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"strings"

"github.com/blang/semver/v4"
"github.com/kong/deck/cprint"
"github.com/kong/deck/dump"
"github.com/kong/deck/file"
"github.com/kong/deck/state"
"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/cprint"
"github.com/kong/go-database-reconciler/pkg/dump"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/kong/go-database-reconciler/pkg/state"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/kong/go-kong/kong"
)

Expand Down
4 changes: 2 additions & 2 deletions convert/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"reflect"
"testing"

"github.com/kong/deck/file"
"github.com/kong/deck/utils"
"github.com/kong/go-database-reconciler/pkg/file"
"github.com/kong/go-database-reconciler/pkg/utils"
"github.com/kong/go-kong/kong"
"github.com/stretchr/testify/assert"
)
Expand Down
77 changes: 0 additions & 77 deletions cprint/color.go

This file was deleted.

Loading

0 comments on commit 254aff8

Please sign in to comment.