Skip to content

Commit

Permalink
feat: update tools versions
Browse files Browse the repository at this point in the history
  • Loading branch information
JGiola committed Feb 9, 2024
1 parent f594ea9 commit 93ae199
Show file tree
Hide file tree
Showing 48 changed files with 84 additions and 86 deletions.
6 changes: 3 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "Go",
"image": "golang:1.21.6",
"image": "golang:1.21.7",
"containerUser": "root",
"features": {
"ghcr.io/devcontainers/features/common-utils:1": {},
"ghcr.io/devcontainers/features/go:1": {"version": "none", "golangciLintVersion": "1.55.2"}
"ghcr.io/devcontainers/features/common-utils:2": {},
"ghcr.io/devcontainers/features/go:1": {"version": "none", "golangciLintVersion": "1.56.1"}
},
"runArgs": [
"--cap-add=SYS_PTRACE",
Expand Down
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ updates:
interval: daily
time: "07:00"
timezone: Europe/Rome

# keep up to date devcontainers
- package-ecosystem: devcontainers
directory: "/"
schedule:
interval: monthly
11 changes: 2 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
- examples/**

env:
GORELEASER_VERSION: v1.23.0
GORELEASER_VERSION: v1.24.0
jobs:
lint:
name: Lint Code
Expand Down Expand Up @@ -45,20 +45,13 @@ jobs:
run: make ci-lint GOLANGCI_LINT_MODE="github-actions"

test:
name: Testing on ${{ matrix.os }} #and kubernetes ${{ matrix.k8s_version}}
name: Testing on ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
# k8s_version:
# - "1.25"
# - "1.26"
# - "1.27"
# - "1.28"
runs-on: ${{ matrix.os }}
# env:
# ENVTEST_K8S_VERSION: ${{matrix.k8s_version}}
steps:
- name: Checkout Repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ on:
- cron: 0 5 * * 1 # Run every monday at 5 UTC

env:
GORELEASER_VERSION: v1.23.0
GORELEASER_VERSION: v1.24.0

jobs:
codeql:
runs-on: ubuntu-latest
runs-on: macos-latest
permissions:
security-events: write
steps:
Expand Down
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.21.6
1.21.7
1 change: 0 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ builds:
{{- .Arch }}/
{{- with .Arm }}v{{ . }}/{{ end }}
{{- .ProjectName }}
no_unique_dist_dir: true
env:
- CGO_ENABLED=0
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repos:
name: Trims trailing whitespace
args: [--markdown-linebreak-ext=md] # add exception for markdown linebreaks
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.1
rev: v8.18.2
hooks:
- id: gitleaks
name: Protect and discover secrets using Gitleaks
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ endif
# Set here the name of the package you want to build
CMDNAME:= miactl
BUILD_PATH:= ./cmd/$(CMDNAME)
CONFORMANCE_TEST_PATH:= $(PROJECT_DIR)/internal/e2e
CONFORMANCE_TEST_PATH:= $(PROJECT_DIR)/tests/e2e
IS_LIBRARY:=

# enable modules
Expand Down
2 changes: 1 addition & 1 deletion internal/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func TestRequestServer5xx(t *testing.T) {

func testServerEnv(t *testing.T, statusCode int) *httptest.Server {
t.Helper()
fakeHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
fakeHandler := http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(statusCode)
w.Write([]byte("{}"))
})
Expand Down
2 changes: 1 addition & 1 deletion internal/client/request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestNewRequest(t *testing.T) {
func TestStreamRequest(t *testing.T) {
expectedBody := "expected body"

testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
flusher, ok := w.(http.Flusher)
if !ok {
panic("need flusher!")
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/company/iam/group/add_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func AddMemberCmd(options *clioptions.CLIOptions) *cobra.Command {
Long: "Add one or more users to a company group. The users can be added via their emails",

Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/company/iam/group/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func EditCmd(options *clioptions.CLIOptions) *cobra.Command {
Long: "Edit a group in a company",

Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/company/iam/group/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func RemoveCmd(options *clioptions.CLIOptions) *cobra.Command {
Long: "Remove a group from a company",

Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/company/iam/group/remove_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func RemoveMemberCmd(options *clioptions.CLIOptions) *cobra.Command {
Long: "Remove one or more users from a company group. The users can be removed via their ids",

Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
14 changes: 7 additions & 7 deletions internal/cmd/company/iam/group/remove_member_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,41 +32,41 @@ func TestRemoveGroupMember(t *testing.T) {
server *httptest.Server
companyID string
groupID string
userIds []string
userIDs []string
expectErr bool
}{
"remove member from group": {
server: removeGroupMemeberTestServer(t),
companyID: "success",
groupID: "group-id",
userIds: []string{"000000000000000000000001"},
userIDs: []string{"000000000000000000000001"},
},
"missing company": {
server: removeGroupMemeberTestServer(t),
companyID: "",
groupID: "group-id",
userIds: []string{"000000000000000000000001"},
userIDs: []string{"000000000000000000000001"},
expectErr: true,
},
"missing group id": {
server: removeGroupMemeberTestServer(t),
companyID: "success",
groupID: "",
userIds: []string{"000000000000000000000001"},
userIDs: []string{"000000000000000000000001"},
expectErr: true,
},
"missing user id": {
server: removeGroupMemeberTestServer(t),
companyID: "succes",
groupID: "group-id",
userIds: []string{},
userIDs: []string{},
expectErr: true,
},
"error from backend": {
server: removeGroupMemeberTestServer(t),
companyID: "fail",
groupID: "group-id",
userIds: []string{"000000000000000000000001"},
userIDs: []string{"000000000000000000000001"},
expectErr: true,
},
}
Expand All @@ -84,7 +84,7 @@ func TestRemoveGroupMember(t *testing.T) {
client,
testCase.companyID,
testCase.groupID,
testCase.userIds,
testCase.userIDs,
)

switch testCase.expectErr {
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/company/iam/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func ListCmd(options *clioptions.CLIOptions) *cobra.Command {
all of them noting the type and the current role associated with them`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down Expand Up @@ -88,7 +88,7 @@ func listEntity(options *clioptions.CLIOptions, commandName, shortHelp, longHelp
Short: shortHelp,
Long: longHelp,

RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/company/iam/serviceaccount/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func EditCmd(options *clioptions.CLIOptions) *cobra.Command {
Long: "Edit a service account in a company",

Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/company/iam/serviceaccount/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func RemoveCmd(options *clioptions.CLIOptions) *cobra.Command {
Long: "Remove a service account from a company",

Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/company/iam/user/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func AddCmd(options *clioptions.CLIOptions) *cobra.Command {
Long: "Add a user to a company",

Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/company/iam/user/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func EditCmd(options *clioptions.CLIOptions) *cobra.Command {
Long: "Edit a user in a company",

Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/company/iam/user/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func RemoveCmd(options *clioptions.CLIOptions) *cobra.Command {
Long: "Remove a user from a company",

Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/company/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func ListCmd(options *clioptions.CLIOptions) *cobra.Command {
Long: `List the companies that the current user can access.
Companies can be used to logically group projects by organizations or internal teams.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/context/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func AuthCmd(options *clioptions.CLIOptions) *cobra.Command {
Long: `Set an auth configuration for miactl. You can set service account access
and then attach it to one or more contexts.`,
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, args []string) error {
authName := args[0]
modified, err := setAuth(args[0], options)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/context/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func SetCmd(options *clioptions.CLIOptions) *cobra.Command {
Use: "set CONTEXT [flags]",
Short: "Set a context for miactl",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, args []string) error {
contextName := args[0]
modified, err := setContext(args[0], options)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/context/use.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func UseCmd(opts *clioptions.CLIOptions) *cobra.Command {
Use: "use CONTEXT [flags]",
Short: "Select a context to use",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, args []string) error {
locator := cliconfig.NewConfigPathLocator()
locator.ExplicitPath = opts.MiactlConfig
newContext := args[0]
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/environments/environments.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func listEnvironmentsCmd(o *clioptions.CLIOptions) *cobra.Command {
Use: "list",
Short: "List all environments for a given project id",
Long: "List all environments for a given project id",
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
restConfig, err := o.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/environments/environments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestListEnvironments(t *testing.T) {
projectID: projectID,
},
"error in list project call": {
testServer: testServer(t, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
testServer: testServer(t, http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusNotFound)
})),
companyID: companyID,
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/marketplace/apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func ApplyCmd(options *clioptions.CLIOptions) *cobra.Command {
Short: "Create or update Marketplace items",
Long: applyLong,
Example: applyExample,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/marketplace/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func DeleteCmd(options *clioptions.CLIOptions) *cobra.Command {
Short: "Delete a Marketplace item",
Long: long,
SuggestFor: []string{"rm"},
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/marketplace/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func GetCmd(options *clioptions.CLIOptions) *cobra.Command {
Use: use,
Short: "Get Marketplace item",
Long: long,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/marketplace/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func ListCmd(options *clioptions.CLIOptions) *cobra.Command {
}

func runListCmd(options *clioptions.CLIOptions) func(cmd *cobra.Command, args []string) {
return func(cmd *cobra.Command, args []string) {
return func(cmd *cobra.Command, _ []string) {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
apiClient, err := client.APIClientForConfig(restConfig)
Expand All @@ -66,7 +66,7 @@ func runListCmd(options *clioptions.CLIOptions) func(cmd *cobra.Command, args []
public: options.MarketplaceFetchPublicItems,
}

table, err := getMarketplaceItemsTable(context.Background(), apiClient, marketplaceItemsOptions)
table, err := getMarketplaceItemsTable(cmd.Context(), apiClient, marketplaceItemsOptions)
cobra.CheckErr(err)

fmt.Println(table)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/marketplace/list_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func ListVersionCmd(options *clioptions.CLIOptions) *cobra.Command {
The command will output a table with each version of the item.
This command is in ALPHA state. This means that it can be subject to breaking changes in the next versions of miactl.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/project/iam/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func ListCmd(options *clioptions.CLIOptions) *cobra.Command {
all of them noting the type and the current role associated with them`,

Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/project/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func ListCmd(options *clioptions.CLIOptions) *cobra.Command {
The company can be set via the dedicated flag, or it will be inferred from
the current context. If no company can be selected the command will return
an error.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
restConfig, err := options.ToRESTConfig()
cobra.CheckErr(err)
client, err := client.APIClientForConfig(restConfig)
Expand Down
Loading

0 comments on commit 93ae199

Please sign in to comment.