Skip to content

Commit

Permalink
upgrade gorelease and add more debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWoolfenden committed Jun 12, 2024
1 parent 0ab054b commit c823ad2
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

## checks out our code locally, so we can work with the files
- name: Checkout code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

## runs go test ./...
- name: Build
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@9550da953dd3b29aedf76cd635101e48eae5eebd # codeql-bundle-v2.17.4
uses: github/codeql-action/init@8f1a6fed33af5212fab8a999d004627ae8901d1b # codeql-bundle-v2.17.5
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -57,7 +57,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@9550da953dd3b29aedf76cd635101e48eae5eebd # codeql-bundle-v2.17.4
uses: github/codeql-action/autobuild@8f1a6fed33af5212fab8a999d004627ae8901d1b # codeql-bundle-v2.17.5

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -70,4 +70,4 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@9550da953dd3b29aedf76cd635101e48eae5eebd # codeql-bundle-v2.17.4
uses: github/codeql-action/analyze@8f1a6fed33af5212fab8a999d004627ae8901d1b # codeql-bundle-v2.17.5
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
Expand All @@ -31,7 +31,7 @@ jobs:
with:
terraform_version: 1.5.4
- name: Checkout code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
Expand All @@ -49,7 +49,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
needs:
- goreleaser
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@82556589c08f584cb95411629a94e6c2b68b9b80 # v5
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ jobs:

## checks out our code locally, so we can work with the files
- name: Checkout code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

## runs go test ./...
- name: Build
run: go build -o ${{ github.workspace }} ./...


- name: Checkout AWS
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: hashicorp/terraform-provider-aws
path: aws
Expand All @@ -34,7 +34,7 @@ jobs:
run: ${{ github.workspace }}/pike parse -d ${{ github.workspace }}/aws -name aws

- name: Checkout AZURERM
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: hashicorp/terraform-provider-azurerm
path: azurerm
Expand All @@ -43,7 +43,7 @@ jobs:
run: ${{ github.workspace }}/pike parse -d ${{ github.workspace }}/azurerm -name azurerm

- name: Generate Google
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: hashicorp/terraform-provider-google
path: google
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ terraform-provider-*
.destination
tf.plan
tf.json

dist/
13 changes: 12 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
# .goreleaser.yml

# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 2

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
- ./set-version.sh

builds:
Expand All @@ -26,7 +37,7 @@ archives:
brews:
- name: pike

tap:
repository:
owner: JamesWoolfenden
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
Expand Down
4 changes: 3 additions & 1 deletion src/coverage/aws.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# todo aws

Resource percentage coverage 50.95
Resource percentage coverage 51.31
Datasource percentage coverage 100.00

./resource.ps1 aws_accessanalyzer_archive_rule
Expand Down Expand Up @@ -433,6 +433,8 @@ Datasource percentage coverage 100.00
./resource.ps1 aws_organizations_organizational_unit
./resource.ps1 aws_organizations_resource_policy
./resource.ps1 aws_osis_pipeline
./resource.ps1 aws_paymentcryptography_key
./resource.ps1 aws_paymentcryptography_key_alias
./resource.ps1 aws_pinpoint_adm_channel
./resource.ps1 aws_pinpoint_apns_channel
./resource.ps1 aws_pinpoint_apns_sandbox_channel
Expand Down
7 changes: 5 additions & 2 deletions src/coverage/azure.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# todo azure

Resource percentage coverage 4.92
Datasource percentage coverage 38.41
Resource percentage coverage 4.91
Datasource percentage coverage 38.30

./resource.ps1 azurerm_aadb2c_directory
./resource.ps1 azurerm_active_directory_domain_service
Expand Down Expand Up @@ -285,6 +285,7 @@ Datasource percentage coverage 38.41
./resource.ps1 azurerm_data_protection_backup_policy_disk
./resource.ps1 azurerm_data_protection_backup_policy_kubernetes_cluster
./resource.ps1 azurerm_data_protection_backup_policy_postgresql
./resource.ps1 azurerm_data_protection_backup_policy_postgresql_flexible_server
./resource.ps1 azurerm_data_protection_backup_vault
./resource.ps1 azurerm_data_protection_resource_guard
./resource.ps1 azurerm_data_share
Expand Down Expand Up @@ -660,6 +661,7 @@ Datasource percentage coverage 38.41
./resource.ps1 azurerm_new_relic_monitor
./resource.ps1 azurerm_new_relic_tag_rule
./resource.ps1 azurerm_nginx_certificate
./resource.ps1 azurerm_nginx_configuration
./resource.ps1 azurerm_nginx_deployment
./resource.ps1 azurerm_notification_hub
./resource.ps1 azurerm_notification_hub_authorization_rule
Expand Down Expand Up @@ -1186,6 +1188,7 @@ Datasource percentage coverage 38.41
./resource.ps1 azurerm_network_security_group -type data
./resource.ps1 azurerm_network_service_tags -type data
./resource.ps1 azurerm_nginx_certificate -type data
./resource.ps1 azurerm_nginx_configuration -type data
./resource.ps1 azurerm_nginx_deployment -type data
./resource.ps1 azurerm_notification_hub -type data
./resource.ps1 azurerm_notification_hub_namespace -type data
Expand Down
13 changes: 11 additions & 2 deletions src/coverage/google.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# todo google

Resource percentage coverage 21.04
Datasource percentage coverage 84.97
Resource percentage coverage 20.88
Datasource percentage coverage 84.38

./resource.ps1 google_access_context_manager_access_level_condition
./resource.ps1 google_access_context_manager_service_perimeter_dry_run_resource
Expand Down Expand Up @@ -186,6 +186,7 @@ Datasource percentage coverage 84.97
./resource.ps1 google_compute_organization_security_policy_rule
./resource.ps1 google_compute_packet_mirroring
./resource.ps1 google_compute_per_instance_config
./resource.ps1 google_compute_project_cloud_armor_tier
./resource.ps1 google_compute_project_default_network_tier
./resource.ps1 google_compute_project_metadata
./resource.ps1 google_compute_public_advertised_prefix
Expand Down Expand Up @@ -553,6 +554,7 @@ Datasource percentage coverage 84.97
./resource.ps1 google_logging_project_exclusion
./resource.ps1 google_logging_project_sink
./resource.ps1 google_looker_instance
./resource.ps1 google_managed_kafka_cluster
./resource.ps1 google_memcache_instance
./resource.ps1 google_migration_center_group
./resource.ps1 google_migration_center_preference_set
Expand All @@ -568,6 +570,7 @@ Datasource percentage coverage 84.97
./resource.ps1 google_monitoring_slo
./resource.ps1 google_monitoring_uptime_check_config
./resource.ps1 google_netapp_active_directory
./resource.ps1 google_netapp_backup
./resource.ps1 google_netapp_backup_policy
./resource.ps1 google_netapp_backup_vault
./resource.ps1 google_netapp_kmsconfig
Expand Down Expand Up @@ -607,6 +610,7 @@ Datasource percentage coverage 84.97
./resource.ps1 google_network_services_lb_traffic_extension
./resource.ps1 google_network_services_mesh
./resource.ps1 google_network_services_service_binding
./resource.ps1 google_network_services_service_lb_policies
./resource.ps1 google_network_services_tcp_route
./resource.ps1 google_network_services_tls_route
./resource.ps1 google_notebooks_environment
Expand Down Expand Up @@ -669,6 +673,8 @@ Datasource percentage coverage 84.97
./resource.ps1 google_runtimeconfig_variable
./resource.ps1 google_scc_event_threat_detection_custom_module
./resource.ps1 google_scc_folder_custom_module
./resource.ps1 google_scc_management_folder_security_health_analytics_custom_module
./resource.ps1 google_scc_management_organization_event_threat_detection_custom_module
./resource.ps1 google_scc_mute_config
./resource.ps1 google_scc_notification_config
./resource.ps1 google_scc_organization_custom_module
Expand All @@ -689,6 +695,7 @@ Datasource percentage coverage 84.97
./resource.ps1 google_sourcerepo_repository_iam_binding
./resource.ps1 google_sourcerepo_repository_iam_member
./resource.ps1 google_sourcerepo_repository_iam_policy
./resource.ps1 google_spanner_instance_config
./resource.ps1 google_sql_source_representation_instance
./resource.ps1 google_sql_ssl_cert
./resource.ps1 google_storage_notification
Expand Down Expand Up @@ -739,8 +746,10 @@ Datasource percentage coverage 84.97
./resource.ps1 google_clouddeploy_custom_target_type_iam_policy -type data
./resource.ps1 google_clouddeploy_delivery_pipeline_iam_policy -type data
./resource.ps1 google_clouddeploy_target_iam_policy -type data
./resource.ps1 google_composer_user_workloads_secret -type data
./resource.ps1 google_compute_forwarding_rules -type data
./resource.ps1 google_compute_machine_types -type data
./resource.ps1 google_compute_security_policy -type data
./resource.ps1 google_compute_subnetworks -type data
./resource.ps1 google_container_attached_install_manifest -type data
./resource.ps1 google_container_aws_versions -type data
Expand Down
11 changes: 8 additions & 3 deletions src/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ func GetResources(file string, dirName string) ([]ResourceV2, error) {
LocalResources, err := GetLocalModules(block, dirName)
if err == nil {
Resources = append(LocalResources, Resources...)
} else {
log.Info().Msg(err.Error())
}
}
case "output", "variable", "locals", "provider":
Expand Down Expand Up @@ -122,7 +124,7 @@ func GetLocalModules(block *hclsyntax.Block, dirName string) ([]ResourceV2, erro

// not local
if strings.Contains(modulePath, "git::") {
return nil, nil
return nil, fmt.Errorf("git reference in module source path unsupported")
}

// have the path to the module
Expand Down Expand Up @@ -218,11 +220,14 @@ func GetPermission(result ResourceV2) (Sorted, error) {
log.Print(err)
}
case "provider", "random", "main", "ip", "http", "test", "local",
"archive", "tls", "template", "null", "time", "external":
"archive", "tls", "template", "null", "time", "external", "kubernetes",
"healthchecksio":
return myPermission, nil
default:
if result.Provider != "" && !(result.TypeName == "module") {
log.Printf("Provider %s was not found", result.Provider)
log.Info().Msgf("Provider %s was not found", result.Provider)
} else {
log.Info().Msgf("Provider %s Type %s not found", result.Provider, result.TypeName)
}
}

Expand Down

0 comments on commit c823ad2

Please sign in to comment.