Skip to content

Commit f8c04e3

Browse files
committed
main, common lib, protos update
1 parent be6c6ea commit f8c04e3

File tree

7 files changed

+941
-700
lines changed

7 files changed

+941
-700
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toolchain go1.22.4
77
require (
88
github.com/caarlos0/env v3.5.0+incompatible
99
github.com/devtron-labs/common-lib v0.0.25-0.20240719070325-2cb5e69dc592
10-
github.com/devtron-labs/protos v0.0.3-0.20240617111821-3ce37e891508
10+
github.com/devtron-labs/protos v0.0.3-0.20240719073841-1c0c5d2079c6
1111
github.com/gammazero/workerpool v0.0.0-20200206003619-019d125201ab
1212
github.com/go-git/go-git/v5 v5.11.0
1313
github.com/go-pg/pg v6.15.1+incompatible

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
3131
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3232
github.com/devtron-labs/common-lib v0.0.25-0.20240719070325-2cb5e69dc592 h1:b74H3z6+uWAJnmEZ34YoB/bZ3fdTxGxY88W3xF5WWO0=
3333
github.com/devtron-labs/common-lib v0.0.25-0.20240719070325-2cb5e69dc592/go.mod h1:UZGPt1ep9Tnd9Ak2sibGSiLr7p3ijO2/JLT+h+pqBuU=
34-
github.com/devtron-labs/protos v0.0.3-0.20240617111821-3ce37e891508 h1:4/noKg10TsmP9xQnDKeoyQZq3zpIccdUjpFTMjHC/yI=
35-
github.com/devtron-labs/protos v0.0.3-0.20240617111821-3ce37e891508/go.mod h1:ypUknVph8Ph4dxSlrFoouf7wLedQxHku2LQwgRrdgS4=
34+
github.com/devtron-labs/protos v0.0.3-0.20240719073841-1c0c5d2079c6 h1:PC2j0/purK0ICQEQV0bBweap1BW6tFVvYJFy7QOvXNc=
35+
github.com/devtron-labs/protos v0.0.3-0.20240719073841-1c0c5d2079c6/go.mod h1:ypUknVph8Ph4dxSlrFoouf7wLedQxHku2LQwgRrdgS4=
3636
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU=
3737
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
3838
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=

pkg/git/GitBaseManager.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,19 @@ func (impl *GitManagerBaseImpl) FetchDiffStatBetweenCommitsNameOnly(gitCtx GitCo
314314
oldHash = oldHash + "^"
315315
}
316316
cmd, cancel := impl.createCmdWithContext(gitCtx, "git", "-C", rootDir, "diff", "--name-only", oldHash, newHash)
317-
defer cancel()
318317

319-
output, errMsg, err := impl.runCommandWithCred(cmd, gitCtx.Username, gitCtx.Password)
318+
tlsPathInfo, err := commonLibGitManager.CreateFilesForTlsData(commonLibGitManager.BuildTlsData(gitCtx.TLSKey, gitCtx.TLSCertificate, gitCtx.CACert, gitCtx.TLSVerificationEnabled), TLS_FILES_DIR)
319+
if err != nil {
320+
//making it non-blocking
321+
impl.logger.Errorw("error encountered in createFilesForTlsData", "err", err)
322+
}
323+
324+
defer func() {
325+
cancel()
326+
commonLibGitManager.DeleteTlsFiles(tlsPathInfo)
327+
}()
328+
329+
output, errMsg, err := impl.runCommandWithCred(cmd, gitCtx.Username, gitCtx.Password, tlsPathInfo)
320330
impl.logger.Debugw("root", rootDir, "opt", output, "errMsg", errMsg, "error", err)
321331
if err != nil || len(errMsg) > 0 {
322332
impl.logger.Errorw("error in fetching fileStat diff btw commits: ", "oldHash", oldHash, "newHash", newHash, "checkoutPath", rootDir, "errorMsg", errMsg, "err", err)

0 commit comments

Comments
 (0)