Skip to content

Commit 76ae617

Browse files
committed
fix: add columns to github repo
1 parent 2e03c4c commit 76ae617

File tree

4 files changed

+481
-50
lines changed

4 files changed

+481
-50
lines changed

cloudql/github/table_github_repository.go

Lines changed: 314 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ func sharedRepositoryColumns() []*plugin.Column {
2222
Transform: transform.FromField("Description.GitHubRepoID"),
2323
Description: "Unique identifier of the GitHub repository.",
2424
},
25+
{
26+
Name: "id",
27+
Type: proto.ColumnType_INT,
28+
Transform: transform.FromField("Description.GitHubRepoID"),
29+
Description: "Unique identifier of the GitHub repository.",
30+
},
2531
{
2632
Name: "node_id",
2733
Type: proto.ColumnType_STRING,
@@ -58,6 +64,12 @@ func sharedRepositoryColumns() []*plugin.Column {
5864
Transform: transform.FromField("Description.UpdatedAt"),
5965
Description: "Timestamp when the repository was last updated.",
6066
},
67+
{
68+
Name: "archived_at",
69+
Type: proto.ColumnType_STRING,
70+
Transform: transform.FromField("Description.ArchivedAt"),
71+
Description: "Timestamp when the repository was archived.",
72+
},
6173
{
6274
Name: "pushed_at",
6375
Type: proto.ColumnType_STRING,
@@ -89,10 +101,16 @@ func sharedRepositoryColumns() []*plugin.Column {
89101
Description: "Indicates if the repository has a security policy enabled.",
90102
},
91103
{
92-
Name: "owner",
104+
Name: "owner_login",
105+
Type: proto.ColumnType_JSON,
106+
Transform: transform.FromField("Description.Owner.Login"),
107+
Description: "Owner login.",
108+
},
109+
{
110+
Name: "contact_links",
93111
Type: proto.ColumnType_JSON,
94-
Transform: transform.FromField("Description.Owner"),
95-
Description: "Owner details of the repository.",
112+
Transform: transform.FromField("Description.ContactLinks"),
113+
Description: "ContactLinks",
96114
},
97115
{
98116
Name: "homepage_url",
@@ -138,11 +156,11 @@ func sharedRepositoryColumns() []*plugin.Column {
138156
},
139157
{
140158
Name: "organization",
141-
Type: proto.ColumnType_JSON,
159+
Type: proto.ColumnType_STRING,
142160
Transform: transform.FromField("Description.Organization"),
143161
Description: "Organization details of the repository.",
144162
},
145-
163+
146164
{
147165
Name: "parent",
148166
Type: proto.ColumnType_JSON,
@@ -168,10 +186,10 @@ func sharedRepositoryColumns() []*plugin.Column {
168186
Description: "Languages used in the repository along with their usage statistics.",
169187
},
170188
{
171-
Name: "repo_settings",
189+
Name: "hooks",
172190
Type: proto.ColumnType_JSON,
173-
Transform: transform.FromField("Description.RepositorySettings"),
174-
Description: "Settings of the repository.",
191+
Transform: transform.FromField("Description.Hooks"),
192+
Description: "Hooks.",
175193
},
176194
{
177195
Name: "security_settings",
@@ -180,16 +198,298 @@ func sharedRepositoryColumns() []*plugin.Column {
180198
Description: "Security settings of the repository.",
181199
},
182200
{
183-
Name: "repo_urls",
201+
Name: "interaction_ability",
202+
Type: proto.ColumnType_JSON,
203+
Transform: transform.FromField("Description.InteractionAbility"),
204+
Description: "InteractionAbility.",
205+
},
206+
{
207+
Name: "code_of_conduct",
208+
Type: proto.ColumnType_JSON,
209+
Transform: transform.FromField("Description.CodeOfConduct"),
210+
Description: "CodeOfConduct.",
211+
},
212+
{
213+
Name: "issue_templates",
184214
Type: proto.ColumnType_JSON,
185-
Transform: transform.FromField("Description.RepoURLs"),
186-
Description: "Repository URLs for different purposes (e.g., clone URLs).",
215+
Transform: transform.FromField("Description.IssueTemplates"),
216+
Description: "issue_templates.",
187217
},
188218
{
189-
Name: "metrics",
219+
Name: "possible_commit_emails",
190220
Type: proto.ColumnType_JSON,
191-
Transform: transform.FromField("Description.Metrics"),
192-
Description: "Metrics and statistics of the repository.",
221+
Transform: transform.FromField("Description.PossibleCommitEmails"),
222+
Description: "PossibleCommitEmails.",
223+
},
224+
{
225+
Name: "pull_request_templates",
226+
Type: proto.ColumnType_JSON,
227+
Transform: transform.FromField("Description.PullRequestTemplates"),
228+
Description: "PullRequestTemplates.",
229+
},
230+
{
231+
Name: "security_policy_url",
232+
Type: proto.ColumnType_STRING,
233+
Transform: transform.FromField("Description.SecurityPolicyUrl"),
234+
Description: "SecurityPolicyUrl.",
235+
},
236+
{
237+
Name: "projects_url",
238+
Type: proto.ColumnType_STRING,
239+
Transform: transform.FromField("Description.ProjectsUrl"),
240+
Description: "ProjectsUrl.",
241+
},
242+
{
243+
Name: "lock_reason",
244+
Type: proto.ColumnType_STRING,
245+
Transform: transform.FromField("Description.LockReason"),
246+
Description: "LockReason.",
247+
},
248+
{
249+
Name: "ssh_url",
250+
Type: proto.ColumnType_STRING,
251+
Transform: transform.FromField("Description.RepoURLs.SSHURL"),
252+
Description: "ssh_url.",
253+
},
254+
{
255+
Name: "url",
256+
Type: proto.ColumnType_STRING,
257+
Transform: transform.FromField("Description.RepoURLs.GitURL"),
258+
Description: "GitURL.",
259+
},
260+
{
261+
Name: "allow_update_branch",
262+
Type: proto.ColumnType_BOOL,
263+
Transform: transform.FromField("Description.RepositorySettings.AllowUpdateBranch"),
264+
Description: "Allow update branch.",
265+
},
266+
{
267+
Name: "uses_custom_open_graph_image",
268+
Type: proto.ColumnType_BOOL,
269+
Transform: transform.FromField("Description.UsesCustomOpenGraphImage"),
270+
Description: "UsesCustomOpenGraphImage.",
271+
},
272+
{
273+
Name: "auto_merge_allowed",
274+
Type: proto.ColumnType_BOOL,
275+
Transform: transform.FromField("Description.RepositorySettings.AllowAutoMerge"),
276+
Description: "Allow auto merge.",
277+
},
278+
{
279+
Name: "is_user_configuration_repository",
280+
Type: proto.ColumnType_BOOL,
281+
Transform: transform.FromField("Description.IsUserConfigurationRepository"),
282+
Description: "IsUserConfigurationRepository.",
283+
},
284+
{
285+
Name: "is_user_configuration_repository",
286+
Type: proto.ColumnType_BOOL,
287+
Transform: transform.FromField("Description.IsUserConfigurationRepository"),
288+
Description: "IsUserConfigurationRepository.",
289+
},
290+
{
291+
Name: "rebase_merge_allowed",
292+
Type: proto.ColumnType_BOOL,
293+
Transform: transform.FromField("Description.RepositorySettings.AllowRebaseMerge"),
294+
Description: "Allow rebase merge.",
295+
},
296+
{
297+
Name: "delete_branch_on_merge",
298+
Type: proto.ColumnType_BOOL,
299+
Transform: transform.FromField("Description.RepositorySettings.DeleteBranchOnMerge"),
300+
Description: "Delete branch on merge.",
301+
},
302+
{
303+
Name: "fork_count",
304+
Type: proto.ColumnType_INT,
305+
Transform: transform.FromField("Description.Metrics.Forks"),
306+
Description: "Forks.",
307+
},
308+
{
309+
Name: "disk_usage",
310+
Type: proto.ColumnType_INT,
311+
Transform: transform.FromField("Description.DiskUsage"),
312+
Description: "DiskUsage.",
313+
},
314+
{
315+
Name: "network_count",
316+
Type: proto.ColumnType_INT,
317+
Transform: transform.FromField("Description.NetworkCount"),
318+
Description: "NetworkCount.",
319+
},
320+
{
321+
Name: "open_issues_total_count",
322+
Type: proto.ColumnType_INT,
323+
Transform: transform.FromField("Description.OpenIssuesCount"),
324+
Description: "OpenIssuesCount.",
325+
},
326+
{
327+
Name: "watchers_total_count",
328+
Type: proto.ColumnType_INT,
329+
Transform: transform.FromField("Description.WatchersCount"),
330+
Description: "WatchersCount.",
331+
},
332+
{
333+
Name: "repository_topics_total_count",
334+
Type: proto.ColumnType_INT,
335+
Transform: transform.FromField("Description.TopicsTotalCount"),
336+
Description: "WatchersCount.",
337+
},
338+
{
339+
Name: "forking_allowed",
340+
Type: proto.ColumnType_BOOL,
341+
Transform: transform.FromField("Description.RepositorySettings.ForkingAllowed"),
342+
Description: "ForkingAllowed.",
343+
},
344+
{
345+
Name: "has_discussions_enabled",
346+
Type: proto.ColumnType_BOOL,
347+
Transform: transform.FromField("Description.RepositorySettings.HasDiscussionsEnabled"),
348+
Description: "ForkingAllowed.",
349+
},
350+
{
351+
Name: "has_downloads",
352+
Type: proto.ColumnType_BOOL,
353+
Transform: transform.FromField("Description.RepositorySettings.HasDownloads"),
354+
Description: "HasDownloads.",
355+
},
356+
{
357+
Name: "has_issues_enabled",
358+
Type: proto.ColumnType_BOOL,
359+
Transform: transform.FromField("Description.RepositorySettings.HasIssuesEnabled"),
360+
Description: "HasIssuesEnabled.",
361+
},
362+
{
363+
Name: "has_pages",
364+
Type: proto.ColumnType_BOOL,
365+
Transform: transform.FromField("Description.RepositorySettings.HasPages"),
366+
Description: "HasPages.",
367+
},
368+
{
369+
Name: "has_projects_enabled",
370+
Type: proto.ColumnType_BOOL,
371+
Transform: transform.FromField("Description.RepositorySettings.HasProjectsEnabled"),
372+
Description: "HasProjectsEnabled.",
373+
},
374+
{
375+
Name: "has_vulnerability_alerts_enabled",
376+
Type: proto.ColumnType_BOOL,
377+
Transform: transform.FromField("Description.SecuritySettings.VulnerabilityAlertsEnabled"),
378+
Description: "HasProjectsEnabled.",
379+
},
380+
{
381+
Name: "has_wiki_enabled",
382+
Type: proto.ColumnType_BOOL,
383+
Transform: transform.FromField("Description.RepositorySettings.HasWikiEnabled"),
384+
Description: "HasWikiEnabled.",
385+
},
386+
{
387+
Name: "is_archived",
388+
Type: proto.ColumnType_BOOL,
389+
Transform: transform.FromField("Description.RepositorySettings.Archived"),
390+
Description: "Archived.",
391+
},
392+
{
393+
Name: "is_disabled",
394+
Type: proto.ColumnType_BOOL,
395+
Transform: transform.FromField("Description.RepositorySettings.Disabled"),
396+
Description: "Archived.",
397+
},
398+
{
399+
Name: "is_locked",
400+
Type: proto.ColumnType_BOOL,
401+
Transform: transform.FromField("Description.RepositorySettings.Locked"),
402+
Description: "Locked.",
403+
},
404+
{
405+
Name: "is_template",
406+
Type: proto.ColumnType_BOOL,
407+
Transform: transform.FromField("Description.RepositorySettings.IsTemplate"),
408+
Description: "IsTemplate.",
409+
},
410+
{
411+
Name: "is_private",
412+
Type: proto.ColumnType_BOOL,
413+
Transform: transform.FromField("Description.RepositorySettings.IsPrivate"),
414+
Description: "IsPrivate.",
415+
},
416+
{
417+
Name: "is_mirror",
418+
Type: proto.ColumnType_BOOL,
419+
Transform: transform.FromField("Description.RepositorySettings.IsMirror"),
420+
Description: "IsMirror.",
421+
},
422+
{
423+
Name: "is_in_organization",
424+
Type: proto.ColumnType_BOOL,
425+
Transform: transform.FromField("Description.RepositorySettings.IsInOrganization"),
426+
Description: "IsInOrganization.",
427+
},
428+
{
429+
Name: "is_blank_issues_enabled",
430+
Type: proto.ColumnType_BOOL,
431+
Transform: transform.FromField("Description.RepositorySettings.BlankIssuesEnabled"),
432+
Description: "BlankIssuesEnabled.",
433+
},
434+
{
435+
Name: "merge_commit_allowed",
436+
Type: proto.ColumnType_BOOL,
437+
Transform: transform.FromField("Description.RepositorySettings.MergeCommitAllowed"),
438+
Description: "MergeCommitAllowed.",
439+
},
440+
{
441+
Name: "merge_commit_message",
442+
Type: proto.ColumnType_STRING,
443+
Transform: transform.FromField("Description.RepositorySettings.MergeCommitMessage"),
444+
Description: "MergeCommitAllowed.",
445+
},
446+
{
447+
Name: "merge_commit_title",
448+
Type: proto.ColumnType_STRING,
449+
Transform: transform.FromField("Description.RepositorySettings.MergeCommitTitle"),
450+
Description: "MergeCommitAllowed.",
451+
},
452+
{
453+
Name: "mirror_url",
454+
Type: proto.ColumnType_STRING,
455+
Transform: transform.FromField("Description.RepositorySettings.MirrorURL"),
456+
Description: "MirrorURL.",
457+
},
458+
{
459+
Name: "squash_merge_allowed",
460+
Type: proto.ColumnType_BOOL,
461+
Transform: transform.FromField("Description.RepositorySettings.SquashMergeAllowed"),
462+
Description: "MirrorURL.",
463+
},
464+
{
465+
Name: "web_commit_signoff_required",
466+
Type: proto.ColumnType_BOOL,
467+
Transform: transform.FromField("Description.RepositorySettings.WebCommitSignoffRequired"),
468+
Description: "WebCommitSignoffRequired.",
469+
},
470+
{
471+
Name: "squash_merge_commit_message",
472+
Type: proto.ColumnType_STRING,
473+
Transform: transform.FromField("Description.RepositorySettings.SquashMergeCommitMessage"),
474+
Description: "MirrorURL.",
475+
},
476+
{
477+
Name: "squash_merge_commit_title",
478+
Type: proto.ColumnType_STRING,
479+
Transform: transform.FromField("Description.RepositorySettings.SquashMergeCommitTitle"),
480+
Description: "MirrorURL.",
481+
},
482+
{
483+
Name: "stargazer_count",
484+
Type: proto.ColumnType_INT,
485+
Transform: transform.FromField("Description.Metrics.Stargazers"),
486+
Description: "Stargazers.",
487+
},
488+
{
489+
Name: "subscribers_count",
490+
Type: proto.ColumnType_INT,
491+
Transform: transform.FromField("Description.Metrics.Subscribers"),
492+
Description: "Subscribers.",
193493
},
194494
}
195495
}

0 commit comments

Comments
 (0)