From c811992b74952179711128cdca065aa6800b30a4 Mon Sep 17 00:00:00 2001 From: Mohamad Choupan Date: Sun, 22 Dec 2024 04:10:54 +0330 Subject: [PATCH] fix: change language mapping --- pkg/sdk/es/resources_clients.go | 2 + provider/describer/repository.go | 4 +- provider/model/model.go | 2 +- provider/resource_types.go | 666 ++++++++++-------- .../github/table_github_repository.go | 4 +- 5 files changed, 372 insertions(+), 306 deletions(-) diff --git a/pkg/sdk/es/resources_clients.go b/pkg/sdk/es/resources_clients.go index 54b9924a..0fc061a6 100644 --- a/pkg/sdk/es/resources_clients.go +++ b/pkg/sdk/es/resources_clients.go @@ -3462,6 +3462,7 @@ var listRepositoryFilters = map[string]string{ "owner": "Description.Owner", "parent": "Description.Parent", "permissions": "Description.Permissions", + "primary_language": "Description.PrimaryLanguage", "pushed_at": "Description.PushedAt", "repo_settings": "Description.RepositorySettings", "repo_urls": "Description.RepoURLs", @@ -3552,6 +3553,7 @@ var getRepositoryFilters = map[string]string{ "owner": "Description.Owner", "parent": "Description.Parent", "permissions": "Description.Permissions", + "primary_language": "Description.PrimaryLanguage", "pushed_at": "Description.PushedAt", "repo_settings": "Description.RepositorySettings", "repo_urls": "Description.RepoURLs", diff --git a/provider/describer/repository.go b/provider/describer/repository.go index 15e11cc9..421857fb 100644 --- a/provider/describer/repository.go +++ b/provider/describer/repository.go @@ -163,7 +163,7 @@ func GetRepository( // 3) Fetch /languages => map[string]int langs, err := util_fetchLanguages(sdk, organizationName, repositoryName) if err == nil && len(langs) > 0 { - finalDetail.LanguageBreakdown = langs + finalDetail.Languages = langs } // 4) Enrich with metrics @@ -296,7 +296,7 @@ func util_transformToFinalRepoDetail(detail *model.RepoDetail) *model.Repository PrimaryLanguage: detail.PrimaryLanguage, // We'll fill in LanguageBreakdown after calling /languages - LanguageBreakdown: nil, + Languages: nil, RepositorySettings: model.RepositorySettings{ HasDiscussionsEnabled: detail.HasDiscussions, diff --git a/provider/model/model.go b/provider/model/model.go index ac287354..d12b744d 100755 --- a/provider/model/model.go +++ b/provider/model/model.go @@ -859,7 +859,7 @@ type RepositoryDescription struct { Parent *RepositoryDescription `json:"parent"` Source *RepositoryDescription `json:"source"` PrimaryLanguage *string `json:"primary_language,omitempty"` - LanguageBreakdown map[string]int `json:"language_breakdown,omitempty"` + Languages map[string]int `json:"languages,omitempty"` RepositorySettings RepositorySettings `json:"repo_settings"` SecuritySettings SecuritySettings `json:"security_settings"` RepoURLs RepoURLs `json:"repo_urls"` diff --git a/provider/resource_types.go b/provider/resource_types.go index fd3c3929..c5515f36 100644 --- a/provider/resource_types.go +++ b/provider/resource_types.go @@ -1,406 +1,470 @@ package provider - import ( - model "github.com/opengovern/og-describer-github/pkg/sdk/models" - "github.com/opengovern/og-describer-github/provider/configs" "github.com/opengovern/og-describer-github/provider/describer" + "github.com/opengovern/og-describer-github/provider/configs" + model "github.com/opengovern/og-describer-github/pkg/sdk/models" ) - var ResourceTypes = map[string]model.ResourceType{ "Github/Actions/Artifact": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Actions/Artifact", - Tags: map[string][]string{ - "category": {"Action"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllArtifacts), - GetDescriber: DescribeSingleByRepo(describer.GetArtifact), + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Actions/Artifact", + Tags: map[string][]string{ + "category": {"Action"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllArtifacts), + GetDescriber: DescribeSingleByRepo(describer.GetArtifact), }, "Github/Actions/Runner": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Actions/Runner", - Tags: map[string][]string{ - "category": {"Action"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllRunners), - GetDescriber: DescribeSingleByRepo(describer.GetActionRunner), + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Actions/Runner", + Tags: map[string][]string{ + "category": {"Action"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllRunners), + GetDescriber: DescribeSingleByRepo(describer.GetActionRunner), }, "Github/Actions/Secret": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Actions/Secret", - Tags: map[string][]string{ - "category": {"Action"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllSecrets), - GetDescriber: DescribeSingleByRepo(describer.GetRepoActionSecret), + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Actions/Secret", + Tags: map[string][]string{ + "category": {"Action"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllSecrets), + GetDescriber: DescribeSingleByRepo(describer.GetRepoActionSecret), }, "Github/Actions/WorkflowRun": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Actions/WorkflowRun", - Tags: map[string][]string{ - "category": {"Action"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllWorkflowRuns), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Actions/WorkflowRun", + Tags: map[string][]string{ + "category": {"Action"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllWorkflowRuns), + GetDescriber: nil, }, "Github/Branch": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Branch", - Tags: map[string][]string{ - "category": {"Branch"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllBranches), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Branch", + Tags: map[string][]string{ + "category": {"Branch"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllBranches), + GetDescriber: nil, }, "Github/Branch/Protection": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Branch/Protection", - Tags: map[string][]string{ - "category": {"Branch"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllBranchProtections), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Branch/Protection", + Tags: map[string][]string{ + "category": {"Branch"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllBranchProtections), + GetDescriber: nil, }, "Github/Commit": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Commit", - Tags: map[string][]string{ - "category": {"Commit"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.ListCommits), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Commit", + Tags: map[string][]string{ + "category": {"Commit"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.ListCommits), + GetDescriber: nil, }, "Github/Issue": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Issue", - Tags: map[string][]string{ - "category": {"Issue"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetIssueList), - GetDescriber: DescribeSingleByRepo(describer.GetIssue), + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Issue", + Tags: map[string][]string{ + "category": {"Issue"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetIssueList), + GetDescriber: DescribeSingleByRepo(describer.GetIssue), }, "Github/License": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/License", - Tags: map[string][]string{ - "category": {"License"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetLicenseList), - GetDescriber: DescribeSingleByRepo(describer.GetLicense), + IntegrationType: configs.IntegrationName, + ResourceName: "Github/License", + Tags: map[string][]string{ + "category": {"License"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetLicenseList), + GetDescriber: DescribeSingleByRepo(describer.GetLicense), }, "Github/Organization": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Organization", - Tags: map[string][]string{ - "category": {"Organization"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetOrganizationList), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Organization", + Tags: map[string][]string{ + "category": {"Organization"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetOrganizationList), + GetDescriber: nil, }, "Github/Organization/Collaborator": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Organization/Collaborator", - Tags: map[string][]string{ - "category": {"Organization"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllOrganizationsCollaborators), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Organization/Collaborator", + Tags: map[string][]string{ + "category": {"Organization"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllOrganizationsCollaborators), + GetDescriber: nil, }, "Github/Organization/Dependabot/Alert": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Organization/Dependabot/Alert", - Tags: map[string][]string{ - "category": {"Organization"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllOrganizationsDependabotAlerts), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Organization/Dependabot/Alert", + Tags: map[string][]string{ + "category": {"Organization"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllOrganizationsDependabotAlerts), + GetDescriber: nil, }, "Github/Organization/Member": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Organization/Member", - Tags: map[string][]string{ - "category": {"Organization"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllMembers), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Organization/Member", + Tags: map[string][]string{ + "category": {"Organization"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllMembers), + GetDescriber: nil, }, "Github/Organization/Team": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Organization/Team", - Tags: map[string][]string{ - "category": {"Organization"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetOrganizationTeamList), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Organization/Team", + Tags: map[string][]string{ + "category": {"Organization"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetOrganizationTeamList), + GetDescriber: nil, }, "Github/PullRequest": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/PullRequest", - Tags: map[string][]string{ - "category": {"PullRequest"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllPullRequests), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/PullRequest", + Tags: map[string][]string{ + "category": {"PullRequest"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllPullRequests), + GetDescriber: nil, }, "Github/Release": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Release", - Tags: map[string][]string{ - "category": {"Release"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetReleaseList), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Release", + Tags: map[string][]string{ + "category": {"Release"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetReleaseList), + GetDescriber: nil, }, "Github/Repository": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Repository", - Tags: map[string][]string{ - "category": {"Repository"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetRepositoryList), - GetDescriber: DescribeSingleByRepo(describer.GetRepository), + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Repository", + Tags: map[string][]string{ + "category": {"Repository"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetRepositoryList), + GetDescriber: DescribeSingleByRepo(describer.GetRepository), }, "Github/Repository/Collaborator": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Repository/Collaborator", - Tags: map[string][]string{ - "category": {"Repository"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllRepositoriesCollaborators), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Repository/Collaborator", + Tags: map[string][]string{ + "category": {"Repository"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllRepositoriesCollaborators), + GetDescriber: nil, }, "Github/Repository/DependabotAlert": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Repository/DependabotAlert", - Tags: map[string][]string{ - "category": {"Repository"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllRepositoriesDependabotAlerts), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Repository/DependabotAlert", + Tags: map[string][]string{ + "category": {"Repository"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllRepositoriesDependabotAlerts), + GetDescriber: nil, }, "Github/Repository/Deployment": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Repository/Deployment", - Tags: map[string][]string{ - "category": {"Repository"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllRepositoriesDeployments), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Repository/Deployment", + Tags: map[string][]string{ + "category": {"Repository"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllRepositoriesDeployments), + GetDescriber: nil, }, "Github/Repository/Environment": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Repository/Environment", - Tags: map[string][]string{ - "category": {"Repository"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllRepositoriesEnvironments), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Repository/Environment", + Tags: map[string][]string{ + "category": {"Repository"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllRepositoriesEnvironments), + GetDescriber: nil, }, "Github/Repository/Ruleset": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Repository/Ruleset", - Tags: map[string][]string{ - "category": {"Repository"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllRepositoriesRuleSets), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Repository/Ruleset", + Tags: map[string][]string{ + "category": {"Repository"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllRepositoriesRuleSets), + GetDescriber: nil, }, "Github/Repository/SBOM": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Repository/SBOM", - Tags: map[string][]string{ - "category": {"Repository"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllRepositoriesSBOMs), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Repository/SBOM", + Tags: map[string][]string{ + "category": {"Repository"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllRepositoriesSBOMs), + GetDescriber: nil, }, "Github/Repository/VulnerabilityAlert": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Repository/VulnerabilityAlert", - Tags: map[string][]string{ - "category": {"Repository"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllRepositoriesVulnerabilities), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Repository/VulnerabilityAlert", + Tags: map[string][]string{ + "category": {"Repository"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllRepositoriesVulnerabilities), + GetDescriber: nil, }, "Github/Tag": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Tag", - Tags: map[string][]string{ - "category": {"Tag"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllTags), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Tag", + Tags: map[string][]string{ + "category": {"Tag"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllTags), + GetDescriber: nil, }, "Github/Team/Member": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Team/Member", - Tags: map[string][]string{ - "category": {"Team"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllTeamsMembers), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Team/Member", + Tags: map[string][]string{ + "category": {"Team"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllTeamsMembers), + GetDescriber: nil, }, "Github/User": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/User", - Tags: map[string][]string{ - "category": {"user"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetUser), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/User", + Tags: map[string][]string{ + "category": {"user"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetUser), + GetDescriber: nil, }, "Github/Workflow": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Workflow", - Tags: map[string][]string{ - "category": {"workflow"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetAllWorkflows), - GetDescriber: DescribeSingleByRepo(describer.GetRepositoryWorkflow), + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Workflow", + Tags: map[string][]string{ + "category": {"workflow"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetAllWorkflows), + GetDescriber: DescribeSingleByRepo(describer.GetRepositoryWorkflow), }, "Github/Container/Package": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Container/Package", - Tags: map[string][]string{ - "category": {"package"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetContainerPackageList), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Container/Package", + Tags: map[string][]string{ + "category": {"package"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetContainerPackageList), + GetDescriber: nil, }, "Github/Package/Maven": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Package/Maven", - Tags: map[string][]string{ - "category": {"package"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetMavenPackageList), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Package/Maven", + Tags: map[string][]string{ + "category": {"package"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetMavenPackageList), + GetDescriber: nil, }, "Github/NPM/Package": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/NPM/Package", - Tags: map[string][]string{ - "category": {"package"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetNPMPackageList), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/NPM/Package", + Tags: map[string][]string{ + "category": {"package"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetNPMPackageList), + GetDescriber: nil, }, "Github/Nuget/Package": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Nuget/Package", - Tags: map[string][]string{ - "category": {"package"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.GetNugetPackageList), - GetDescriber: DescribeSingleByRepo(describer.GetNugetPackage), + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Nuget/Package", + Tags: map[string][]string{ + "category": {"package"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.GetNugetPackageList), + GetDescriber: DescribeSingleByRepo(describer.GetNugetPackage), }, "Github/Artifact/DockerFile": { - IntegrationType: configs.IntegrationName, - ResourceName: "Github/Artifact/DockerFile", - Tags: map[string][]string{ - "category": {"artifact_dockerfile"}, - }, - Labels: map[string]string{}, - Annotations: map[string]string{}, - ListDescriber: DescribeByGithub(describer.ListArtifactDockerFiles), - GetDescriber: nil, + IntegrationType: configs.IntegrationName, + ResourceName: "Github/Artifact/DockerFile", + Tags: map[string][]string{ + "category": {"artifact_dockerfile"}, + }, + Labels: map[string]string{ + }, + Annotations: map[string]string{ + }, + ListDescriber: DescribeByGithub(describer.ListArtifactDockerFiles), + GetDescriber: nil, }, } diff --git a/steampipe-plugin-github/github/table_github_repository.go b/steampipe-plugin-github/github/table_github_repository.go index 64438327..6ecf53d5 100644 --- a/steampipe-plugin-github/github/table_github_repository.go +++ b/steampipe-plugin-github/github/table_github_repository.go @@ -148,9 +148,9 @@ func sharedRepositoryColumns() []*plugin.Column { Description: "Primary language used in the repository.", }, { - Name: "language_breakdown", + Name: "languages", Type: proto.ColumnType_JSON, - Transform: transform.FromField("Description.LanguageBreakdown"), + Transform: transform.FromField("Description.Languages"), Description: "Languages used in the repository along with their usage statistics.", }, {