Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
07f7770
ephemeral error fix
prkhrkat Jul 17, 2025
3f7053c
ephemeral error fix (#6737)
prkhrkat Jul 17, 2025
a031cb4
panic fix
iamayushm Jul 17, 2025
da845f2
Merge pull request #6738 from devtron-labs/panic-fix-post-trigger
iamayushm Jul 17, 2025
1084153
NotificationRule removed
prkhrkat Jul 18, 2025
3b61f5f
Merge branch 'release-candidate-v0.40.0' into rc40-fixes
prkhrkat Jul 18, 2025
6bb7bed
Merge pull request #6739 from devtron-labs/rc40-fixes
vikramdevtron Jul 18, 2025
74a4c04
Merge pull request #6740 from devtron-labs/release-candidate-v0.40.0
vikramdevtron Jul 18, 2025
0d3e575
vendor update
vikramdevtron Jul 18, 2025
3310508
Merge pull request #6741 from devtron-labs/vendor-update-release-40
vikramdevtron Jul 18, 2025
49ad5b9
misc: Added Github Actions for linting and building api specs (#6720)
akshatsinha007 Jul 23, 2025
dad6d30
misc: open api spec addition (#6750)
kamal-devtron Jul 23, 2025
9c95a07
Updated build-docs.yaml (#6752)
akshatsinha007 Jul 23, 2025
6503b20
misc: fixing swagger openapi.yaml (#6751)
badal773 Jul 23, 2025
4324e77
misc: adding codeowner for swagger api spec (#6754)
badal773 Jul 23, 2025
f3038cf
gitops validation spec added (#6755)
kamal-devtron Jul 23, 2025
b15f69a
misc: Update openapi spec (#6758)
pawan-59 Jul 23, 2025
e177cb3
updated the title of openapi specs (#6759)
pawan-59 Jul 23, 2025
bbd8a5f
removed timeout notification (#6760)
prkhrkat Jul 25, 2025
680616b
misc: Timeout main notification (#6761)
prkhrkat Jul 25, 2025
dbbcbe0
misc: changes in description of api spec (#6767)
kamal-devtron Jul 28, 2025
e265a29
Merge remote-tracking branch 'origin/main' into oss-main-sync-31-jul
Ash-exp Jul 31, 2025
5098789
refactor: rename bulk edit config SQL files for consistency
Ash-exp Jul 31, 2025
1d85543
chore: update dependencies to origin/main
Ash-exp Jul 31, 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
5 changes: 4 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ scripts/sql @prakarsh-dt @vikramdevtron @nishant-d @vivek-devtron
scripts/utilities @prakarsh-dt @nishant-d @pawan-mehta-dt @vivek-devtron

#Github Specific
.github/ @prakarsh-dt @nishant-d @pawan-mehta-dt @vikramdevtron @tayalrishabh96
.github/ @prakarsh-dt @nishant-d @pawan-mehta-dt @vikramdevtron @tayalrishabh96 @pawan-59

#swagger api specs
specs/ @prakarsh-dt @pawan-mehta-dt @pawan-59
26 changes: 26 additions & 0 deletions .github/workflows/api-linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint API Specs
on:
pull_request:
paths:
- 'specs/swagger/**'
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Install Redocly CLI
run: npm install -g @redocly/cli
- name: Lint OpenAPI specification
run: |
cd specs/swagger
echo "Linting OpenAPI specification..."
redocly lint openapi.yaml
env:
GITHUB_TOKEN: ${{ secrets.GH_SYSTEMSDT_TOKEN }}
63 changes: 63 additions & 0 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: OpenAPI Build Documentation
on:
push:
branches:
- main
paths:
- 'specs/swagger/**'
permissions:
contents: write
jobs:
lint-and-build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4

- name: Install Redocly CLI
run: npm install -g @redocly/cli

- name: Switch to gh-pages and copy OpenAPI source
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"

mkdir tmp-api

cp specs/swagger/openapi.yaml tmp-api/

git checkout gh-pages

cp tmp-api/openapi.yaml specs/swagger/openapi.yaml

rm -rf /tmp-api

- name: Build OpenAPI documentation
run: |

cd specs/swagger
echo "Building OpenAPI documentation..."
redocly build-docs openapi.yaml --output=openapi.html
echo "Documentation built successfully!"

- name: Commit and push documentation
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"

git add specs/swagger/openapi.html specs/swagger/openapi.yaml

if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Update OpenAPI documentation from main branch"
git push origin gh-pages
echo "Documentation pushed to gh-pages branch!"
fi
env:
GITHUB_TOKEN: ${{ secrets.GH_SYSTEMSDT_TOKEN }}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,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-20250708133124-d0285b3c0de2
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250708133124-d0285b3c0de2
github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250718122027-cb75c2add53e
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250718122027-cb75c2add53e
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
)
9 changes: 4 additions & 5 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-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/devtron-services/authenticator v0.0.0-20250718122027-cb75c2add53e h1:uhVKRc6CyQngloaUUfYz9y8fZ2My0x1Jrkt/YbZdRAI=
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250718122027-cb75c2add53e/go.mod h1:9LCkYfiWaEKIBkmxw9jX1GujvEMyHwmDtVsatffAkeU=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250718122027-cb75c2add53e h1:bprDKDpzZ/UVFxnA3xP3GiqRFHjmmTXXg2IDkN5EdUg=
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250718122027-cb75c2add53e/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 Expand Up @@ -475,7 +475,6 @@ github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0=
github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/subcommands v1.2.0 h1:vWQspBTo2nEqTUFita5/KeEWlUL8kQObDFbub/EN9oE=
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ func (impl *NotificationSettingsRepositoryImpl) FindNotificationSettingsWithRule

query := impl.dbConnection.
Model(&notificationSettings).
Column("notification_settings.*", "NotificationRule").
Column("notification_settings.*").
Where("notification_settings.pipeline_type = ?", req.PipelineType).
Where("notification_settings.event_type_id = ?", eventId).
WhereGroup(settingsFilerConditions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func (impl *HandlerServiceImpl) TriggerPostStage(request bean.CdTriggerRequest)
return nil, err
}
}
request.Artifact = cdWf.CiArtifact

// Migration of deprecated DataSource Type
if cdWf.CiArtifact.IsMigrationRequired() {
Expand Down
68 changes: 66 additions & 2 deletions pkg/k8s/application/k8sApplicationService.go
Original file line number Diff line number Diff line change
Expand Up @@ -1040,17 +1040,81 @@ func (impl *K8sApplicationServiceImpl) TerminatePodEphemeralContainer(req bean5.
if container == nil {
return false, errors.New("externally created ephemeral containers cannot be removed")
}
// Check if pod exists and is running before attempting to execute command
var v1Client *v1.CoreV1Client
if req.ExternalArgoAppIdentifier != nil {
_, v1Client, err = impl.k8sCommonService.GetCoreClientByClusterIdForExternalArgoApps(&req)
if err != nil {
impl.logger.Errorw("error in getting coreV1 client by clusterId for external argo apps", "err", err, "req", req)
return false, err
}
} else {
_, v1Client, err = impl.k8sCommonService.GetCoreClientByClusterId(req.ClusterId)
if err != nil {
impl.logger.Errorw("error in getting coreV1 client by clusterId", "clusterId", req.ClusterId, "err", err)
return false, err
}
}

// Check if pod exists and is running
pod, err := impl.K8sUtil.GetPodByName(req.Namespace, req.PodName, v1Client)
if err != nil {
if k8s.IsResourceNotFoundErr(err) {
impl.logger.Infow("pod not found, ephemeral container termination not needed", "podName", req.PodName, "namespace", req.Namespace, "clusterId", req.ClusterId)
// Pod doesn't exist, so ephemeral container is already terminated
err = impl.ephemeralContainerService.AuditEphemeralContainerAction(req, repository.ActionTerminate)
if err != nil {
impl.logger.Errorw("error in saving ephemeral container data", "err", err)
return true, err
}
return true, nil
}
impl.logger.Errorw("error in getting pod", "clusterId", req.ClusterId, "namespace", req.Namespace, "podName", req.PodName, "err", err)
return false, err
}

// Check if pod is in a terminated state
if pod.Status.Phase == corev1.PodSucceeded || pod.Status.Phase == corev1.PodFailed {
impl.logger.Infow("pod is in terminated state, ephemeral container termination not needed", "podName", req.PodName, "namespace", req.Namespace, "clusterId", req.ClusterId, "podPhase", pod.Status.Phase)
// Pod is terminated, so ephemeral container is already terminated
err = impl.ephemeralContainerService.AuditEphemeralContainerAction(req, repository.ActionTerminate)
if err != nil {
impl.logger.Errorw("error in saving ephemeral container data", "err", err)
return true, err
}
return true, nil
}

// Check if the specific ephemeral container is still running
ephemeralContainerRunning := false
for _, ecStatus := range pod.Status.EphemeralContainerStatuses {
if ecStatus.Name == req.BasicData.ContainerName && ecStatus.State.Running != nil {
ephemeralContainerRunning = true
break
}
}

if !ephemeralContainerRunning {
impl.logger.Infow("ephemeral container is not running, termination not needed", "podName", req.PodName, "namespace", req.Namespace, "clusterId", req.ClusterId, "containerName", req.BasicData.ContainerName)
// Ephemeral container is not running, so it's already terminated
err = impl.ephemeralContainerService.AuditEphemeralContainerAction(req, repository.ActionTerminate)
if err != nil {
impl.logger.Errorw("error in saving ephemeral container data", "err", err)
return true, err
}
return true, nil
}
containerKillCommand := fmt.Sprintf("kill -16 $(pgrep -f '%s' -o)", fmt.Sprintf(k8sObjectUtils.EphemeralContainerStartingShellScriptFileName, terminalReq.ContainerName))
cmds := []string{"sh", "-c", containerKillCommand}
_, errBuf, err := impl.terminalSession.RunCmdInRemotePod(terminalReq, cmds)
if err != nil {
impl.logger.Errorw("failed to execute commands ", "err", err, "commands", cmds, "podName", req.PodName, "namespace", req.Namespace)
return false, err
// not returning the error since websocket connection will break when running kill command
}
errBufString := errBuf.String()
if errBufString != "" {
impl.logger.Errorw("error response on executing commands ", "err", errBufString, "commands", cmds, "podName", req.Namespace, "namespace", req.Namespace)
return false, err
// not returning the error since websocket connection will break when running kill command
}

if err == nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/workflow/status/WorkflowStatusService.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ func (impl *WorkflowStatusServiceImpl) CheckHelmAppStatusPeriodicallyAndUpdateIn
impl.logger.Errorw("error on handling deployment success event", "wfr", wfr, "err", err)
return err
}
} else if wfr.Status == cdWorkflow2.WorkflowTimedOut {
impl.deploymentEventHandler.WriteCDNotificationEventAsync(pipelineOverride.Pipeline.AppId, pipelineOverride.Pipeline.EnvironmentId, pipelineOverride, util.Fail)
}
}
return nil
Expand Down Expand Up @@ -674,8 +672,6 @@ func (impl *WorkflowStatusServiceImpl) CheckFluxAppStatusPeriodicallyAndUpdateIn
impl.logger.Errorw("error on handling deployment success event", "wfr", wfr, "err", err)
return err
}
} else if wfr.Status == cdWorkflow2.WorkflowTimedOut {
impl.deploymentEventHandler.WriteCDNotificationEventAsync(pipelineOverride.Pipeline.AppId, pipelineOverride.Pipeline.EnvironmentId, pipelineOverride, util.Fail)
}
}
return nil
Expand Down
Loading
Loading