Skip to content

Commit

Permalink
fix: fixed tree describer and deleted some columns of repository
Browse files Browse the repository at this point in the history
  • Loading branch information
ArshiaBP committed Dec 18, 2024
1 parent 436f3bd commit eeab8ee
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 44 deletions.
4 changes: 4 additions & 0 deletions provider/describer/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"github.com/opengovern/og-describer-github/pkg/sdk/models"
"github.com/opengovern/og-describer-github/provider/model"
"strings"
)

func GetAllTrees(ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender) ([]models.Resource, error) {
Expand Down Expand Up @@ -32,6 +33,9 @@ func GetRepositoryTrees(ctx context.Context, githubClient GitHubClient, stream *
}
branch, _, err := client.Repositories.GetBranch(ctx, owner, repo, repository.GetDefaultBranch(), false)
if err != nil {
if strings.Contains(err.Error(), "404 Not Found") {
return nil, nil
}
return nil, err
}
sha := branch.Commit.GetSHA()
Expand Down
40 changes: 20 additions & 20 deletions provider/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,26 +430,26 @@ type RepositoryDescription struct {
StargazerCount int
UpdatedAt steampipemodels.NullableTime
URL string
UsesCustomOpenGraphImage bool
CanAdminister bool
CanCreateProjects bool
CanSubscribe bool
CanUpdateTopics bool
HasStarred bool
PossibleCommitEmails []string
Subscription githubv4.SubscriptionState
Visibility githubv4.RepositoryVisibility
YourPermission githubv4.RepositoryPermission
WebCommitSignOffRequired bool
RepositoryTopicsTotalCount int
OpenIssuesTotalCount int
WatchersTotalCount int
Hooks []*github.Hook
Topics []string
SubscribersCount int
HasDownloads bool
HasPages bool
NetworkCount int
//UsesCustomOpenGraphImage bool
//CanAdminister bool
//CanCreateProjects bool
//CanSubscribe bool
//CanUpdateTopics bool
//HasStarred bool
PossibleCommitEmails []string
//Subscription githubv4.SubscriptionState
Visibility githubv4.RepositoryVisibility
//YourPermission githubv4.RepositoryPermission
WebCommitSignOffRequired bool
RepositoryTopicsTotalCount int
OpenIssuesTotalCount int
WatchersTotalCount int
Hooks []*github.Hook
Topics []string
SubscribersCount int
HasDownloads bool
HasPages bool
NetworkCount int
}

type ReleaseDescription struct {
Expand Down
48 changes: 24 additions & 24 deletions steampipe-plugin-github/github/table_github_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,36 +193,36 @@ func sharedRepositoryColumns() []*plugin.Column {
{Name: "url", Type: proto.ColumnType_STRING,
Transform: transform.FromField("Description.URL"),
Description: "The URL of the repository."},
{Name: "uses_custom_open_graph_image", Type: proto.ColumnType_BOOL,
Transform: transform.FromField("Description.UsesCustomOpenGraphImage"),
Description: "if true, this repository has a custom image to use with Open Graph as opposed to being represented by the owner's avatar."},
{Name: "can_administer", Type: proto.ColumnType_BOOL,
Transform: transform.FromField("Description.CanAdminister"),
Description: "If true, you can administer this repository."},
{Name: "can_create_projects", Type: proto.ColumnType_BOOL,
Transform: transform.FromField("Description.CanCreateProjects"),
Description: "If true, you can create projects in this repository."},
{Name: "can_subscribe", Type: proto.ColumnType_BOOL,
Transform: transform.FromField("Description.CanSubscribe"),
Description: "If true, you can subscribe to this repository."},
{Name: "can_update_topics", Type: proto.ColumnType_BOOL,
Transform: transform.FromField("Description.CanUpdateTopics"),
Description: "If true, you can update topics on this repository."},
{Name: "has_starred", Type: proto.ColumnType_BOOL,
Transform: transform.FromField("Description.HasStarred"),
Description: "If true, you have starred this repository."},
//{Name: "uses_custom_open_graph_image", Type: proto.ColumnType_BOOL,
// Transform: transform.FromField("Description.UsesCustomOpenGraphImage"),
// Description: "if true, this repository has a custom image to use with Open Graph as opposed to being represented by the owner's avatar."},
//{Name: "can_administer", Type: proto.ColumnType_BOOL,
// Transform: transform.FromField("Description.CanAdminister"),
// Description: "If true, you can administer this repository."},
//{Name: "can_create_projects", Type: proto.ColumnType_BOOL,
// Transform: transform.FromField("Description.CanCreateProjects"),
// Description: "If true, you can create projects in this repository."},
//{Name: "can_subscribe", Type: proto.ColumnType_BOOL,
// Transform: transform.FromField("Description.CanSubscribe"),
// Description: "If true, you can subscribe to this repository."},
//{Name: "can_update_topics", Type: proto.ColumnType_BOOL,
// Transform: transform.FromField("Description.CanUpdateTopics"),
// Description: "If true, you can update topics on this repository."},
//{Name: "has_starred", Type: proto.ColumnType_BOOL,
// Transform: transform.FromField("Description.HasStarred"),
// Description: "If true, you have starred this repository."},
{Name: "possible_commit_emails", Type: proto.ColumnType_JSON,
Transform: transform.FromField("Description.PossibleCommitEmails"),
Description: "A list of emails you can commit to this repository with."},
{Name: "subscription", Type: proto.ColumnType_STRING,
Transform: transform.FromField("Description.Subscription"),
Description: "Identifies if the current user is watching, not watching, or ignoring the repository."},
//{Name: "subscription", Type: proto.ColumnType_STRING,
// Transform: transform.FromField("Description.Subscription"),
// Description: "Identifies if the current user is watching, not watching, or ignoring the repository."},
{Name: "visibility", Type: proto.ColumnType_STRING,
Transform: transform.FromField("Description.Visibility"),
Description: "Indicates the repository's visibility level."},
{Name: "your_permission", Type: proto.ColumnType_STRING,
Transform: transform.FromField("Description.YourPermission"),
Description: "Your permission level on the repository. Will return null if authenticated as an GitHub App."},
//{Name: "your_permission", Type: proto.ColumnType_STRING,
// Transform: transform.FromField("Description.YourPermission"),
// Description: "Your permission level on the repository. Will return null if authenticated as an GitHub App."},
{Name: "web_commit_signoff_required", Type: proto.ColumnType_BOOL,
Transform: transform.FromField("Description.WebCommitSignOffRequired"),
Description: "If true, contributors are required to sign off on web-based commits in this repository."},
Expand Down

0 comments on commit eeab8ee

Please sign in to comment.