Skip to content

Commit 4a68cc7

Browse files
committed
chore: undo dry-run and version change
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
1 parent 0bf3da1 commit 4a68cc7

3 files changed

Lines changed: 26 additions & 43 deletions

File tree

scripts/services/docker/Dockerfile.git_integration

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ FROM golang:1.25-alpine AS go-builder
77
WORKDIR /go/src/software-value
88

99
# Install scc using the official Go toolchain (specific version as per project README)
10-
RUN go install github.com/boyter/scc/v3@v3.7.0
10+
RUN go install github.com/boyter/scc/v3@v3.5.0
1111

1212
# Copy Go module files
1313
COPY ./services/apps/git_integration/src/crowdgit/services/software_value/go.mod ./

services/apps/git_integration/src/crowdgit/services/software_value/main.go

Lines changed: 25 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,17 @@ func processRepository(noLarge bool) StandardResponse {
5656
// Process single repository (the target path argument)
5757
repoDir := config.TargetPath
5858

59-
dryRun := os.Getenv("IS_PROD_ENV") != "true"
60-
61-
var insightsDb *InsightsDB
62-
if !dryRun {
63-
var dbErr error
64-
insightsDb, dbErr = NewInsightsDB(ctx, config.InsightsDatabase)
65-
if dbErr != nil {
66-
errorCode := ErrorCodeDatabaseConnection
67-
errorMessage := fmt.Sprintf("Error connecting to insights database: %v", dbErr)
68-
return StandardResponse{
69-
Status: StatusFailure,
70-
ErrorCode: &errorCode,
71-
ErrorMessage: &errorMessage,
72-
}
59+
insightsDb, dbErr := NewInsightsDB(ctx, config.InsightsDatabase)
60+
if dbErr != nil {
61+
errorCode := ErrorCodeDatabaseConnection
62+
errorMessage := fmt.Sprintf("Error connecting to insights database: %v", dbErr)
63+
return StandardResponse{
64+
Status: StatusFailure,
65+
ErrorCode: &errorCode,
66+
ErrorMessage: &errorMessage,
7367
}
74-
defer insightsDb.Close()
75-
} else {
76-
fmt.Println("[DRY RUN] Skipping database connection")
7768
}
69+
defer insightsDb.Close()
7870

7971
// Get git URL for the repository
8072
gitUrl, err := getGitRepositoryURL(repoDir)
@@ -101,32 +93,24 @@ func processRepository(noLarge bool) StandardResponse {
10193
}
10294
report.Repository.URL = gitUrl
10395

104-
if dryRun {
105-
fmt.Printf("[DRY RUN] Would save project cost: repo=%s cost=$%.2f\n", report.Repository.URL, report.Cocomo.CostInDollars)
106-
fmt.Printf("[DRY RUN] Would save %d language stats entries\n", len(report.LanguageStats))
107-
for _, ls := range report.LanguageStats {
108-
fmt.Printf("[DRY RUN] language=%s lines=%d code=%d\n", ls.LanguageName, ls.Lines, ls.Code)
109-
}
110-
} else {
111-
// Save to database
112-
if err := insightsDb.saveProjectCost(ctx, report.Repository, report.Cocomo.CostInDollars); err != nil {
113-
errorCode := ErrorCodeDatabaseOperation
114-
errorMessage := fmt.Sprintf("Error saving project cost: %v", err)
115-
return StandardResponse{
116-
Status: StatusFailure,
117-
ErrorCode: &errorCode,
118-
ErrorMessage: &errorMessage,
119-
}
96+
// Save to database
97+
if err := insightsDb.saveProjectCost(ctx, report.Repository, report.Cocomo.CostInDollars); err != nil {
98+
errorCode := ErrorCodeDatabaseOperation
99+
errorMessage := fmt.Sprintf("Error saving project cost: %v", err)
100+
return StandardResponse{
101+
Status: StatusFailure,
102+
ErrorCode: &errorCode,
103+
ErrorMessage: &errorMessage,
120104
}
105+
}
121106

122-
if err := insightsDb.saveLanguageStats(ctx, report.Repository, report.LanguageStats); err != nil {
123-
errorCode := ErrorCodeDatabaseOperation
124-
errorMessage := fmt.Sprintf("Error saving language stats: %v", err)
125-
return StandardResponse{
126-
Status: StatusFailure,
127-
ErrorCode: &errorCode,
128-
ErrorMessage: &errorMessage,
129-
}
107+
if err := insightsDb.saveLanguageStats(ctx, report.Repository, report.LanguageStats); err != nil {
108+
errorCode := ErrorCodeDatabaseOperation
109+
errorMessage := fmt.Sprintf("Error saving language stats: %v", err)
110+
return StandardResponse{
111+
Status: StatusFailure,
112+
ErrorCode: &errorCode,
113+
ErrorMessage: &errorMessage,
130114
}
131115
}
132116

services/apps/git_integration/src/crowdgit/settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,3 @@ def load_env_var(key: str, required=True, default=None):
4444
STUCK_RECURRENT_REPO_TIMEOUT_HOURS = int(
4545
load_env_var("STUCK_RECURRENT_REPO_TIMEOUT_HOURS", default="4")
4646
)
47-
IS_PROD_ENV: bool = load_env_var("NODE_ENV", required=False) == "production"

0 commit comments

Comments
 (0)