Skip to content

Commit 11908c1

Browse files
committed
fix: update es client
1 parent 44763cf commit 11908c1

33 files changed

+622
-744
lines changed

provider/describer/action_artifact.go

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,16 @@ func GetRepositoryArtifacts(ctx context.Context, githubClient GitHubClient, stre
4343
value := models.Resource{
4444
ID: strconv.Itoa(int(artifact.GetID())),
4545
Name: artifact.GetName(),
46-
Description: JSONAllFieldsMarshaller{
47-
Value: model.ArtifactDescription{
48-
ID: artifact.GetID(),
49-
NodeID: artifact.NodeID,
50-
Name: artifact.Name,
51-
SizeInBytes: artifact.GetSizeInBytes(),
52-
ArchiveDownloadURL: artifact.ArchiveDownloadURL,
53-
Expired: artifact.GetExpired(),
54-
CreatedAt: &createdAt,
55-
ExpiresAt: &expiresAt,
56-
RepoFullName: &repoFullName,
57-
},
46+
Description: model.ArtifactDescription{
47+
ID: artifact.GetID(),
48+
NodeID: artifact.NodeID,
49+
Name: artifact.Name,
50+
SizeInBytes: artifact.GetSizeInBytes(),
51+
ArchiveDownloadURL: artifact.ArchiveDownloadURL,
52+
Expired: artifact.GetExpired(),
53+
CreatedAt: &createdAt,
54+
ExpiresAt: &expiresAt,
55+
RepoFullName: &repoFullName,
5856
},
5957
}
6058
if stream != nil {
@@ -89,18 +87,16 @@ func GetArtifact(ctx context.Context, githubClient GitHubClient, organizationNam
8987
value := models.Resource{
9088
ID: strconv.Itoa(int(artifact.GetID())),
9189
Name: artifact.GetName(),
92-
Description: JSONAllFieldsMarshaller{
93-
Value: model.ArtifactDescription{
94-
ID: artifact.GetID(),
95-
NodeID: artifact.NodeID,
96-
Name: artifact.Name,
97-
SizeInBytes: artifact.GetSizeInBytes(),
98-
ArchiveDownloadURL: artifact.ArchiveDownloadURL,
99-
Expired: artifact.GetExpired(),
100-
CreatedAt: &createdAt,
101-
ExpiresAt: &expiresAt,
102-
RepoFullName: &repoFullName,
103-
},
90+
Description: model.ArtifactDescription{
91+
ID: artifact.GetID(),
92+
NodeID: artifact.NodeID,
93+
Name: artifact.Name,
94+
SizeInBytes: artifact.GetSizeInBytes(),
95+
ArchiveDownloadURL: artifact.ArchiveDownloadURL,
96+
Expired: artifact.GetExpired(),
97+
CreatedAt: &createdAt,
98+
ExpiresAt: &expiresAt,
99+
RepoFullName: &repoFullName,
104100
},
105101
}
106102
if stream != nil {

provider/describer/action_repository_runner.go

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,14 @@ func GetRepositoryRunners(ctx context.Context, githubClient GitHubClient, stream
4848
value := models.Resource{
4949
ID: strconv.Itoa(int(runner.GetID())),
5050
Name: runner.GetName(),
51-
Description: JSONAllFieldsMarshaller{
52-
Value: model.RunnerDescription{
53-
ID: runner.ID,
54-
Name: runner.Name,
55-
OS: runner.OS,
56-
Status: runner.Status,
57-
Busy: runner.Busy,
58-
Labels: labels,
59-
RepoFullName: &repoFullName,
60-
},
51+
Description: model.RunnerDescription{
52+
ID: runner.ID,
53+
Name: runner.Name,
54+
OS: runner.OS,
55+
Status: runner.Status,
56+
Busy: runner.Busy,
57+
Labels: labels,
58+
RepoFullName: &repoFullName,
6159
},
6260
}
6361
if stream != nil {
@@ -98,16 +96,14 @@ func GetActionRunner(ctx context.Context, githubClient GitHubClient, organizatio
9896
value := models.Resource{
9997
ID: strconv.Itoa(int(runner.GetID())),
10098
Name: runner.GetName(),
101-
Description: JSONAllFieldsMarshaller{
102-
Value: model.RunnerDescription{
103-
ID: runner.ID,
104-
Name: runner.Name,
105-
OS: runner.OS,
106-
Status: runner.Status,
107-
Busy: runner.Busy,
108-
Labels: labels,
109-
RepoFullName: &repoFullName,
110-
},
99+
Description: model.RunnerDescription{
100+
ID: runner.ID,
101+
Name: runner.Name,
102+
OS: runner.OS,
103+
Status: runner.Status,
104+
Busy: runner.Busy,
105+
Labels: labels,
106+
RepoFullName: &repoFullName,
111107
},
112108
}
113109
if stream != nil {

provider/describer/action_repository_secret.go

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,13 @@ func GetRepositorySecrets(ctx context.Context, githubClient GitHubClient, stream
4444
value := models.Resource{
4545
ID: id,
4646
Name: secret.Name,
47-
Description: JSONAllFieldsMarshaller{
48-
Value: model.SecretDescription{
49-
Name: &secret.Name,
50-
CreatedAt: &createdAt,
51-
UpdatedAt: &updatedAt,
52-
Visibility: &secret.Visibility,
53-
SelectedRepositoriesURL: &secret.SelectedRepositoriesURL,
54-
RepoFullName: &repoFullName,
55-
},
47+
Description: model.SecretDescription{
48+
Name: &secret.Name,
49+
CreatedAt: &createdAt,
50+
UpdatedAt: &updatedAt,
51+
Visibility: &secret.Visibility,
52+
SelectedRepositoriesURL: &secret.SelectedRepositoriesURL,
53+
RepoFullName: &repoFullName,
5654
},
5755
}
5856
if stream != nil {
@@ -84,15 +82,13 @@ func GetRepoActionSecret(ctx context.Context, githubClient GitHubClient, organiz
8482
value := models.Resource{
8583
ID: id,
8684
Name: secret.Name,
87-
Description: JSONAllFieldsMarshaller{
88-
Value: model.SecretDescription{
89-
Name: &secret.Name,
90-
CreatedAt: &createdAt,
91-
UpdatedAt: &updatedAt,
92-
Visibility: &secret.Visibility,
93-
SelectedRepositoriesURL: &secret.SelectedRepositoriesURL,
94-
RepoFullName: &repoFullName,
95-
},
85+
Description: model.SecretDescription{
86+
Name: &secret.Name,
87+
CreatedAt: &createdAt,
88+
UpdatedAt: &updatedAt,
89+
Visibility: &secret.Visibility,
90+
SelectedRepositoriesURL: &secret.SelectedRepositoriesURL,
91+
RepoFullName: &repoFullName,
9692
},
9793
}
9894
if stream != nil {

provider/describer/action_workflow_run.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,9 @@ func GetRepositoryWorkflowRuns(ctx context.Context, sdk *resilientbridge.Resilie
189189
}
190190

191191
value := models.Resource{
192-
ID: strconv.Itoa(runDetail.ID),
193-
Name: name,
194-
Description: JSONAllFieldsMarshaller{
195-
Value: runDetail,
196-
},
192+
ID: strconv.Itoa(runDetail.ID),
193+
Name: name,
194+
Description: runDetail,
197195
}
198196
if stream != nil {
199197
if err := (*stream)(value); err != nil {

provider/describer/artifact_dockerfile.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,13 @@ func GetDockerfile(
229229
DockerfileContent: string(decoded),
230230
DockerfileContentBase64: &dockerfileB64,
231231
Repository: repoObj,
232-
Images: images,
232+
Images: images,
233233
}
234234

235235
value := models.Resource{
236-
ID: *output.URI,
237-
Name: *output.Name,
238-
Description: JSONAllFieldsMarshaller{
239-
Value: output,
240-
},
236+
ID: *output.URI,
237+
Name: *output.Name,
238+
Description: output,
241239
}
242240
return &value, nil
243241
}

provider/describer/audit_log.go

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,19 @@ func GetRepositoryAuditLog(ctx context.Context, githubClient GitHubClient, strea
4545
value := models.Resource{
4646
ID: audit.GetDocumentID(),
4747
Name: audit.GetName(),
48-
Description: JSONAllFieldsMarshaller{
49-
Value: model.AuditLogDescription{
50-
ID: audit.DocumentID,
51-
CreatedAt: &createdAt,
52-
Organization: &org,
53-
Phrase: &phrase,
54-
Include: &include,
55-
Action: audit.Action,
56-
Actor: audit.Actor,
57-
ActorLocation: &actorLocation,
58-
Team: audit.Team,
59-
UserLogin: audit.User,
60-
Repo: audit.Repository,
61-
Data: &data,
62-
},
48+
Description: model.AuditLogDescription{
49+
ID: audit.DocumentID,
50+
CreatedAt: &createdAt,
51+
Organization: &org,
52+
Phrase: &phrase,
53+
Include: &include,
54+
Action: audit.Action,
55+
Actor: audit.Actor,
56+
ActorLocation: &actorLocation,
57+
Team: audit.Team,
58+
UserLogin: audit.User,
59+
Repo: audit.Repository,
60+
Data: &data,
6361
},
6462
}
6563
if stream != nil {

provider/describer/branch.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,12 @@ func GetRepositoryBranches(ctx context.Context, githubClient GitHubClient, strea
185185
value := models.Resource{
186186
ID: id,
187187
Name: branch.Node.Name,
188-
Description: JSONAllFieldsMarshaller{
189-
Value: model.BranchDescription{
190-
Name: &branch.Node.Name,
191-
Commit: commit,
192-
BranchProtectionRule: branchProtctionRule,
193-
RepoFullName: &repoFullName,
194-
Protected: protected,
195-
},
188+
Description: model.BranchDescription{
189+
Name: &branch.Node.Name,
190+
Commit: commit,
191+
BranchProtectionRule: branchProtctionRule,
192+
RepoFullName: &repoFullName,
193+
Protected: protected,
196194
},
197195
}
198196
if stream != nil {

provider/describer/branch_protection.go

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -136,45 +136,43 @@ func GetRepositoryBranchProtections(ctx context.Context, githubClient GitHubClie
136136
value := models.Resource{
137137
ID: strconv.Itoa(rule.Id),
138138
Name: strconv.Itoa(rule.Id),
139-
Description: JSONAllFieldsMarshaller{
140-
Value: model.BranchProtectionDescription{
141-
AllowsDeletions: rule.AllowsDeletions,
142-
AllowsForcePushes: rule.AllowsForcePushes,
143-
BlocksCreations: rule.BlocksCreations,
144-
Id: rule.Id,
145-
NodeId: &rule.NodeId,
146-
DismissesStaleReviews: rule.DismissesStaleReviews,
147-
IsAdminEnforced: rule.IsAdminEnforced,
148-
LockAllowsFetchAndMerge: rule.LockAllowsFetchAndMerge,
149-
LockBranch: rule.LockBranch,
150-
Pattern: &rule.Pattern,
151-
RequireLastPushApproval: rule.RequireLastPushApproval,
152-
RequiredApprovingReviewCount: rule.RequiredApprovingReviewCount,
153-
RequiredDeploymentEnvironments: rule.RequiredDeploymentEnvironments,
154-
RequiredStatusChecks: rule.RequiredStatusChecks,
155-
RequiresApprovingReviews: rule.RequiresApprovingReviews,
156-
RequiresConversationResolution: rule.RequiresConversationResolution,
157-
RequiresCodeOwnerReviews: rule.RequiresCodeOwnerReviews,
158-
RequiresCommitSignatures: rule.RequiresCommitSignatures,
159-
RequiresDeployments: rule.RequiresDeployments,
160-
RequiresLinearHistory: rule.RequiresLinearHistory,
161-
RequiresStatusChecks: rule.RequiresStatusChecks,
162-
RequiresStrictStatusChecks: rule.RequiresStrictStatusChecks,
163-
RestrictsPushes: rule.RestrictsPushes,
164-
RestrictsReviewDismissals: rule.RestrictsReviewDismissals,
165-
RepoFullName: &repoFullName,
166-
CreatorLogin: &rule.Creator.Login,
167-
MatchingBranches: rule.MatchingBranches.TotalCount,
168-
PushAllowanceApps: pushAllowanceApps,
169-
PushAllowanceTeams: pushAllowanceTeams,
170-
PushAllowanceUsers: pushAllowanceUsers,
171-
BypassForcePushAllowanceApps: bypassForcePushAllowanceApps,
172-
BypassForcePushAllowanceTeams: bypassForcePushAllowanceTeams,
173-
BypassForcePushAllowanceUsers: bypassForcePushAllowanceUsers,
174-
BypassPullRequestAllowanceApps: bypassPullRequestAllowanceApps,
175-
BypassPullRequestAllowanceTeams: bypassPullRequestAllowanceTeams,
176-
BypassPullRequestAllowanceUsers: bypassPullRequestAllowanceUsers,
177-
},
139+
Description: model.BranchProtectionDescription{
140+
AllowsDeletions: rule.AllowsDeletions,
141+
AllowsForcePushes: rule.AllowsForcePushes,
142+
BlocksCreations: rule.BlocksCreations,
143+
Id: rule.Id,
144+
NodeId: &rule.NodeId,
145+
DismissesStaleReviews: rule.DismissesStaleReviews,
146+
IsAdminEnforced: rule.IsAdminEnforced,
147+
LockAllowsFetchAndMerge: rule.LockAllowsFetchAndMerge,
148+
LockBranch: rule.LockBranch,
149+
Pattern: &rule.Pattern,
150+
RequireLastPushApproval: rule.RequireLastPushApproval,
151+
RequiredApprovingReviewCount: rule.RequiredApprovingReviewCount,
152+
RequiredDeploymentEnvironments: rule.RequiredDeploymentEnvironments,
153+
RequiredStatusChecks: rule.RequiredStatusChecks,
154+
RequiresApprovingReviews: rule.RequiresApprovingReviews,
155+
RequiresConversationResolution: rule.RequiresConversationResolution,
156+
RequiresCodeOwnerReviews: rule.RequiresCodeOwnerReviews,
157+
RequiresCommitSignatures: rule.RequiresCommitSignatures,
158+
RequiresDeployments: rule.RequiresDeployments,
159+
RequiresLinearHistory: rule.RequiresLinearHistory,
160+
RequiresStatusChecks: rule.RequiresStatusChecks,
161+
RequiresStrictStatusChecks: rule.RequiresStrictStatusChecks,
162+
RestrictsPushes: rule.RestrictsPushes,
163+
RestrictsReviewDismissals: rule.RestrictsReviewDismissals,
164+
RepoFullName: &repoFullName,
165+
CreatorLogin: &rule.Creator.Login,
166+
MatchingBranches: rule.MatchingBranches.TotalCount,
167+
PushAllowanceApps: pushAllowanceApps,
168+
PushAllowanceTeams: pushAllowanceTeams,
169+
PushAllowanceUsers: pushAllowanceUsers,
170+
BypassForcePushAllowanceApps: bypassForcePushAllowanceApps,
171+
BypassForcePushAllowanceTeams: bypassForcePushAllowanceTeams,
172+
BypassForcePushAllowanceUsers: bypassForcePushAllowanceUsers,
173+
BypassPullRequestAllowanceApps: bypassPullRequestAllowanceApps,
174+
BypassPullRequestAllowanceTeams: bypassPullRequestAllowanceTeams,
175+
BypassPullRequestAllowanceUsers: bypassPullRequestAllowanceUsers,
178176
},
179177
}
180178
if stream != nil {

provider/describer/commit.go

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -194,20 +194,18 @@ func GetRepositoryCommits(ctx context.Context, sdk *resilientbridge.ResilientBri
194194
value := models.Resource{
195195
ID: commit.SHA,
196196
Name: commit.SHA,
197-
Description: JSONAllFieldsMarshaller{
198-
Value: model.CommitDescription{
199-
SHA: &commit.SHA,
200-
NodeID: &commit.NodeID,
201-
CommitDetail: commitDetail,
202-
URL: &commit.URL,
203-
HTMLURL: &commit.HTMLURL,
204-
CommentsURL: &commit.CommentsURL,
205-
Author: author,
206-
Committer: commiter,
207-
Parents: parents,
208-
Stats: stats,
209-
Files: files,
210-
},
197+
Description: model.CommitDescription{
198+
SHA: &commit.SHA,
199+
NodeID: &commit.NodeID,
200+
CommitDetail: commitDetail,
201+
URL: &commit.URL,
202+
HTMLURL: &commit.HTMLURL,
203+
CommentsURL: &commit.CommentsURL,
204+
Author: author,
205+
Committer: commiter,
206+
Parents: parents,
207+
Stats: stats,
208+
Files: files,
211209
},
212210
}
213211
results[j.index] = value

0 commit comments

Comments
 (0)