Skip to content

Commit 85b3a25

Browse files
committed
Merge branch 'develop' into api-token-hide-via-flag
2 parents 507922a + 775450b commit 85b3a25

File tree

14 files changed

+72
-41
lines changed

14 files changed

+72
-41
lines changed

client/argocdServer/ArgoClientWrapperService.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
2929
"github.com/caarlos0/env"
3030
"github.com/devtron-labs/common-lib/async"
31+
"github.com/devtron-labs/common-lib/utils/retryFunc"
3132
"github.com/devtron-labs/devtron/client/argocdServer/adapter"
3233
"github.com/devtron-labs/devtron/client/argocdServer/application"
3334
"github.com/devtron-labs/devtron/client/argocdServer/bean"
@@ -41,7 +42,6 @@ import (
4142
"github.com/devtron-labs/devtron/internal/util"
4243
"github.com/devtron-labs/devtron/pkg/deployment/gitOps/config"
4344
"github.com/devtron-labs/devtron/pkg/deployment/gitOps/git"
44-
"github.com/devtron-labs/devtron/util/retryFunc"
4545
"go.opentelemetry.io/otel"
4646
"go.uber.org/zap"
4747
"google.golang.org/grpc"

env_gen.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@
2929
| VALIDATE_EXT_APP_CHART_TYPE | bool |false | validate external flux app chart | | false |
3030

3131

32+
## CI_BUILDX Related Environment Variables
33+
| Key | Type | Default Value | Description | Example | Deprecated |
34+
|-------|----------|-------------------|-------------------|-----------------------|------------------|
35+
| ASYNC_BUILDX_CACHE_EXPORT | bool |false | To enable async container image cache export | | false |
36+
| BUILDX_CACHE_MODE_MIN | bool |false | To set build cache mode to minimum in buildx | | false |
37+
| BUILDX_INTERRUPTION_MAX_RETRY | int |3 | Maximum number of retries for buildx builder interruption | | false |
38+
39+
3240
## CI_RUNNER Related Environment Variables
3341
| Key | Type | Default Value | Description | Example | Deprecated |
3442
|-------|----------|-------------------|-------------------|-----------------------|------------------|
@@ -140,10 +148,8 @@
140148
| ARGO_GIT_COMMIT_RETRY_DELAY_ON_CONFLICT | int |1 | Delay on retrying the maifest commit the on gitops | | false |
141149
| ARGO_REPO_REGISTER_RETRY_COUNT | int |4 | Retry count for registering a GitOps repository to ArgoCD | 3 | false |
142150
| ARGO_REPO_REGISTER_RETRY_DELAY | int |5 | Delay (in Seconds) between the retries for registering a GitOps repository to ArgoCD | 5 | false |
143-
| ASYNC_BUILDX_CACHE_EXPORT | bool |false | To enable async container image cache export | | false |
144151
| BATCH_SIZE | int |5 | there is feature to get URL's of services/ingresses. so to extract those, we need to parse all the servcie and ingress objects of the application. this BATCH_SIZE flag controls the no of these objects get parsed in one go. | | false |
145152
| BLOB_STORAGE_ENABLED | bool |false | | | false |
146-
| BUILDX_CACHE_MODE_MIN | bool |false | To set build cache mode to minimum in buildx | | false |
147153
| CD_HOST | string |localhost | Host for the devtron stack | | false |
148154
| CD_NAMESPACE | string |devtroncd | | | false |
149155
| CD_PORT | string |8000 | Port for pre/post-cd | | false |

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ require (
324324
replace (
325325
github.com/argoproj/argo-workflows/v3 v3.5.13 => github.com/devtron-labs/argo-workflows/v3 v3.5.13
326326
github.com/cyphar/filepath-securejoin v0.4.1 => github.com/cyphar/filepath-securejoin v0.3.6 // indirect
327-
github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250707110047-5ce1ce150a76
328-
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250707110047-5ce1ce150a76
327+
github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250708133124-d0285b3c0de2
328+
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708133124-d0285b3c0de2
329329
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 => go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1
330330
)

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,10 @@ github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc h1:VRRKCwnzq
237237
github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
238238
github.com/devtron-labs/argo-workflows/v3 v3.5.13 h1:3pINq0gXOSeTw2z/vYe+j80lRpSN5Rp/8mfQORh8SmU=
239239
github.com/devtron-labs/argo-workflows/v3 v3.5.13/go.mod h1:/vqxcovDPT4zqr4DjR5v7CF8ggpY1l3TSa2CIG3jmjA=
240-
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250707110047-5ce1ce150a76 h1:382wKs9a8Fpz2wK5egWhLKpI4a5i2iThvcWVL1Y6Rvk=
241-
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250707110047-5ce1ce150a76/go.mod h1:9LCkYfiWaEKIBkmxw9jX1GujvEMyHwmDtVsatffAkeU=
242-
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250707110047-5ce1ce150a76 h1:Oxx073Vec7hW3JPNsWsZGyC3gULHVluLKTLEfXgjfeY=
243-
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250707110047-5ce1ce150a76/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA=
240+
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250708133124-d0285b3c0de2 h1:DVZudmuKWuWGEUN3DoMpYDBGIk7dWQSdubx8ixKZZh4=
241+
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250708133124-d0285b3c0de2/go.mod h1:9LCkYfiWaEKIBkmxw9jX1GujvEMyHwmDtVsatffAkeU=
242+
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708133124-d0285b3c0de2 h1:g2Zee/3lL8lOtOieDDnHYD/h00JPFpEdP6uu3FAzKx4=
243+
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708133124-d0285b3c0de2/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA=
244244
github.com/devtron-labs/go-bitbucket v0.9.60-beta h1:VEx1jvDgdtDPS6A1uUFoaEi0l1/oLhbr+90xOwr6sDU=
245245
github.com/devtron-labs/go-bitbucket v0.9.60-beta/go.mod h1:GnuiCesvh8xyHeMCb+twm8lBR/kQzJYSKL28ZfObp1Y=
246246
github.com/devtron-labs/protos v0.0.3-0.20250323220609-ecf8a0f7305e h1:U6UdYbW8a7xn5IzFPd8cywjVVPfutGJCudjePAfL/Hs=

pkg/build/trigger/HandlerService.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ type HandlerService interface {
8686
DownloadCiWorkflowArtifacts(pipelineId int, buildId int) (*os.File, error)
8787
}
8888

89-
type BuildxCacheFlags struct {
90-
BuildxCacheModeMin bool `env:"BUILDX_CACHE_MODE_MIN" envDefault:"false" description:"To set build cache mode to minimum in buildx" `
91-
AsyncBuildxCacheExport bool `env:"ASYNC_BUILDX_CACHE_EXPORT" envDefault:"false" description:"To enable async container image cache export"`
89+
// CATEGORY=CI_BUILDX
90+
type BuildxGlobalFlags struct {
91+
BuildxCacheModeMin bool `env:"BUILDX_CACHE_MODE_MIN" envDefault:"false" description:"To set build cache mode to minimum in buildx" `
92+
AsyncBuildxCacheExport bool `env:"ASYNC_BUILDX_CACHE_EXPORT" envDefault:"false" description:"To enable async container image cache export"`
93+
BuildxInterruptionMaxRetry int `env:"BUILDX_INTERRUPTION_MAX_RETRY" envDefault:"3" description:"Maximum number of retries for buildx builder interruption"`
9294
}
9395

9496
type HandlerServiceImpl struct {
@@ -107,7 +109,7 @@ type HandlerServiceImpl struct {
107109
config *types.CiConfig
108110
scopedVariableManager variables.ScopedVariableManager
109111
ciCdPipelineOrchestrator pipeline2.CiCdPipelineOrchestrator
110-
buildxCacheFlags *BuildxCacheFlags
112+
buildxGlobalFlags *BuildxGlobalFlags
111113
attributeService attributes.AttributesService
112114
pluginInputVariableParser pipeline2.PluginInputVariableParser
113115
globalPluginService plugin.GlobalPluginService
@@ -149,10 +151,10 @@ func NewHandlerServiceImpl(Logger *zap.SugaredLogger, workflowService executor.W
149151
asyncRunnable *async.Runnable,
150152
workflowTriggerAuditService auditService.WorkflowTriggerAuditService,
151153
) *HandlerServiceImpl {
152-
buildxCacheFlags := &BuildxCacheFlags{}
154+
buildxCacheFlags := &BuildxGlobalFlags{}
153155
err := env.Parse(buildxCacheFlags)
154156
if err != nil {
155-
Logger.Infow("error occurred while parsing BuildxCacheFlags env,so setting BuildxCacheModeMin and AsyncBuildxCacheExport to default value", "err", err)
157+
Logger.Infow("error occurred while parsing BuildxGlobalFlags env,so setting BuildxCacheModeMin and AsyncBuildxCacheExport to default value", "err", err)
156158
}
157159
cis := &HandlerServiceImpl{
158160
Logger: Logger,
@@ -169,7 +171,7 @@ func NewHandlerServiceImpl(Logger *zap.SugaredLogger, workflowService executor.W
169171
scopedVariableManager: scopedVariableManager,
170172
customTagService: customTagService,
171173
ciCdPipelineOrchestrator: ciCdPipelineOrchestrator,
172-
buildxCacheFlags: buildxCacheFlags,
174+
buildxGlobalFlags: buildxCacheFlags,
173175
attributeService: attributeService,
174176
pluginInputVariableParser: pluginInputVariableParser,
175177
globalPluginService: globalPluginService,
@@ -867,9 +869,9 @@ func (impl *HandlerServiceImpl) StartCiWorkflowAndPrepareWfRequest(trigger *type
867869
} else {
868870
workflowRequest.Type = pipelineConfigBean.CI_WORKFLOW_PIPELINE_TYPE
869871
}
870-
workflowRequest, err = impl.updateWorkflowRequestWithBuildCacheData(workflowRequest, scope)
872+
workflowRequest, err = impl.updateWorkflowRequestWithBuildxFlags(workflowRequest, scope)
871873
if err != nil {
872-
impl.Logger.Errorw("error, updateWorkflowRequestWithBuildCacheData", "workflowRequest", workflowRequest, "err", err)
874+
impl.Logger.Errorw("error, updateWorkflowRequestWithBuildxFlags", "workflowRequest", workflowRequest, "err", err)
873875
return nil, nil, nil, err
874876
}
875877
if impl.canSetK8sDriverData(workflowRequest) {

pkg/build/trigger/HandlerService_ent.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ func (impl *HandlerServiceImpl) updateWorkflowRequestWithEntSupportData(workflow
6565
return workflowRequest
6666
}
6767

68-
func (impl *HandlerServiceImpl) updateWorkflowRequestWithBuildCacheData(workflowRequest *types.WorkflowRequest,
68+
func (impl *HandlerServiceImpl) updateWorkflowRequestWithBuildxFlags(workflowRequest *types.WorkflowRequest,
6969
scope resourceQualifiers.Scope) (*types.WorkflowRequest, error) {
70-
workflowRequest.BuildxCacheModeMin = impl.buildxCacheFlags.BuildxCacheModeMin
71-
workflowRequest.AsyncBuildxCacheExport = impl.buildxCacheFlags.AsyncBuildxCacheExport
70+
workflowRequest.BuildxCacheModeMin = impl.buildxGlobalFlags.BuildxCacheModeMin
71+
workflowRequest.AsyncBuildxCacheExport = impl.buildxGlobalFlags.AsyncBuildxCacheExport
72+
workflowRequest.BuildxInterruptionMaxRetry = impl.buildxGlobalFlags.BuildxInterruptionMaxRetry
7273
return workflowRequest, nil
7374
}
7475

pkg/deployment/gitOps/git/GitOperationService.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ package git
1818

1919
import (
2020
"context"
21-
"errors"
2221
"fmt"
22+
"github.com/devtron-labs/common-lib/utils/retryFunc"
2323
bean2 "github.com/devtron-labs/devtron/api/bean"
2424
apiBean "github.com/devtron-labs/devtron/api/bean/gitOps"
2525
"github.com/devtron-labs/devtron/internal/util"
@@ -28,7 +28,6 @@ import (
2828
"github.com/devtron-labs/devtron/pkg/deployment/gitOps/config"
2929
"github.com/devtron-labs/devtron/pkg/deployment/gitOps/git/bean"
3030
globalUtil "github.com/devtron-labs/devtron/util"
31-
"github.com/devtron-labs/devtron/util/retryFunc"
3231
dirCopy "github.com/otiai10/copy"
3332
"go.opentelemetry.io/otel"
3433
"go.uber.org/zap"
@@ -284,10 +283,7 @@ func (impl *GitOperationServiceImpl) CommitValues(ctx context.Context, chartGitA
284283
}
285284

286285
func (impl *GitOperationServiceImpl) isRetryableGitCommitError(err error) bool {
287-
if retryErr := (&retryFunc.RetryableError{}); errors.As(err, &retryErr) {
288-
return true
289-
}
290-
return false
286+
return retryFunc.IsRetryableError(err)
291287
}
292288

293289
func (impl *GitOperationServiceImpl) CreateRepository(ctx context.Context, dto *apiBean.GitOpsConfigDto, userId int32) (string, bool, bool, error) {

pkg/deployment/gitOps/git/GitServiceAzure.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ import (
2121
"crypto/tls"
2222
"errors"
2323
"fmt"
24+
"github.com/devtron-labs/common-lib/utils/retryFunc"
2425
bean2 "github.com/devtron-labs/devtron/api/bean/gitOps"
2526
"github.com/devtron-labs/devtron/pkg/deployment/gitOps/git/bean"
2627
globalUtil "github.com/devtron-labs/devtron/util"
2728
"github.com/devtron-labs/devtron/util/gitUtil"
28-
"github.com/devtron-labs/devtron/util/retryFunc"
2929
"github.com/microsoft/azure-devops-go-api/azuredevops"
3030
"github.com/microsoft/azure-devops-go-api/azuredevops/git"
3131
"go.uber.org/zap"

pkg/deployment/gitOps/git/GitServiceBitbucket.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ import (
2121
"crypto/tls"
2222
"errors"
2323
"fmt"
24+
"github.com/devtron-labs/common-lib/utils/retryFunc"
2425
bean2 "github.com/devtron-labs/devtron/api/bean/gitOps"
2526
"github.com/devtron-labs/devtron/pkg/deployment/gitOps/git/bean"
2627
"github.com/devtron-labs/devtron/util"
27-
"github.com/devtron-labs/devtron/util/retryFunc"
2828
"github.com/devtron-labs/go-bitbucket"
2929
"go.uber.org/zap"
3030
"io/ioutil"

pkg/deployment/gitOps/git/GitServiceGithub.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ import (
2121
"crypto/tls"
2222
"errors"
2323
"fmt"
24+
"github.com/devtron-labs/common-lib/utils/retryFunc"
2425
"github.com/devtron-labs/common-lib/utils/runTime"
2526
bean2 "github.com/devtron-labs/devtron/api/bean/gitOps"
2627
"github.com/devtron-labs/devtron/pkg/deployment/gitOps/git/bean"
2728
globalUtil "github.com/devtron-labs/devtron/util"
28-
"github.com/devtron-labs/devtron/util/retryFunc"
2929
"github.com/google/go-github/github"
3030
"go.uber.org/zap"
3131
"golang.org/x/oauth2"

0 commit comments

Comments
 (0)