Skip to content

Commit

Permalink
Merge branch 'master' into fix-in-cluster-disable
Browse files Browse the repository at this point in the history
  • Loading branch information
agaudreault authored Jan 3, 2025
2 parents 223171a + 4723abd commit ac39de3
Show file tree
Hide file tree
Showing 373 changed files with 20,122 additions and 2,738 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
# renovate: datasource=go packageName=github.com/golangci/golangci-lint versioning=regex:^v(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)?$
version: v1.62.2
version: v1.63.3
args: --verbose

test-go:
Expand Down
89 changes: 86 additions & 3 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ linters:
- gocritic
- gofumpt
- goimports
- gomodguard
- gosimple
- govet
- importas
- ineffassign
- misspell
- perfsprint
- revive
- staticcheck
- testifylint
- thelper
Expand All @@ -40,17 +43,97 @@ linters-settings:
- typeSwitchVar
goimports:
local-prefixes: github.com/argoproj/argo-cd/v2
gomodguard:
blocked:
modules:
- github.com/golang-jwt/jwt/v4:
recommendations:
- github.com/golang-jwt/jwt/v5
- github.com/pkg/errors:
recommendations:
- errors
importas:
alias:
- alias: jwtgo
pkg: github.com/golang-jwt/jwt/v5
- alias: metav1
pkg: k8s.io/apimachinery/pkg/apis/meta/v1
- alias: stderrors
pkg: errors
perfsprint:
# Optimizes even if it requires an int or uint type cast.
int-conversion: true
# Optimizes into `err.Error()` even if it is only equivalent for non-nil errors.
err-error: false
err-error: true
# Optimizes `fmt.Errorf`.
errorf: false
errorf: true
# Optimizes `fmt.Sprintf` with only one argument.
sprintf1: true
# Optimizes into strings concatenation.
strconcat: false
strconcat: true
revive:
rules:
# Blank import should be only in a main or test package, or have a comment justifying it.
- name: blank-imports
disabled: true
# context.Context() should be the first parameter of a function when provided as argument.
- name: context-as-argument
disabled: true
# Basic types should not be used as a key in `context.WithValue`
- name: context-keys-type
disabled: true
# Importing with `.` makes the programs much harder to understand
- name: dot-imports
disabled: true
# Empty blocks make code less readable and could be a symptom of a bug or unfinished refactoring.
- name: empty-block
disabled: true
# for better readability, variables of type `error` must be named with the prefix `err`.
- name: error-naming
disabled: true
# for better readability, the errors should be last in the list of returned values by a function.
- name: error-return
# for better readability, error messages should not be capitalized or end with punctuation or a newline.
- name: error-strings
disabled: true
# report when replacing `errors.New(fmt.Sprintf())` with `fmt.Errorf()` is possible
- name: errorf
# incrementing an integer variable by 1 is recommended to be done using the `++` operator
- name: increment-decrement
disabled: true
# highlights redundant else-blocks that can be eliminated from the code
- name: indent-error-flow
disabled: true
# This rule suggests a shorter way of writing ranges that do not use the second value.
- name: range
# receiver names in a method should reflect the struct name (p for Person, for example)
- name: receiver-naming
disabled: true
# redefining built in names (true, false, append, make) can lead to bugs very difficult to detect.
- name: redefines-builtin-id
disabled: true
# redundant else-blocks that can be eliminated from the code.
- name: superfluous-else
disabled: true
# prevent confusing name for variables when using `time` package
- name: time-naming
disabled: true
# warns when an exported function or method returns a value of an un-exported type.
- name: unexported-return
disabled: true
# spots and proposes to remove unreachable code. also helps to spot errors
- name: unreachable-code
# Functions or methods with unused parameters can be a symptom of an unfinished refactoring or a bug.
- name: unused-parameter
disabled: true
# Since Go 1.18, interface{} has an alias: any. This rule proposes to replace instances of interface{} with any.
- name: use-any
# report when a variable declaration can be simplified
- name: var-declaration
disabled: true
# warns when initialism, variable or package naming conventions are not followed.
- name: var-naming
disabled: true
testifylint:
enable-all: true
disable:
Expand Down
1 change: 1 addition & 0 deletions USERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [Devopsi - Poland Software/DevOps Consulting](https://devopsi.pl/)
1. [Devtron Labs](https://github.com/devtron-labs/devtron)
1. [DigitalOcean](https://www.digitalocean.com)
1. [Divar](https://divar.ir)
1. [Divistant](https://divistant.com)
1. [Dott](https://ridedott.com)
1. [Doximity](https://www.doximity.com/)
Expand Down
9 changes: 5 additions & 4 deletions applicationset/controllers/applicationset_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package controllers
import (
"context"
"encoding/json"
"errors"
"fmt"
"strconv"
"testing"
Expand Down Expand Up @@ -1864,7 +1865,7 @@ func TestRequeueGeneratorFails(t *testing.T) {
generatorMock.On("GetTemplate", &generator).
Return(&v1alpha1.ApplicationSetTemplate{})
generatorMock.On("GenerateParams", &generator, mock.AnythingOfType("*v1alpha1.ApplicationSet"), mock.Anything).
Return([]map[string]interface{}{}, fmt.Errorf("Simulated error generating params that could be related to an external service/API call"))
Return([]map[string]any{}, errors.New("Simulated error generating params that could be related to an external service/API call"))

metrics := appsetmetrics.NewFakeAppsetMetrics(client)

Expand Down Expand Up @@ -1969,7 +1970,7 @@ func TestValidateGeneratedApplications(t *testing.T) {
},
},
},
validationErrors: map[int]error{0: fmt.Errorf("application destination spec is invalid: application destination can't have both name and server defined: my-cluster my-server")},
validationErrors: map[int]error{0: errors.New("application destination spec is invalid: application destination can't have both name and server defined: my-cluster my-server")},
},
{
name: "project mismatch should return error",
Expand All @@ -1991,7 +1992,7 @@ func TestValidateGeneratedApplications(t *testing.T) {
},
},
},
validationErrors: map[int]error{0: fmt.Errorf("application references project DOES-NOT-EXIST which does not exist")},
validationErrors: map[int]error{0: errors.New("application references project DOES-NOT-EXIST which does not exist")},
},
{
name: "valid app should return true",
Expand Down Expand Up @@ -2035,7 +2036,7 @@ func TestValidateGeneratedApplications(t *testing.T) {
},
},
},
validationErrors: map[int]error{0: fmt.Errorf("application destination spec is invalid: unable to find destination server: there are no clusters with this name: nonexistent-cluster")},
validationErrors: map[int]error{0: errors.New("application destination spec is invalid: unable to find destination server: there are no clusters with this name: nonexistent-cluster")},
},
} {
t.Run(cc.name, func(t *testing.T) {
Expand Down
Loading

0 comments on commit ac39de3

Please sign in to comment.