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

Update dependencies: upgrade Go to v1.22, goreleaser to 2.x, etc. #165

Merged
merged 7 commits into from
Jun 27, 2024
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
21 changes: 19 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
permissions:
contents: read

env:
GOPRIVATE: github.com/platformsh

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -22,7 +25,7 @@ jobs:
with:
# do not enable cache here, because golangci-linter
# has its own internal cache with better performance
go-version: 1.20.x
go-version: 1.22.x

- name: Create fake PHP and .phar files
run: |
Expand All @@ -35,7 +38,21 @@ jobs:
touch internal/legacy/archives/php_darwin_arm64
touch internal/config/embedded-config.yaml

- name: Add SSH Go Module Private Key
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.GO_MODULE_PRIVATE_KEY }}"
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV

- name: Setup access for private go modules
run: |
git config --global url."ssh://[email protected]/".insteadOf https://github.com/

- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: v1.52
version: v1.59
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ variables:

unit-test-lint:
stage: check
image: cimg/go:1.20
image: cimg/go:1.22
extends: .go-cache
script:
# Fake some files to avoid the compiler or "typecheck" linter complaining about a missing embedded file.
Expand Down Expand Up @@ -116,7 +116,7 @@ build-php-macos-x86:

build:
stage: build
image: cimg/go:1.20
image: cimg/go:1.22
extends: .go-cache
script:
- make single
Expand Down
14 changes: 4 additions & 10 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ linters-settings:
revive:
# minimal confidence for issues, default is 0.8
min-confidence: 0
govet:
# report about shadowed variables
check-shadowing: true
lll:
# max line length, lines longer will be reported. Default is 120.
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
Expand Down Expand Up @@ -117,6 +114,8 @@ linters:
- nolintlint
# Finds slice declarations that could potentially be preallocated
- prealloc
# Find code that shadows one of Go's predeclared identifiers.
- predeclared
# checks whether Err of rows is checked successfully
# rowserrcheck is disabled because of generics. See https://github.com/golangci/golangci-lint/issues/2649.
# - rowserrcheck
Expand All @@ -141,11 +140,6 @@ linters:
# Whitespace Linter - Forces you to use empty lines!
# - wsl

run:
skip-dirs:
issues:
exclude-dirs:
- vendor

# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.52.x # use the fixed version to not introduce new linters unexpectedly
8 changes: 4 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ brews:
- platform

goarm: "7"
folder: Formula
directory: Formula

commit_author:
name: Antonis Kalipetis
Expand Down Expand Up @@ -241,7 +241,7 @@ brews:
- upsun

goarm: "7"
folder: Formula
directory: Formula

commit_author:
name: Antonis Kalipetis
Expand Down Expand Up @@ -271,7 +271,7 @@ scoops:
ids:
- platform

folder: Scoops
directory: Scoops
commit_author:
name: Antonis Kalipetis
email: [email protected]
Expand All @@ -288,7 +288,7 @@ scoops:
ids:
- upsun

folder: Scoops
directory: Scoops
commit_author:
name: Antonis Kalipetis
email: [email protected]
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ PHP_BINARY_PATH := internal/legacy/archives/php_$(GOOS)_$(GOARCH)
VERSION := $(shell git describe --always)

# Tooling versions
GORELEASER_VERSION=v1.20
GOLANGCI_LINT_VERSION=v1.52
GORELEASER_VERSION=v2.0
GOLANGCI_LINT_VERSION=v1.59

internal/legacy/archives/platform.phar:
curl -L https://github.com/platformsh/legacy-cli/releases/download/v$(LEGACY_CLI_VERSION)/platform.phar -o internal/legacy/archives/platform.phar
Expand Down
10 changes: 5 additions & 5 deletions commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func newRootCommand(cnf *config.Config, assets *vendorization.VendorAssets) *cob
FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true},
SilenceUsage: true,
SilenceErrors: true,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
PersistentPreRun: func(cmd *cobra.Command, _ []string) {
if viper.GetBool("version") {
versionCommand.Run(cmd, []string{})
os.Exit(0)
Expand All @@ -63,7 +63,7 @@ func newRootCommand(cnf *config.Config, assets *vendorization.VendorAssets) *cob
}()
}
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
c := &legacy.CLIWrapper{
Config: cnf,
Version: version,
Expand All @@ -89,7 +89,7 @@ func newRootCommand(cnf *config.Config, assets *vendorization.VendorAssets) *cob
os.Exit(exitCode)
}
},
PersistentPostRun: func(cmd *cobra.Command, args []string) {
PersistentPostRun: func(_ *cobra.Command, _ []string) {
checkShellConfigLeftovers(cnf)
select {
case rel := <-updateMessageChan:
Expand Down Expand Up @@ -120,15 +120,15 @@ func newRootCommand(cnf *config.Config, assets *vendorization.VendorAssets) *cob
cmd.PersistentFlags().BoolP("verbose", "v", false, "Enable verbose output")

projectInitCmd := commands.NewPlatformifyCmd(assets)
projectInitCmd.SetHelpFunc(func(_ *cobra.Command, args []string) {
projectInitCmd.SetHelpFunc(func(_ *cobra.Command, _ []string) {
internalCmd := innerProjectInitCommand(cnf)
fmt.Println(internalCmd.HelpPage(cnf))
})

validateCmd := commands.NewValidateCommand(assets)
validateCmd.Use = "app:config-validate"
validateCmd.Aliases = []string{"validate"}
validateCmd.SetHelpFunc(func(_ *cobra.Command, args []string) {
validateCmd.SetHelpFunc(func(_ *cobra.Command, _ []string) {
internalCmd := innerAppConfigValidateCommand(cnf)
fmt.Println(internalCmd.HelpPage(cnf))
})
Expand Down
2 changes: 1 addition & 1 deletion commands/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func newVersionCommand(cnf *config.Config) *cobra.Command {
Use: "version",
Short: "Print the version number of the " + cnf.Application.Name,
FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
fmt.Fprintf(color.Output, "%s %s\n", cnf.Application.Name, color.CyanString(version))

if viper.GetBool("verbose") {
Expand Down
78 changes: 43 additions & 35 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,63 +1,71 @@
module github.com/platformsh/cli

go 1.20
go 1.22

toolchain go1.22.4

require (
github.com/fatih/color v1.13.0
github.com/go-playground/validator/v10 v10.14.1
github.com/fatih/color v1.17.0
github.com/go-playground/validator/v10 v10.20.0
github.com/gofrs/flock v0.8.1
github.com/mattn/go-isatty v0.0.16
github.com/platformsh/platformify v0.2.8
github.com/spf13/cobra v1.6.1
github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.4
github.com/wk8/go-ordered-map/v2 v2.1.7
golang.org/x/exp v0.0.0-20230321023759-10a507213a29
github.com/mattn/go-isatty v0.0.20
github.com/platformsh/platformify v0.2.9
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
github.com/wk8/go-ordered-map/v2 v2.1.8
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/AlecAivazis/survey/v2 v2.3.6 // indirect
github.com/AlecAivazis/survey/v2 v2.3.7 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.4 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/huandu/xstrings v1.5.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
)

// See https://github.com/darccio/mergo?tab=readme-ov-file#100
replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.16
Loading
Loading