Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a93ab0e
feat: added configurable retry for docker rebuild stage
Ash-exp Jun 23, 2025
e112c67
added vendor files
Ash-exp Jun 23, 2025
1949e9d
proper patch support for user attribute patch api with nested structure
prakash100198 Jun 25, 2025
2becf74
refactor
prakash100198 Jun 25, 2025
e4d3e78
refactor
prakash100198 Jun 25, 2025
ced1d93
Merge remote-tracking branch 'origin/develop' into fix/buildx-livenes…
Ash-exp Jul 2, 2025
065799b
chore: dependency updated to 'origin/fix/buildx-liveness-dailer'
Ash-exp Jul 2, 2025
5626600
fix: Notifier v1 removed (#6705)
prkhrkat Jul 4, 2025
8a5e234
Add `HIDE_API_TOKENS` config and pass `apiTokenConfig` to `ApiTokenSe…
prakash100198 Jul 4, 2025
c3696c9
refactoring
prakash100198 Jul 4, 2025
a6eb6b0
refactoring
prakash100198 Jul 4, 2025
5cfa33f
main sync develop
vikramdevtron Jul 7, 2025
cff9054
Merge pull request #6715 from devtron-labs/main-sync-develop-7july
vikramdevtron Jul 7, 2025
eaf1e50
Merge remote-tracking branch 'origin/main' into oss-main-sync-8-jul
Ash-exp Jul 8, 2025
44137a0
Merge pull request #6717 from devtron-labs/oss-main-sync-8-jul
Ash-exp Jul 8, 2025
fcbb193
Merge remote-tracking branch 'origin/develop' into fix/buildx-livenes…
Ash-exp Jul 8, 2025
341e4ce
refactoring
prakash100198 Jul 10, 2025
507922a
Merge branch 'develop' into api-token-hide-via-flag
prakash100198 Jul 10, 2025
775450b
Merge pull request #6687 from devtron-labs/fix/buildx-liveness-dailer
Ash-exp Jul 10, 2025
85b3a25
Merge branch 'develop' into api-token-hide-via-flag
prakash100198 Jul 11, 2025
dc216ce
make
prakash100198 Jul 11, 2025
d2b95d9
Merge pull request #6708 from devtron-labs/api-token-hide-via-flag
prakash100198 Jul 11, 2025
84c4c1e
Merge branch 'develop' into user-attribute-patch-fix
prakash100198 Jul 14, 2025
d0e7d20
make
prakash100198 Jul 14, 2025
7b8bb67
Merge pull request #6689 from devtron-labs/user-attribute-patch-fix
prakash100198 Jul 14, 2025
13238f0
Merge remote-tracking branch 'origin/main' into main-sync
iamayushm Jul 15, 2025
9e1b0f6
Merge pull request #6725 from devtron-labs/main-sync
iamayushm Jul 15, 2025
4dfe4f8
fix: Removing default value of idleReplicaCount (#6722)
YashasviDevtron Jul 15, 2025
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
7 changes: 4 additions & 3 deletions api/restHandler/UserAttributesRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package restHandler
import (
"encoding/json"
"errors"
"github.com/devtron-labs/devtron/pkg/attributes/bean"
"net/http"

"github.com/devtron-labs/devtron/api/restHandler/common"
Expand Down Expand Up @@ -108,15 +109,15 @@ func (handler *UserAttributesRestHandlerImpl) PatchUserAttributes(w http.Respons
common.WriteJsonResp(w, nil, resp, http.StatusOK)
}

func (handler *UserAttributesRestHandlerImpl) validateUserAttributesRequest(w http.ResponseWriter, r *http.Request, operation string) (*attributes.UserAttributesDto, bool) {
func (handler *UserAttributesRestHandlerImpl) validateUserAttributesRequest(w http.ResponseWriter, r *http.Request, operation string) (*bean.UserAttributesDto, bool) {
userId, err := handler.userService.GetLoggedInUser(r)
if userId == 0 || err != nil {
common.WriteJsonResp(w, err, "Unauthorized User", http.StatusUnauthorized)
return nil, false
}

decoder := json.NewDecoder(r.Body)
var dto attributes.UserAttributesDto
var dto bean.UserAttributesDto
err = decoder.Decode(&dto)
if err != nil {
handler.logger.Errorw("request err, "+operation, "err", err, "payload", dto)
Expand Down Expand Up @@ -158,7 +159,7 @@ func (handler *UserAttributesRestHandlerImpl) GetUserAttribute(w http.ResponseWr
return
}

dto := attributes.UserAttributesDto{}
dto := bean.UserAttributesDto{}

emailId, err := handler.userService.GetActiveEmailById(userId)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion client/argocdServer/ArgoClientWrapperService.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/caarlos0/env"
"github.com/devtron-labs/common-lib/async"
"github.com/devtron-labs/common-lib/utils/retryFunc"
"github.com/devtron-labs/devtron/client/argocdServer/adapter"
"github.com/devtron-labs/devtron/client/argocdServer/application"
"github.com/devtron-labs/devtron/client/argocdServer/bean"
Expand All @@ -41,7 +42,6 @@ import (
"github.com/devtron-labs/devtron/internal/util"
"github.com/devtron-labs/devtron/pkg/deployment/gitOps/config"
"github.com/devtron-labs/devtron/pkg/deployment/gitOps/git"
"github.com/devtron-labs/devtron/util/retryFunc"
"go.opentelemetry.io/otel"
"go.uber.org/zap"
"google.golang.org/grpc"
Expand Down
19 changes: 1 addition & 18 deletions client/events/EventClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import (
type EventClientConfig struct {
DestinationURL string `env:"EVENT_URL" envDefault:"http://localhost:3000/notify" description:"Notifier service url"`
NotificationMedium NotificationMedium `env:"NOTIFICATION_MEDIUM" envDefault:"rest" description:"notification medium"`
EnableNotifierV2 bool `env:"ENABLE_NOTIFIER_V2" envDefault:"false" description:"enable notifier v2"`
}
type NotificationMedium string

Expand Down Expand Up @@ -243,7 +242,7 @@ func (impl *EventRESTClientImpl) sendEvent(event Event) (bool, error) {
impl.logger.Debugw("event before send", "event", event)

// Step 1: Create payload and destination URL based on config
bodyBytes, destinationUrl, err := impl.createPayloadAndDestination(event)
bodyBytes, destinationUrl, err := impl.createV2PayloadAndDestination(event)
if err != nil {
return false, err
}
Expand All @@ -252,13 +251,6 @@ func (impl *EventRESTClientImpl) sendEvent(event Event) (bool, error) {
return impl.deliverEvent(bodyBytes, destinationUrl)
}

func (impl *EventRESTClientImpl) createPayloadAndDestination(event Event) ([]byte, string, error) {
if impl.config.EnableNotifierV2 {
return impl.createV2PayloadAndDestination(event)
}
return impl.createDefaultPayloadAndDestination(event)
}

func (impl *EventRESTClientImpl) createV2PayloadAndDestination(event Event) ([]byte, string, error) {
destinationUrl := impl.config.DestinationURL + "/v2"

Expand Down Expand Up @@ -302,15 +294,6 @@ func (impl *EventRESTClientImpl) createV2PayloadAndDestination(event Event) ([]b
return bodyBytes, destinationUrl, nil
}

func (impl *EventRESTClientImpl) createDefaultPayloadAndDestination(event Event) ([]byte, string, error) {
bodyBytes, err := json.Marshal(event)
if err != nil {
impl.logger.Errorw("error while marshaling event request", "err", err)
return nil, "", err
}
return bodyBytes, impl.config.DestinationURL, nil
}

func (impl *EventRESTClientImpl) processNotificationSettings(notificationSettings []repository.NotificationSettings) ([]*repository.NotificationSettingsBean, error) {
notificationSettingsBean := make([]*repository.NotificationSettingsBean, 0)
for _, item := range notificationSettings {
Expand Down
5 changes: 4 additions & 1 deletion cmd/external-app/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion env_gen.json

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions env_gen.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
| VALIDATE_EXT_APP_CHART_TYPE | bool |false | validate external flux app chart | | false |


## CI_BUILDX Related Environment Variables
| Key | Type | Default Value | Description | Example | Deprecated |
|-------|----------|-------------------|-------------------|-----------------------|------------------|
| ASYNC_BUILDX_CACHE_EXPORT | bool |false | To enable async container image cache export | | false |
| BUILDX_CACHE_MODE_MIN | bool |false | To set build cache mode to minimum in buildx | | false |
| BUILDX_INTERRUPTION_MAX_RETRY | int |3 | Maximum number of retries for buildx builder interruption | | false |


## CI_RUNNER Related Environment Variables
| Key | Type | Default Value | Description | Example | Deprecated |
|-------|----------|-------------------|-------------------|-----------------------|------------------|
Expand Down Expand Up @@ -140,10 +148,8 @@
| ARGO_GIT_COMMIT_RETRY_DELAY_ON_CONFLICT | int |1 | Delay on retrying the maifest commit the on gitops | | false |
| ARGO_REPO_REGISTER_RETRY_COUNT | int |4 | Retry count for registering a GitOps repository to ArgoCD | 3 | false |
| ARGO_REPO_REGISTER_RETRY_DELAY | int |5 | Delay (in Seconds) between the retries for registering a GitOps repository to ArgoCD | 5 | false |
| ASYNC_BUILDX_CACHE_EXPORT | bool |false | To enable async container image cache export | | false |
| 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 |
| BLOB_STORAGE_ENABLED | bool |false | | | false |
| BUILDX_CACHE_MODE_MIN | bool |false | To set build cache mode to minimum in buildx | | false |
| CD_HOST | string |localhost | Host for the devtron stack | | false |
| CD_NAMESPACE | string |devtroncd | | | false |
| CD_PORT | string |8000 | Port for pre/post-cd | | false |
Expand Down Expand Up @@ -181,7 +187,6 @@
| ECR_REPO_NAME_PREFIX | string |test/ | Prefix for ECR repo to be created in does not exist | | false |
| ENABLE_ASYNC_ARGO_CD_INSTALL_DEVTRON_CHART | bool |false | To enable async installation of gitops application | | false |
| ENABLE_ASYNC_INSTALL_DEVTRON_CHART | bool |false | To enable async installation of no-gitops application | | false |
| ENABLE_NOTIFIER_V2 | bool |false | enable notifier v2 | | false |
| EPHEMERAL_SERVER_VERSION_REGEX | string |v[1-9]\.\b(2[3-9]\|[3-9][0-9])\b.* | ephemeral containers support version regex that is compared with k8sServerVersion | | false |
| EVENT_URL | string |http://localhost:3000/notify | Notifier service url | | false |
| EXECUTE_WIRE_NIL_CHECKER | bool |false | checks for any nil pointer in wire.go | | false |
Expand All @@ -201,6 +206,7 @@
| GRAFANA_PORT | string |8090 | Port for grafana micro-service | | false |
| GRAFANA_URL | string | | Host URL for the grafana dashboard | | false |
| GRAFANA_USERNAME | string |admin | Username for grafana | | false |
| HIDE_API_TOKENS | bool |false | Boolean flag for should the api tokens generated be hidden from the UI | | false |
| HIDE_IMAGE_TAGGING_HARD_DELETE | bool |false | Flag to hide the hard delete option in the image tagging service | | false |
| IGNORE_AUTOCOMPLETE_AUTH_CHECK | bool |false | flag for ignoring auth check in autocomplete apis. | | false |
| INSTALLED_MODULES | | | List of installed modules given in helm values/yaml are written in cm and used by devtron to know which modules are given | security.trivy,security.clair | false |
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ require (
replace (
github.com/argoproj/argo-workflows/v3 v3.5.13 => github.com/devtron-labs/argo-workflows/v3 v3.5.13
github.com/cyphar/filepath-securejoin v0.4.1 => github.com/cyphar/filepath-securejoin v0.3.6 // indirect
github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250707110047-5ce1ce150a76
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250707110047-5ce1ce150a76
github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250708133124-d0285b3c0de2
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708133124-d0285b3c0de2
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
)
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc h1:VRRKCwnzq
github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
github.com/devtron-labs/argo-workflows/v3 v3.5.13 h1:3pINq0gXOSeTw2z/vYe+j80lRpSN5Rp/8mfQORh8SmU=
github.com/devtron-labs/argo-workflows/v3 v3.5.13/go.mod h1:/vqxcovDPT4zqr4DjR5v7CF8ggpY1l3TSa2CIG3jmjA=
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250707110047-5ce1ce150a76 h1:382wKs9a8Fpz2wK5egWhLKpI4a5i2iThvcWVL1Y6Rvk=
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250707110047-5ce1ce150a76/go.mod h1:9LCkYfiWaEKIBkmxw9jX1GujvEMyHwmDtVsatffAkeU=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250707110047-5ce1ce150a76 h1:Oxx073Vec7hW3JPNsWsZGyC3gULHVluLKTLEfXgjfeY=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250707110047-5ce1ce150a76/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA=
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250708133124-d0285b3c0de2 h1:DVZudmuKWuWGEUN3DoMpYDBGIk7dWQSdubx8ixKZZh4=
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250708133124-d0285b3c0de2/go.mod h1:9LCkYfiWaEKIBkmxw9jX1GujvEMyHwmDtVsatffAkeU=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708133124-d0285b3c0de2 h1:g2Zee/3lL8lOtOieDDnHYD/h00JPFpEdP6uu3FAzKx4=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708133124-d0285b3c0de2/go.mod h1:/Ciy9tD9OxZOWBDPIasM448H7uvSo4+ZJiExpfwBZpA=
github.com/devtron-labs/go-bitbucket v0.9.60-beta h1:VEx1jvDgdtDPS6A1uUFoaEi0l1/oLhbr+90xOwr6sDU=
github.com/devtron-labs/go-bitbucket v0.9.60-beta/go.mod h1:GnuiCesvh8xyHeMCb+twm8lBR/kQzJYSKL28ZfObp1Y=
github.com/devtron-labs/protos v0.0.3-0.20250323220609-ecf8a0f7305e h1:U6UdYbW8a7xn5IzFPd8cywjVVPfutGJCudjePAfL/Hs=
Expand Down
39 changes: 34 additions & 5 deletions pkg/apiToken/ApiTokenService.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package apiToken
import (
"errors"
"fmt"
"github.com/caarlos0/env"
userBean "github.com/devtron-labs/devtron/pkg/auth/user/bean"
"regexp"
"strconv"
Expand Down Expand Up @@ -48,17 +49,41 @@ type ApiTokenServiceImpl struct {
userService user2.UserService
userAuditService user2.UserAuditService
apiTokenRepository ApiTokenRepository
TokenVariableConfig *TokenVariableConfig
}

func NewApiTokenServiceImpl(logger *zap.SugaredLogger, apiTokenSecretService ApiTokenSecretService, userService user2.UserService, userAuditService user2.UserAuditService,
apiTokenRepository ApiTokenRepository) *ApiTokenServiceImpl {
return &ApiTokenServiceImpl{
func NewApiTokenServiceImpl(logger *zap.SugaredLogger,
apiTokenSecretService ApiTokenSecretService,
userService user2.UserService,
userAuditService user2.UserAuditService,
apiTokenRepository ApiTokenRepository,
) (*ApiTokenServiceImpl, error) {
apiTokenService := &ApiTokenServiceImpl{
logger: logger,
apiTokenSecretService: apiTokenSecretService,
userService: userService,
userAuditService: userAuditService,
apiTokenRepository: apiTokenRepository,
}

cfg, err := GetTokenConfig()
if err != nil {
apiTokenService.logger.Errorw("error while getting token config ", "error", err)
return nil, err
}
apiTokenService.TokenVariableConfig = cfg

return apiTokenService, nil
}

func GetTokenConfig() (*TokenVariableConfig, error) {
cfg := &TokenVariableConfig{}
err := env.Parse(cfg)
return cfg, err
}

type TokenVariableConfig struct {
HideApiTokens bool `env:"HIDE_API_TOKENS" envDefault:"false" description:"Boolean flag for should the api tokens generated be hidden from the UI"`
}

var invalidCharsInApiTokenName = regexp.MustCompile("[,\\s]")
Expand Down Expand Up @@ -104,9 +129,11 @@ func (impl ApiTokenServiceImpl) GetAllApiTokensForWebhook(projectName string, en
Name: &apiTokenFromDb.Name,
Description: &apiTokenFromDb.Description,
ExpireAtInMs: &apiTokenFromDb.ExpireAtInMs,
Token: &apiTokenFromDb.Token,
UpdatedAt: &updatedAtStr,
}
if !impl.TokenVariableConfig.HideApiTokens {
apiToken.Token = &apiTokenFromDb.Token
}
apiTokens = append(apiTokens, apiToken)
}
}
Expand Down Expand Up @@ -140,9 +167,11 @@ func (impl ApiTokenServiceImpl) GetAllActiveApiTokens() ([]*openapi.ApiToken, er
Name: &apiTokenFromDb.Name,
Description: &apiTokenFromDb.Description,
ExpireAtInMs: &apiTokenFromDb.ExpireAtInMs,
Token: &apiTokenFromDb.Token,
UpdatedAt: &updatedAtStr,
}
if !impl.TokenVariableConfig.HideApiTokens {
apiToken.Token = &apiTokenFromDb.Token
}
if latestAuditLog != nil {
lastUsedAtStr := latestAuditLog.CreatedOn.String()
apiToken.LastUsedAt = &lastUsedAtStr
Expand Down
Loading
Loading