Skip to content

Commit

Permalink
fix: update resource type names
Browse files Browse the repository at this point in the history
  • Loading branch information
artaasadi committed Dec 8, 2024
1 parent 4d3c86d commit bbbd6d3
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 31 deletions.
4 changes: 2 additions & 2 deletions pkg/sdk/es/resources_clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -8059,7 +8059,7 @@ type UserPaginator struct {
}

func (k Client) NewUserPaginator(filters []essdk.BoolFilter, limit *int64) (UserPaginator, error) {
paginator, err := essdk.NewPaginator(k.ES(), "githubuser", filters, limit)
paginator, err := essdk.NewPaginator(k.ES(), "github_user", filters, limit)
if err != nil {
return UserPaginator{}, err
}
Expand Down Expand Up @@ -8372,7 +8372,7 @@ type WorkflowPaginator struct {
}

func (k Client) NewWorkflowPaginator(filters []essdk.BoolFilter, limit *int64) (WorkflowPaginator, error) {
paginator, err := essdk.NewPaginator(k.ES(), "githubworkflow", filters, limit)
paginator, err := essdk.NewPaginator(k.ES(), "github_workflow", filters, limit)
if err != nil {
return WorkflowPaginator{}, err
}
Expand Down
6 changes: 2 additions & 4 deletions pkg/sdk/runable/resource_type/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ func main() {
var resourceTypes []ResourceType

if resourceTypesFile == nil || len(*resourceTypesFile) == 0 {
//rt := "../../../../provider/resource_types/resource-types.json"
rt := "C:\\Users\\ASUS\\GolandProjects\\og-describer-github\\provider\\resource_types\\resource-types.json"
rt := "../../../../provider/resource_types/resource-types.json"
resourceTypesFile = &rt
}

Expand Down Expand Up @@ -71,8 +70,7 @@ func main() {

// Set default output paths if not provided
if output == nil || len(*output) == 0 {
v := "C:\\Users\\ASUS\\GolandProjects\\og-describer-github\\provider\\resource_types.go"
//v := "../../../../provider/resource_types.go"
v := "../../../../provider/resource_types.go"
output = &v
}

Expand Down
13 changes: 4 additions & 9 deletions pkg/sdk/runable/steampipe_es_client_generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ var (
pluginPath = flag.String("pluginPath", "", "Location of the steampipe plugin")
)

const PluginPath = "C:\\Users\\ASUS\\GolandProjects\\og-describer-github\\steampipe-plugin-github\\github"

//const PluginPath = "../../../../steampipe-plugin-github/github"
const PluginPath = "../../../../steampipe-plugin-github/github"

type IntegrationType struct {
Name string
Expand All @@ -45,13 +43,11 @@ type ResourceType struct {

func main() {
if output == nil || len(*output) == 0 {
//v := "../../es/resources_clients.go"
v := "C:\\Users\\ASUS\\GolandProjects\\og-describer-github\\pkg\\sdk\\es\\resources_clients.go"
v := "../../es/resources_clients.go"
output = &v
}
if file == nil || len(*file) == 0 {
//v := "../../../../provider/model/model.go"
v := "C:\\Users\\ASUS\\GolandProjects\\og-describer-github\\provider\\model\\model.go"
v := "../../../../provider/model/model.go"
file = &v
}

Expand All @@ -61,8 +57,7 @@ func main() {
}

if resourceTypesFile == nil || len(*resourceTypesFile) == 0 {
//rt := "../../../../provider/resource_types/resource-types.json"
rt := "C:\\Users\\ASUS\\GolandProjects\\og-describer-github\\provider\\resource_types\\resource-types.json"
rt := "../../../../provider/resource_types/resource-types.json"
resourceTypesFile = &rt
}

Expand Down
6 changes: 2 additions & 4 deletions pkg/sdk/runable/steampipe_index_map/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@ func main() {
var resourceTypes []ResourceType

if resourceTypesFile == nil || len(*resourceTypesFile) == 0 {
//rt := "../../../../provider/resource_types/resource-types.json"
rt := "C:\\Users\\ASUS\\GolandProjects\\og-describer-github\\provider\\resource_types\\resource-types.json"
rt := "../../../../provider/resource_types/resource-types.json"
resourceTypesFile = &rt
}

if indexMap == nil || len(*indexMap) == 0 {
v := "C:\\Users\\ASUS\\GolandProjects\\og-describer-github\\steampipe\\table_index_map.go"
//v := "../../../../steampipe/table_index_map.go"
v := "../../../../steampipe/table_index_map.go"
indexMap = &v
}

Expand Down
3 changes: 3 additions & 0 deletions provider/describer/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ func GetAllWorkflows(ctx context.Context, githubClient GitHubClient, organizatio
}
var values []models.Resource
for _, repo := range repositories {
if repo == nil {
continue
}
repoValues, err := GetRepositoryWorkflows(ctx, githubClient, stream, organizationName, repo.GetName())
if err != nil {
return nil, err
Expand Down
8 changes: 4 additions & 4 deletions provider/resource_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,9 @@ var ResourceTypes = map[string]model.ResourceType{
GetDescriber: nil,
},

"GithubUser": {
"Github/User": {
IntegrationType: configs.IntegrationName,
ResourceName: "GithubUser",
ResourceName: "Github/User",
Tags: map[string][]string{
"category": {"user"},
},
Expand All @@ -510,9 +510,9 @@ var ResourceTypes = map[string]model.ResourceType{
GetDescriber: nil,
},

"GithubWorkflow": {
"Github/Workflow": {
IntegrationType: configs.IntegrationName,
ResourceName: "GithubWorkflow",
ResourceName: "Github/Workflow",
Tags: map[string][]string{
"category": {"workflow"},
},
Expand Down
4 changes: 2 additions & 2 deletions provider/resource_types/resource-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@
"Model": "Tree"
},
{
"ResourceName": "GithubUser",
"ResourceName": "Github/User",
"Tags": {
"category": [
"user"
Expand All @@ -432,7 +432,7 @@
"Model": "User"
},
{
"ResourceName": "GithubWorkflow",
"ResourceName": "Github/Workflow",
"Tags": {
"category": [
"workflow"
Expand Down
12 changes: 6 additions & 6 deletions steampipe/table_index_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ var Map = map[string]string{
"Github/Traffic/View/Daily": "github_traffic_view_daily",
"Github/Traffic/View/Weekly": "github_traffic_view_weekly",
"Github/Tree": "github_tree",
"GithubUser": "github_user",
"GithubWorkflow": "github_workflow",
"Github/User": "github_user",
"Github/Workflow": "github_workflow",
"Github/CodeOwner": "github_code_owner",
"Github/Package/Container": "github_container_package",
"Github/Package/Maven": "github_maven_package",
Expand Down Expand Up @@ -87,8 +87,8 @@ var DescriptionMap = map[string]interface{}{
"Github/Traffic/View/Daily": opengovernance.TrafficViewDaily{},
"Github/Traffic/View/Weekly": opengovernance.TrafficViewWeekly{},
"Github/Tree": opengovernance.Tree{},
"GithubUser": opengovernance.User{},
"GithubWorkflow": opengovernance.Workflow{},
"Github/User": opengovernance.User{},
"Github/Workflow": opengovernance.Workflow{},
"Github/CodeOwner": opengovernance.CodeOwner{},
"Github/Package/Container": opengovernance.Package{},
"Github/Package/Maven": opengovernance.Package{},
Expand Down Expand Up @@ -134,8 +134,8 @@ var ReverseMap = map[string]string{
"github_traffic_view_daily": "Github/Traffic/View/Daily",
"github_traffic_view_weekly": "Github/Traffic/View/Weekly",
"github_tree": "Github/Tree",
"github_user": "GithubUser",
"github_workflow": "GithubWorkflow",
"github_user": "Github/User",
"github_workflow": "Github/Workflow",
"github_code_owner": "Github/CodeOwner",
"github_container_package": "Github/Package/Container",
"github_maven_package": "Github/Package/Maven",
Expand Down

0 comments on commit bbbd6d3

Please sign in to comment.