Skip to content
This repository was archived by the owner on May 24, 2024. It is now read-only.

Commit 05590bf

Browse files
update repository event (#67)
Signed-off-by: Ayman <enkhalifapro@gmail.com> Signed-off-by: Ayman <enkhalifapro@gmail.com> Co-authored-by: Ayman <enkhalifapro@gmail.com>
1 parent a58c523 commit 05590bf

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

cmd/github/github.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7748,7 +7748,12 @@ func (j *DSGitHub) GetModelDataRepository(ctx *shared.Ctx, docs []interface{}) (
77487748
stargazers, _ := doc["stargazers_count"].(float64)
77497749
description, _ := doc["description"].(string)
77507750
sCreatedAt, _ := doc["created_at"].(string)
7751-
createdAt, _ := shared.TimeParseES(sCreatedAt)
7751+
tCreatedAt, _ := shared.TimeParseES(sCreatedAt)
7752+
createdAt := shared.ConvertTimeToFloat(tCreatedAt)
7753+
sUpdatedAt, _ := doc["updated_at"].(string)
7754+
tUpdatedAt, _ := shared.TimeParseES(sUpdatedAt)
7755+
updatedAt := shared.ConvertTimeToFloat(tUpdatedAt)
7756+
defaultBranch, _ := doc["default_branch"].(string)
77527757
// id is github repository id
77537758
id, _ := doc["id"].(float64)
77547759
sid := fmt.Sprintf("%.0f", id)
@@ -7765,6 +7770,7 @@ func (j *DSGitHub) GetModelDataRepository(ctx *shared.Ctx, docs []interface{}) (
77657770
SourceID: sid,
77667771
URL: j.URL,
77677772
Description: description,
7773+
DefaultBranch: defaultBranch,
77687774
ReportingSource: repository.InsightsService,
77697775
EnabledServices: []string{string(repository.InsightsService)},
77707776
Source: GitHubDataSource,
@@ -7776,8 +7782,10 @@ func (j *DSGitHub) GetModelDataRepository(ctx *shared.Ctx, docs []interface{}) (
77767782
Subscribers: int(subscribers),
77777783
},
77787784
},
7779-
CreatedAt: createdAt,
7780-
UpdatedAt: time.Now(),
7785+
SourceCreatedAt: int64(createdAt),
7786+
SourceUpdatedAt: int64(updatedAt),
7787+
CreatedAt: tCreatedAt,
7788+
UpdatedAt: time.Now(),
77817789
}
77827790
data = append(data, repository.RepositoryUpdatedEvent{
77837791
RepositoryBaseEvent: repositoryBaseEvent,

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.17
55
require (
66
github.com/LF-Engineering/dev-analytics-libraries v1.1.28
77
github.com/LF-Engineering/insights-datasource-shared v1.5.18-0.20221031165121-cb720cbf98a9
8-
github.com/LF-Engineering/lfx-event-schema v0.1.33
8+
github.com/LF-Engineering/lfx-event-schema v0.1.36
99
github.com/aws/aws-lambda-go v1.28.0
1010
github.com/aws/aws-sdk-go v1.43.22
1111
github.com/google/go-github/v43 v43.0.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ github.com/LF-Engineering/dev-analytics-libraries v1.1.28/go.mod h1:O+9mOX1nf6qG
4646
github.com/LF-Engineering/insights-datasource-shared v1.5.18-0.20221031165121-cb720cbf98a9 h1:FBZZ1+Znl6t5JZoO9UMUQhF9VsGBI4YIs67U8DfLDEU=
4747
github.com/LF-Engineering/insights-datasource-shared v1.5.18-0.20221031165121-cb720cbf98a9/go.mod h1:9DmFQbC8nnm1C7k+/tDo3Rmqzzx7AzmhPBlFouXaBZ8=
4848
github.com/LF-Engineering/lfx-event-schema v0.1.14/go.mod h1:CfFIZ4mwzo88umf5+KxDQEzqlVkPG7Vx8eLK2oDfWIs=
49-
github.com/LF-Engineering/lfx-event-schema v0.1.33 h1:5Yk20tPkPbyOKEckcEF87qEQtl1H8l6TyA9wjKi+cl0=
50-
github.com/LF-Engineering/lfx-event-schema v0.1.33/go.mod h1:CfFIZ4mwzo88umf5+KxDQEzqlVkPG7Vx8eLK2oDfWIs=
49+
github.com/LF-Engineering/lfx-event-schema v0.1.36 h1:JshYAFzOVEiDnreGbo63ifAN8aDFtTnbyDCVRYack+s=
50+
github.com/LF-Engineering/lfx-event-schema v0.1.36/go.mod h1:CfFIZ4mwzo88umf5+KxDQEzqlVkPG7Vx8eLK2oDfWIs=
5151
github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
5252
github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY=
5353
github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=

0 commit comments

Comments
 (0)