Skip to content

Commit ec50653

Browse files
committed
Merge branch 'develop' into scoped-var-patch-type-fix
2 parents 19a3cf9 + 00382ff commit ec50653

File tree

1,002 files changed

+196146
-10452
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,002 files changed

+196146
-10452
lines changed

.github/workflows/auto-label.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Devtron-auto-labeller
1+
name: Devtron-auto-labeler
22

33
on:
44
issue_comment:
@@ -25,11 +25,11 @@ jobs:
2525
ISSUE_NUMBER=$(jq -r '.issue.number // .pull_request.number' "$GITHUB_EVENT_PATH")
2626
COMMENT_AUTHOR=$(jq -r '.comment.user.login' "$GITHUB_EVENT_PATH")
2727
28-
ORG_NAME="satyam-tests"
28+
ORG_NAME="devtron-labs"
2929
3030
# Check if the person is authorized to add labels
31-
curl -s -H "Authorization: token $GH_TOKEN" "https://api.github.com/orgs/$ORG_NAME/members/$COMMENT_AUTHOR" > /dev/null
32-
if [[ $? -ne 0 ]]; then
31+
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: token $GH_TOKEN" "https://api.github.com/orgs/$ORG_NAME/members/$COMMENT_AUTHOR")
32+
if [[ "$RESPONSE" -ne 204 ]]; then
3333
gh issue comment "$ISSUE_NUMBER" --body "Hi @$COMMENT_AUTHOR, you must be a member of the organization '$ORG_NAME' to add or remove labels."
3434
echo "User '$COMMENT_AUTHOR' is not a member of the organization '$ORG_NAME'. Exiting."
3535
exit 1
@@ -53,7 +53,7 @@ jobs:
5353
fi
5454
fi
5555
56-
# Remove Label Logic
56+
# Removes Label Logic
5757
if [[ "$COMMENT_BODY" =~ ^/remove[[:space:]](.+)$ ]]; then
5858
LABEL_NAME_TO_REMOVE=$(echo "$COMMENT_BODY" | sed -n 's|/remove ||p')
5959
@@ -64,4 +64,4 @@ jobs:
6464
else
6565
echo "The label '$LABEL_NAME_TO_REMOVE' is not attached to issue #$ISSUE_NUMBER."
6666
fi
67-
fi
67+
fi

.github/workflows/create-release.yml

Lines changed: 56 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,70 @@
1-
# This workflow is used to create a github release from last tag pushed
1+
# This workflow is used to create tag and Release for OSS
22

33
name: Create Release
44

55
# Controls when the action will run. Workflow runs when manually triggered using the UI
66
# or on push in charts directory of main branch.
77
on:
8-
98
workflow_dispatch:
109

1110
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1211
jobs:
13-
# This workflow contains a single job called "create-release"
12+
13+
create-release-tag:
14+
runs-on: ubuntu-latest
15+
16+
env:
17+
GITHUB_TOKENS: ${{ secrets.GH_SYSTEMSDT_TOKEN }}
18+
GIT_CONFIG_EMAIL: ${{ secrets.GH_SYSTEMSDT_EMAIL }}
19+
GIT_CONFIG_NAME: ${{ secrets.GH_SYSTEMSDT_USERNAME }}
20+
GIT_USERNAME: ${{ secrets.GH_SYSTEMSDT_USERNAME }}
21+
GIT_REPO: ${{ github.repository }}
22+
REPO: https://github.com/devtron-labs/devtron
23+
RELEASE_BRANCH: "main"
24+
25+
steps:
26+
27+
- name: Configure Git
28+
run: |
29+
echo $GITHUB_TOKENS > tokens.txt
30+
gh auth login --with-token < tokens.txt
31+
git config --global user.email "$GIT_CONFIG_EMAIL"
32+
git config --global user.name "$GIT_CONFIG_NAME"
33+
34+
- name: Clone repository and create tag
35+
run: |
36+
mkdir preci && cd preci
37+
gh repo clone "$REPO"
38+
cd $(basename "$REPO")
39+
git checkout $RELEASE_BRANCH
40+
git pull origin $RELEASE_BRANCH
41+
NEXT_RELEASE_VERSION=v$(curl -s https://raw.githubusercontent.com/devtron-labs/charts/refs/heads/main/charts/devtron/Chart.yaml | grep 'appVersion' | awk '{print $2}')
42+
# Create and push tag
43+
git tag $NEXT_RELEASE_VERSION
44+
git push -f https://$GIT_USERNAME:[email protected]/$GIT_REPO $NEXT_RELEASE_VERSION
45+
1446
create-release:
15-
# The type of runner that the job will run on
47+
needs: create-release-tag
1648
runs-on: ubuntu-latest
1749

1850
# Steps represent a sequence of tasks that will be executed as part of the job
1951
steps:
2052
# Runs series of commands to create a release
2153
- name: create-release
2254
run: |
23-
RELEASE_FILE_CONTENTS=$(curl -L -s "https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/${RELEASE_BRANCH}/manifests/release.txt" )
24-
RELEASE_TYPE=$(echo $RELEASE_FILE_CONTENTS | awk '{print $1}')
2555
FILE_NAME=${FILE_NAME:=releasenotes.md}
2656
echo $RELEASE_TYPE
2757
echo $GITHUB_REPOSITORY
58+
echo $RELEASE_BRANCH
59+
version=$(curl -s https://raw.githubusercontent.com/devtron-labs/devtron/refs/heads/main/charts/devtron/Chart.yaml | grep "appVersion" | awk -F ': ' '{print $2}' )
60+
if [[ "$version" == *"-rc"* ]]; then
61+
RELEASE_TYPE="beta"
62+
else
63+
RELEASE_TYPE="minor"
64+
fi
2865
gh repo clone $GITHUB_REPOSITORY
2966
cd devtron
30-
if [[ "$RELEASE_TYPE" == "stable" ]]
67+
if [[ "$RELEASE_TYPE" == "major" || "$RELEASE_TYPE" == "minor" || "$RELEASE_TYPE" == "patch" ]]
3168
then
3269
tag=$(git tag --sort=committerdate | tail -1)
3370
echo $tag
@@ -39,11 +76,9 @@ jobs:
3976
git config --global user.name "$GIT_CONFIG_NAME"
4077
rm -f $FILE_NAME
4178
touch $FILE_NAME
42-
echo "## Bugs" > beta-releasenotes.md
43-
echo "## Enhancements" >> beta-releasenotes.md
44-
echo "## Documentation" >> beta-releasenotes.md
79+
echo "## Enhancements" > beta-releasenotes.md
80+
echo "## Bugs" >> beta-releasenotes.md
4581
echo "## Others" >> beta-releasenotes.md
46-
echo "beta -1 $tag" > manifests/release.txt
4782
git add .
4883
git commit -am "Updated release-notes files"
4984
git push -f https://${GIT_CONFIG_NAME}:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY} release-bot
@@ -52,26 +87,29 @@ jobs:
5287
git checkout -b release-bot
5388
git config --global user.email "$GIT_CONFIG_EMAIL"
5489
git config --global user.name "$GIT_CONFIG_NAME"
55-
echo "## Bugs" > beta-releasenotes.md
56-
echo "## Enhancements" >> beta-releasenotes.md
57-
echo "## Documentation" >> beta-releasenotes.md
90+
echo "## Enhancements" > beta-releasenotes.md
91+
echo "## Bugs" >> beta-releasenotes.md
5892
echo "## Others" >> beta-releasenotes.md
5993
git add .
6094
git commit -am "Created release-notes files"
6195
git push -f https://${GIT_CONFIG_NAME}:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY} release-bot
6296
echo "Not creating release due to beta"
6397
fi
6498
env:
99+
RELEASE_BRANCH: "main"
65100
GH_TOKEN: ${{ secrets.GH_SYSTEMSDT_TOKEN }}
66-
RELEASE_BRANCH: ${{ secrets.RELEASE_BRANCH }}
67101
GIT_CONFIG_NAME: ${{ vars.GH_SYSTEMSDT_USERNAME }}
68102
GIT_CONFIG_EMAIL: ${{ secrets.GH_SYSTEMSDT_EMAIL }}
69103
# Send notification on discord
70104
- name: discord-notify
71105
run: |
72-
RELEASE_FILE_CONTENTS=$(curl -L -s "https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/${RELEASE_BRANCH}/manifests/release.txt" )
73-
RELEASE_TYPE=$(echo $RELEASE_FILE_CONTENTS | awk '{print $1}')
74-
if [[ "$RELEASE_TYPE" == "stable" ]]
106+
version=$(curl -s https://raw.githubusercontent.com/devtron-labs/devtron/refs/heads/main/charts/devtron/Chart.yaml | grep "appVersion" | awk -F ': ' '{print $2}' )
107+
if [[ "$version" == *"-rc"* ]]; then
108+
RELEASE_TYPE="beta"
109+
else
110+
RELEASE_TYPE="minor"
111+
fi
112+
if [[ "$RELEASE_TYPE" == "major" || "$RELEASE_TYPE" == "minor" || "$RELEASE_TYPE" == "patch" ]]
75113
then
76114
sudo apt install python3 python3-pip -y
77115
pip install discord-webhook
@@ -84,5 +122,3 @@ jobs:
84122
then
85123
echo "Not sending notification due to beta"
86124
fi
87-
env:
88-
RELEASE_BRANCH: ${{ secrets.RELEASE_BRANCH }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
.env
55
/cmd/external-app/devtron-ea
66
devtron
7+
8+
.qodo

App.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"fmt"
2424
"github.com/devtron-labs/common-lib/middlewares"
2525
pubsub "github.com/devtron-labs/common-lib/pubsub-lib"
26+
posthogTelemetry "github.com/devtron-labs/common-lib/telemetry"
2627
"github.com/devtron-labs/devtron/pkg/eventProcessor"
2728
"github.com/devtron-labs/devtron/pkg/eventProcessor/in"
2829
"log"
@@ -31,7 +32,6 @@ import (
3132
"time"
3233

3334
"github.com/devtron-labs/devtron/api/util"
34-
"github.com/devtron-labs/devtron/client/telemetry"
3535
"github.com/devtron-labs/devtron/otel"
3636
"github.com/devtron-labs/devtron/pkg/auth/user"
3737

@@ -55,7 +55,7 @@ type App struct {
5555
EnforcerV2 *casbinv2.SyncedEnforcer
5656
server *http.Server
5757
db *pg.DB
58-
posthogClient *telemetry.PosthogClient
58+
posthogClient *posthogTelemetry.PosthogClient
5959
// eventProcessor.CentralEventProcessor is used to register event processors
6060
centralEventProcessor *eventProcessor.CentralEventProcessor // do not remove this.
6161
// used for local dev only
@@ -73,7 +73,7 @@ func NewApp(router *router.MuxRouter,
7373
enforcer *casbin.SyncedEnforcer,
7474
db *pg.DB,
7575
sessionManager2 *authMiddleware.SessionManager,
76-
posthogClient *telemetry.PosthogClient,
76+
posthogClient *posthogTelemetry.PosthogClient,
7777
loggingMiddleware util.LoggingMiddleware,
7878
centralEventProcessor *eventProcessor.CentralEventProcessor,
7979
pubSubClient *pubsub.PubSubClientServiceImpl,

CHANGELOG/release-notes-v1.4.0.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## v1.4.0
2+
3+
## Enhancements
4+
- feat: Made ng labels env driven (#6438)
5+
- feat: Link helm release (#6454)
6+
- feat: access manager (#6377)
7+
- feat: migrate external argo cd application (#6303)
8+
- feat: Dark Mode v1 (#2348)
9+
- feat: Dark Mode v2 (#2367)
10+
- feat: Dark Mode v3 (#2484)
11+
## Bugs
12+
- fix: cluster update issue (#6465)
13+
- fix: in CreateGrafanaDataSource (#6463)
14+
- fix: onboard acd app (#6457)
15+
- fix: prom client in chart-sync (#6442)
16+
- fix: incorrect gitops metrics (#6444)
17+
- fix: envId check in EventBuilder.go (#6436)
18+
- fix: createDockerRepoIfNeeded error handling (#6433)
19+
20+

CHANGELOG/release-notes-v1.5.0.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## v1.5.0
2+
3+
## Enhancements
4+
- feat: Config Approval bypass v1 (for cm, cs and deployment template) (#6493)
5+
- feat: Licensing changes (#6474)
6+
## Bugs
7+
- fix: Added support for IAM role S3 blob client (#6521)
8+
- fix: Making tx independent of git sensor call (#6519)
9+
- fix: Sql query memory issue (#6516)
10+
- fix: Grafana data-source get API (#6503)
11+
- fix: Made triggeredBy for CI & CD uniform (#6489)
12+
- fix: HPA permission denied error (#6485)
13+
- fix: Force abort for pre/post cd (#6475)
14+
- fix: Optimisation in workflow status api (#6473)
15+
- fix: Let user delete the container reg if the ref app was deleted (#6464)
16+
## Others
17+
- misc: Update the descriptions of env variables (#6499)
18+
- misc: Patch api for user attribute (#6490)
19+
- chore: Nil implementations fixed for user attribute in telemetry (#6497)

CHANGELOG/release-notes-v1.5.1.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## v1.5.1
2+
3+
## Bugs
4+
- fix: stack manager page break on server api giving internal server error (#6556)
5+
6+

Wire.go

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ package main
2222
import (
2323
"github.com/devtron-labs/authenticator/middleware"
2424
cloudProviderIdentifier "github.com/devtron-labs/common-lib/cloud-provider-identifier"
25-
pubsub1 "github.com/devtron-labs/common-lib/pubsub-lib"
25+
pubSub "github.com/devtron-labs/common-lib/pubsub-lib"
26+
posthogTelemetry "github.com/devtron-labs/common-lib/telemetry"
2627
util4 "github.com/devtron-labs/common-lib/utils/k8s"
2728
"github.com/devtron-labs/devtron/api/apiToken"
2829
appStoreRestHandler "github.com/devtron-labs/devtron/api/appStore"
@@ -144,6 +145,7 @@ import (
144145
"github.com/devtron-labs/devtron/pkg/deploymentGroup"
145146
"github.com/devtron-labs/devtron/pkg/dockerRegistry"
146147
"github.com/devtron-labs/devtron/pkg/eventProcessor"
148+
"github.com/devtron-labs/devtron/pkg/executor"
147149
"github.com/devtron-labs/devtron/pkg/generateManifest"
148150
"github.com/devtron-labs/devtron/pkg/gitops"
149151
"github.com/devtron-labs/devtron/pkg/imageDigestPolicy"
@@ -152,6 +154,7 @@ import (
152154
repository7 "github.com/devtron-labs/devtron/pkg/kubernetesResourceAuditLogs/repository"
153155
"github.com/devtron-labs/devtron/pkg/notifier"
154156
"github.com/devtron-labs/devtron/pkg/pipeline"
157+
"github.com/devtron-labs/devtron/pkg/pipeline/draftAwareConfigService"
155158
"github.com/devtron-labs/devtron/pkg/pipeline/executors"
156159
history3 "github.com/devtron-labs/devtron/pkg/pipeline/history"
157160
repository3 "github.com/devtron-labs/devtron/pkg/pipeline/history/repository"
@@ -164,6 +167,7 @@ import (
164167
resourceGroup2 "github.com/devtron-labs/devtron/pkg/resourceGroup"
165168
"github.com/devtron-labs/devtron/pkg/resourceQualifiers"
166169
"github.com/devtron-labs/devtron/pkg/sql"
170+
"github.com/devtron-labs/devtron/pkg/ucid"
167171
util3 "github.com/devtron-labs/devtron/pkg/util"
168172
"github.com/devtron-labs/devtron/pkg/variables"
169173
"github.com/devtron-labs/devtron/pkg/variables/parsers"
@@ -218,7 +222,7 @@ func InitializeApp() (*App, error) {
218222
userResource.UserResourceWireSet,
219223
policyGovernance.PolicyGovernanceWireSet,
220224
resourceScan.ScanningResultWireSet,
221-
225+
executor.ExecutorWireSet,
222226
// -------wireset end ----------
223227
// -------
224228
gitSensor.GetConfig,
@@ -477,9 +481,6 @@ func InitializeApp() (*App, error) {
477481
util.IntValidator,
478482
types.GetCiCdConfig,
479483

480-
pipeline.NewWorkflowServiceImpl,
481-
wire.Bind(new(pipeline.WorkflowService), new(*pipeline.WorkflowServiceImpl)),
482-
483484
pipeline.NewCiServiceImpl,
484485
wire.Bind(new(pipeline.CiService), new(*pipeline.CiServiceImpl)),
485486

@@ -500,7 +501,7 @@ func InitializeApp() (*App, error) {
500501
pipeline.NewCiLogServiceImpl,
501502
wire.Bind(new(pipeline.CiLogService), new(*pipeline.CiLogServiceImpl)),
502503

503-
pubsub1.NewPubSubClientServiceImpl,
504+
pubSub.NewPubSubClientServiceImpl,
504505

505506
rbac.NewEnforcerUtilImpl,
506507
wire.Bind(new(rbac.EnforcerUtil), new(*rbac.EnforcerUtilImpl)),
@@ -531,6 +532,9 @@ func InitializeApp() (*App, error) {
531532
chartConfig.NewConfigMapRepositoryImpl,
532533
wire.Bind(new(chartConfig.ConfigMapRepository), new(*chartConfig.ConfigMapRepositoryImpl)),
533534

535+
draftAwareConfigService.NewDraftAwareResourceServiceImpl,
536+
wire.Bind(new(draftAwareConfigService.DraftAwareConfigService), new(*draftAwareConfigService.DraftAwareConfigServiceImpl)),
537+
534538
config.WireSet,
535539

536540
infraConfig.WireSet,
@@ -692,7 +696,8 @@ func InitializeApp() (*App, error) {
692696
wire.Bind(new(router.TelemetryRouter), new(*router.TelemetryRouterImpl)),
693697
restHandler.NewTelemetryRestHandlerImpl,
694698
wire.Bind(new(restHandler.TelemetryRestHandler), new(*restHandler.TelemetryRestHandlerImpl)),
695-
telemetry.NewPosthogClient,
699+
posthogTelemetry.NewPosthogClient,
700+
ucid.WireSet,
696701

697702
cloudProviderIdentifier.NewProviderIdentifierServiceImpl,
698703
wire.Bind(new(cloudProviderIdentifier.ProviderIdentifierService), new(*cloudProviderIdentifier.ProviderIdentifierServiceImpl)),

api/appStore/deployment/AppStoreDeploymentRestHandler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ func (handler AppStoreDeploymentRestHandlerImpl) UpdateProjectHelmApp(w http.Res
539539
if err != nil {
540540
handler.Logger.Errorw("error in decoding app id", "err", err)
541541
common.WriteJsonResp(w, err, "error in decoding app id", http.StatusBadRequest)
542+
return
542543
}
543544
// this rbac object checks that whether user have permission to change current project.
544545
rbacObjectForCurrentProject, rbacObjectForCurrentProject2 := handler.enforcerUtilHelm.GetHelmObjectByClusterIdNamespaceAndAppName(appIdentifier.ClusterId, appIdentifier.Namespace, appIdentifier.ReleaseName)
@@ -555,6 +556,7 @@ func (handler AppStoreDeploymentRestHandlerImpl) UpdateProjectHelmApp(w http.Res
555556
if err != nil {
556557
handler.Logger.Errorw("service err, InstalledAppId", "err", err, "InstalledAppId", request.InstalledAppId)
557558
common.WriteJsonResp(w, fmt.Errorf("Unable to fetch installed app details"), nil, http.StatusBadRequest)
559+
return
558560
}
559561
if installedApp.IsVirtualEnvironment {
560562
rbacObjectForCurrentProject, _ := handler.enforcerUtilHelm.GetAppRBACNameByInstalledAppId(request.InstalledAppId)
@@ -580,8 +582,10 @@ func (handler AppStoreDeploymentRestHandlerImpl) UpdateProjectHelmApp(w http.Res
580582
if err != nil {
581583
handler.Logger.Errorw("error in updating project for helm apps", "err", err)
582584
common.WriteJsonResp(w, err, "error in updating project", http.StatusBadRequest)
585+
return
583586
} else {
584587
handler.Logger.Errorw("Helm App project update")
585588
common.WriteJsonResp(w, nil, "Project Updated", http.StatusOK)
589+
return
586590
}
587591
}

api/appStore/deployment/CommonDeploymentRestHandler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ func (handler *CommonDeploymentRestHandlerImpl) RollbackApplication(w http.Respo
268268
appOfferingMode, installedAppDto, err := handler.getAppOfferingMode(installedAppId, *request.HAppId)
269269
if err != nil {
270270
common.WriteJsonResp(w, err, "bad request", http.StatusBadRequest)
271+
return
271272
}
272273
installedAppDto.UserId = userId
273274
//rbac block starts from here

0 commit comments

Comments
 (0)