Skip to content

Commit

Permalink
Merge pull request #650 from overmindtech/remove-docgen
Browse files Browse the repository at this point in the history
Remove all traces of docgen
  • Loading branch information
dylanratcliffe authored Oct 14, 2024
2 parents 50dbd93 + 633f891 commit 6242e2a
Show file tree
Hide file tree
Showing 270 changed files with 3 additions and 3,884 deletions.
2 changes: 0 additions & 2 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/bash

go mod vendor

go install github.com/overmindtech/docgen@latest
3 changes: 0 additions & 3 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ jobs:
run: |
go get -v -t -d ./...
- name: Install Docgen
run: go install github.com/overmindtech/docgen@latest

- name: Go Generate
run: |
go generate ./...
Expand Down
12 changes: 0 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,3 @@ go test ./sources/integration/networkmanager -v -count=1 -run '^TestIntegrationN
### Packaging
Docker images can be created manually using `docker build`, but GitHub actions also exist that are able to create, tag and push images. Images will be build for the `main` branch, and also for any commits tagged with a version such as `v1.2.0`
### Generating Docs
Source data for docs is stored in `docs-data` and can be generated using:
Ensure that [`docgen`](https://github.com/overmindtech/docgen) is installed.
From the root of the project run:
```shell
go generate ./...
```
8 changes: 0 additions & 8 deletions adapters/apigateway-resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ func resourceOutputMapper(query, scope string, awsItem *types.Resource) (*sdp.It
return &item, nil
}

//go:generate docgen ../../docs-data
// +overmind:type apigateway-resource
// +overmind:descriptiveType API Gateway Resource
// +overmind:get Get a Resource by rest-api-id/resource-id
// +overmind:search Search Resources by REST API ID
// +overmind:group AWS
// +overmind:terraform:queryMap aws_api_gateway_resource.id

func NewAPIGatewayResourceAdapter(client *apigateway.Client, accountID string, region string) *adapterhelpers.GetListAdapter[*types.Resource, *apigateway.Client, *apigateway.Options] {
return &adapterhelpers.GetListAdapter[*types.Resource, *apigateway.Client, *apigateway.Options]{
ItemType: "apigateway-resource",
Expand Down
12 changes: 0 additions & 12 deletions adapters/apigateway-rest-api.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ func restApiOutputMapper(scope string, awsItem *types.RestApi) (*sdp.Item, error

if awsItem.EndpointConfiguration != nil && awsItem.EndpointConfiguration.VpcEndpointIds != nil {
for _, vpcEndpointID := range awsItem.EndpointConfiguration.VpcEndpointIds {
// +overmind:link ec2-vpc-endpoint
item.LinkedItemQueries = append(item.LinkedItemQueries, &sdp.LinkedItemQuery{
Query: &sdp.Query{
Type: "ec2-vpc-endpoint",
Expand All @@ -110,7 +109,6 @@ func restApiOutputMapper(scope string, awsItem *types.RestApi) (*sdp.Item, error
}

if awsItem.RootResourceId != nil {
// +overmind:link apigateway-resource
item.LinkedItemQueries = append(item.LinkedItemQueries, &sdp.LinkedItemQuery{
Query: &sdp.Query{
Type: "apigateway-resource",
Expand All @@ -126,7 +124,6 @@ func restApiOutputMapper(scope string, awsItem *types.RestApi) (*sdp.Item, error
})
}

// +overmind:link apigateway-resource
item.LinkedItemQueries = append(item.LinkedItemQueries, &sdp.LinkedItemQuery{
Query: &sdp.Query{
Type: "apigateway-resource",
Expand All @@ -145,15 +142,6 @@ func restApiOutputMapper(scope string, awsItem *types.RestApi) (*sdp.Item, error
return &item, nil
}

//go:generate docgen ../../docs-data
// +overmind:type apigateway-rest-api
// +overmind:descriptiveType REST API
// +overmind:get Get a REST API by ID
// +overmind:list List all REST APIs
// +overmind:search Search for REST APIs their name
// +overmind:group AWS
// +overmind:terraform:queryMap aws_api_gateway_rest_api.id

func NewAPIGatewayRestApiAdapter(client *apigateway.Client, accountID string, region string) *adapterhelpers.GetListAdapter[*types.RestApi, *apigateway.Client, *apigateway.Options] {
return &adapterhelpers.GetListAdapter[*types.RestApi, *apigateway.Client, *apigateway.Options]{
ItemType: "apigateway-rest-api",
Expand Down
18 changes: 1 addition & 17 deletions adapters/autoscaling-auto-scaling-group.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func autoScalingGroupOutputMapper(_ context.Context, _ *autoscaling.Client, scop
if asg.MixedInstancesPolicy.LaunchTemplate != nil {
if asg.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification != nil {
if asg.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification.LaunchTemplateId != nil {
// +overmind:link ec2-launch-template
item.LinkedItemQueries = append(item.LinkedItemQueries, &sdp.LinkedItemQuery{
Query: &sdp.Query{
Type: "ec2-launch-template",
Expand All @@ -69,7 +68,6 @@ func autoScalingGroupOutputMapper(_ context.Context, _ *autoscaling.Client, scop

for _, tgARN := range asg.TargetGroupARNs {
if a, err = adapterhelpers.ParseARN(tgARN); err == nil {
// +overmind:link elbv2-target-group
item.LinkedItemQueries = append(item.LinkedItemQueries, &sdp.LinkedItemQuery{
Query: &sdp.Query{
Type: "elbv2-target-group",
Expand All @@ -89,7 +87,6 @@ func autoScalingGroupOutputMapper(_ context.Context, _ *autoscaling.Client, scop

for _, instance := range asg.Instances {
if instance.InstanceId != nil {
// +overmind:link ec2-instance
item.LinkedItemQueries = append(item.LinkedItemQueries, &sdp.LinkedItemQuery{
Query: &sdp.Query{
Type: "ec2-instance",
Expand All @@ -110,7 +107,6 @@ func autoScalingGroupOutputMapper(_ context.Context, _ *autoscaling.Client, scop

if instance.LaunchTemplate != nil {
if instance.LaunchTemplate.LaunchTemplateId != nil {
// +overmind:link ec2-launch-template
item.LinkedItemQueries = append(item.LinkedItemQueries, &sdp.LinkedItemQuery{
Query: &sdp.Query{
Type: "ec2-launch-template",
Expand All @@ -131,7 +127,6 @@ func autoScalingGroupOutputMapper(_ context.Context, _ *autoscaling.Client, scop

if asg.ServiceLinkedRoleARN != nil {
if a, err = adapterhelpers.ParseARN(*asg.ServiceLinkedRoleARN); err == nil {
// +overmind:link iam-role
item.LinkedItemQueries = append(item.LinkedItemQueries, &sdp.LinkedItemQuery{
Query: &sdp.Query{
Type: "iam-role",
Expand All @@ -151,7 +146,6 @@ func autoScalingGroupOutputMapper(_ context.Context, _ *autoscaling.Client, scop
}

if asg.LaunchConfigurationName != nil {
// +overmind:link autoscaling-launch-configuration
item.LinkedItemQueries = append(item.LinkedItemQueries, &sdp.LinkedItemQuery{
Query: &sdp.Query{
Type: "autoscaling-launch-configuration",
Expand All @@ -169,7 +163,6 @@ func autoScalingGroupOutputMapper(_ context.Context, _ *autoscaling.Client, scop

if asg.LaunchTemplate != nil {
if asg.LaunchTemplate.LaunchTemplateId != nil {
// +overmind:link ec2-launch-template
item.LinkedItemQueries = append(item.LinkedItemQueries, &sdp.LinkedItemQuery{
Query: &sdp.Query{
Type: "ec2-launch-template",
Expand All @@ -188,7 +181,6 @@ func autoScalingGroupOutputMapper(_ context.Context, _ *autoscaling.Client, scop
}

if asg.PlacementGroup != nil {
// +overmind:link ec2-placement-group
item.LinkedItemQueries = append(item.LinkedItemQueries, &sdp.LinkedItemQuery{
Query: &sdp.Query{
Type: "ec2-placement-group",
Expand All @@ -211,16 +203,8 @@ func autoScalingGroupOutputMapper(_ context.Context, _ *autoscaling.Client, scop
return items, nil
}

// +overmind:type autoscaling-auto-scaling-group
// +overmind:descriptiveType Autoscaling Group
// +overmind:get Get an Autoscaling Group by name
// +overmind:list List Autoscaling Groups
// +overmind:search Search for Autoscaling Groups by ARN
// +overmind:group AWS
// +overmind:terraform:queryMap aws_autoscaling_group.arn
// +overmind:terraform:method SEARCH
//
//go:generate docgen ../../docs-data

func NewAutoScalingGroupAdapter(client *autoscaling.Client, accountID string, region string) *adapterhelpers.DescribeOnlyAdapter[*autoscaling.DescribeAutoScalingGroupsInput, *autoscaling.DescribeAutoScalingGroupsOutput, *autoscaling.Client, *autoscaling.Options] {
return &adapterhelpers.DescribeOnlyAdapter[*autoscaling.DescribeAutoScalingGroupsInput, *autoscaling.DescribeAutoScalingGroupsOutput, *autoscaling.Client, *autoscaling.Options]{
ItemType: "autoscaling-auto-scaling-group",
Expand Down
9 changes: 0 additions & 9 deletions adapters/cloudfront-cache-policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ func cachePolicyListFunc(ctx context.Context, client CloudFrontClient, scope str
return policies, nil
}

//go:generate docgen ../../docs-data
// +overmind:type cloudfront-cache-policy
// +overmind:descriptiveType CloudFront Cache Policy
// +overmind:get Get a CloudFront Cache Policy
// +overmind:list List CloudFront Cache Policies
// +overmind:search Search CloudFront Cache Policies by ARN
// +overmind:group AWS
// +overmind:terraform:queryMap aws_cloudfront_cache_policy.id

func NewCloudfrontCachePolicyAdapter(client CloudFrontClient, accountID string) *adapterhelpers.GetListAdapter[*types.CachePolicy, CloudFrontClient, *cloudfront.Options] {
return &adapterhelpers.GetListAdapter[*types.CachePolicy, CloudFrontClient, *cloudfront.Options]{
ItemType: "cloudfront-cache-policy",
Expand Down
9 changes: 0 additions & 9 deletions adapters/cloudfront-continuous-deployment-policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func continuousDeploymentPolicyItemMapper(_, scope string, awsItem *types.Contin

if awsItem.ContinuousDeploymentPolicyConfig != nil && awsItem.ContinuousDeploymentPolicyConfig.StagingDistributionDnsNames != nil {
for _, name := range awsItem.ContinuousDeploymentPolicyConfig.StagingDistributionDnsNames.Items {
// +overmind:link dns
item.LinkedItemQueries = append(item.LinkedItemQueries, &sdp.LinkedItemQuery{
Query: &sdp.Query{
Type: "dns",
Expand All @@ -46,14 +45,6 @@ func continuousDeploymentPolicyItemMapper(_, scope string, awsItem *types.Contin
return &item, nil
}

//go:generate docgen ../../docs-data
// +overmind:type cloudfront-continuous-deployment-policy
// +overmind:descriptiveType CloudFront Continuous Deployment Policy
// +overmind:get Get a CloudFront Continuous Deployment Policy by ID
// +overmind:list List CloudFront Continuous Deployment Policies
// +overmind:search Search CloudFront Continuous Deployment Policies by ARN
// +overmind:group AWS

// Terraform is not yet supported for this: https://github.com/hashicorp/terraform-provider-aws/issues/28920

func NewCloudfrontContinuousDeploymentPolicyAdapter(client *cloudfront.Client, accountID string) *adapterhelpers.GetListAdapter[*types.ContinuousDeploymentPolicy, *cloudfront.Client, *cloudfront.Options] {
Expand Down
Loading

0 comments on commit 6242e2a

Please sign in to comment.