Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove tfgen warning on unexpected snippets #1837

Merged
merged 3 commits into from
Apr 4, 2024

Conversation

t0yv0
Copy link
Member

@t0yv0 t0yv0 commented Apr 3, 2024

Analyzing 64 instances of this warning in pulumi-aws finding that these actually render appropriate in the Registry and
no action needs to be taken.

One example where we might need to take action is making the language chooser work, such as for the EMR Cluster resource.
pulumi/docs#11470

Spot-checking the other resources, they seem to render fine. The sections are not always called Examples, but sometimes
are called Usage etc.



   1 warning: Unexpected code snippets in section 'Argument Reference' for data source 'aws_dx_router_configuration'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for data source 'aws_ebs_volumes'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for data source 'aws_licensemanager_grants'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for data source 'aws_licensemanager_received_licenses'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for data source 'aws_subnets'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   2 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_appautoscaling_policy'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_appflow_flow'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_autoscaling_policy'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_cloudfront_distribution'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_cognito_user_pool'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_db_instance'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_ec2_fleet'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_emr_cluster'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_emr_instance_group'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_internet_gateway'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_kinesis_firehose_delivery_stream'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_neptune_cluster'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_networkmanager_core_network'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   4 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_rds_cluster'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_s3_bucket_legacy'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   7 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_s3_bucket_replication_configuration'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_servicecatalog_constraint'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Argument Reference' for resource 'aws_transfer_user'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Basic Usage with an AWS Customer Managed Key' for resource 'aws_ssmincidents_replication_set'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'CloudWatch Logging and Permissions' for resource 'aws_lambda_function'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Dead-letter queue' for resource 'aws_sqs_queue'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   2 warning: Unexpected code snippets in section 'Default Behavior and `IAMAllowedPrincipals`' for resource 'aws_lakeformation_permissions'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Encrypting the automated backup with KMS' for resource 'aws_db_instance_automated_backups_replication'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Example IPv6 Usage' for resource 'aws_route'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Example Update add-on usage with resolve_conflicts_on_update and PRESERVE' for resource 'aws_eks_addon'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   2 warning: Unexpected code snippets in section 'Example add-on usage with custom configuration_values' for resource 'aws_eks_addon'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Example all optional arguments' for resource 'aws_cloudwatch_event_archive'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Example in Conjunction with Scaling Policies' for resource 'aws_cloudwatch_metric_alarm'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Example including a RDS DB instance' for resource 'aws_db_instance_automated_backups_replication'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Example of monitoring Healthy Hosts on NLB using Target Group and NLB' for resource 'aws_cloudwatch_metric_alarm'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Example with Delivery Policy' for resource 'aws_sns_topic'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Example with First-In-First-Out (FIFO)' for resource 'aws_sns_topic'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Example with Server-side encryption (SSE)' for resource 'aws_sns_topic'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Example with an Expression' for resource 'aws_cloudwatch_metric_alarm'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'FIFO queue' for resource 'aws_sqs_queue'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'High-throughput FIFO queue' for resource 'aws_sqs_queue'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Lambda integration' for resource 'aws_api_gateway_integration'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Lustre Example' for resource 'aws_fsx_backup'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Multiple Region Usage' for resource 'aws_ecr_replication_configuration'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'ONTAP Example' for resource 'aws_fsx_backup'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'OpenZFS Example' for resource 'aws_fsx_backup'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Option Settings' for resource 'aws_elastic_beanstalk_environment'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Policy with a Custom Action for Stateless Inspection' for resource 'aws_networkfirewall_firewall_policy'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Policy with a HOME_NET Override' for resource 'aws_networkfirewall_firewall_policy'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Repository Filter Usage' for resource 'aws_ecr_replication_configuration'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Required Services Example' for resource 'aws_storagegateway_file_system_association'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Search by filters' for data source 'aws_ram_resource_share'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Server-side encryption (SSE)' for resource 'aws_sqs_queue'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Usage with Cognito User Pool Authorizer' for resource 'aws_api_gateway_method'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Usage with Logging Configuration to S3 Bucket' for resource 'aws_ivschat_room'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   2 warning: Unexpected code snippets in section 'Using With CloudFront' for resource 'aws_cloudfront_origin_access_identity'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Using with AutoScaling Groups' for resource 'aws_launch_configuration'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Using with Spot Instances' for resource 'aws_launch_configuration'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'VPC Link' for resource 'aws_api_gateway_integration'. The HCL code will be converted if possible, but may not display correctly in the generated docs.
   1 warning: Unexpected code snippets in section 'Windows Example' for resource 'aws_fsx_backup'. The HCL code will be converted if possible, but may not display correctly in the generated docs.

Analyzing 64 instances of this warning in pulumi-aws finding that these actually render appropriate in the Registry and
no action needs to be taken.
Copy link

codecov bot commented Apr 3, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 60.33%. Comparing base (22d644c) to head (27e84c7).
Report is 4 commits behind head on master.

Files Patch % Lines
pkg/tfgen/docs.go 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    pulumi/pulumi-hugo#1837      +/-   ##
==========================================
- Coverage   60.72%   60.33%   -0.40%     
==========================================
  Files         303      310       +7     
  Lines       42401    42712     +311     
==========================================
+ Hits        25750    25772      +22     
- Misses      15177    15468     +291     
+ Partials     1474     1472       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@iwahbe iwahbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warnings are unaddressable and should render correctly, so I'm happy to remove them.

@@ -749,16 +749,11 @@ func (p *tfMarkdownParser) parseSection(h2Section []string) error {
}

// Remove the "Open in Cloud Shell" button if any and check for the presence of code snippets.
reformattedH3Section, hasExamples, isEmpty := p.reformatSubsection(h3Section)
reformattedH3Section, _, isEmpty := p.reformatSubsection(h3Section)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*tfMarkdownParser.reformatSubsection is only called here, which means its second argument is never read. Can we adjust the signature of *tfMarkdownParser.reformatSubsection instead of ignoring the second return value?

Suggested change
reformattedH3Section, _, isEmpty := p.reformatSubsection(h3Section)
reformattedH3Section, isEmpty := p.reformatSubsection(h3Section)

@t0yv0 t0yv0 enabled auto-merge April 4, 2024 13:13
@t0yv0 t0yv0 merged commit 73ecfbf into master Apr 4, 2024
10 checks passed
@t0yv0 t0yv0 deleted the t0yv0/remove-unexpected-examples-in-section-warning branch April 4, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants