-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
tests: Remove numeric constants #39840
Merged
Merged
+26,729
−26,645
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Community NoteVoting for Prioritization
For Submitters
|
github-actions
bot
added
documentation
Introduces or discusses updates to documentation.
tests
PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
service/lambda
Issues and PRs that pertain to the lambda service.
service/iam
Issues and PRs that pertain to the iam service.
service/ec2
Issues and PRs that pertain to the ec2 service.
service/ecs
Issues and PRs that pertain to the ecs service.
service/emr
Issues and PRs that pertain to the emr service.
service/configservice
Issues and PRs that pertain to the configservice service.
service/elbv2
Issues and PRs that pertain to the elbv2 service.
service/apigateway
Issues and PRs that pertain to the apigateway service.
service/codebuild
Issues and PRs that pertain to the codebuild service.
service/gamelift
Issues and PRs that pertain to the gamelift service.
service/cloudtrail
Issues and PRs that pertain to the cloudtrail service.
service/lightsail
Issues and PRs that pertain to the lightsail service.
service/elb
Issues and PRs that pertain to the elb service.
service/cloudfront
Issues and PRs that pertain to the cloudfront service.
service/inspector
Issues and PRs that pertain to the inspector service.
service/elasticbeanstalk
Issues and PRs that pertain to the elasticbeanstalk service.
service/athena
Issues and PRs that pertain to the athena service.
service/firehose
Issues and PRs that pertain to the firehose service.
service/autoscaling
Issues and PRs that pertain to the autoscaling service.
service/dynamodb
Issues and PRs that pertain to the dynamodb service.
service/cloudwatch
Issues and PRs that pertain to the cloudwatch service.
service/cloudsearch
Issues and PRs that pertain to the cloudsearch service.
service/efs
Issues and PRs that pertain to the efs service.
service/budgets
Issues and PRs that pertain to the budgets service.
service/appsync
Issues and PRs that pertain to the appsync service.
service/elasticache
Issues and PRs that pertain to the elasticache service.
labels
Oct 22, 2024
YakDriver
force-pushed
the
td-numeric-constants-fixes
branch
from
October 24, 2024 19:40
b8969bc
to
8215189
Compare
ewbankkit
approved these changes
Oct 24, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bless you! 🙏 @ewbankkit |
See #39881 for fixes for open PRs related to this change. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
documentation
Introduces or discusses updates to documentation.
generators
Relates to code generators.
linter
Pertains to changes to or issues with the various linters.
service/accessanalyzer
Issues and PRs that pertain to the accessanalyzer service.
service/acmpca
Issues and PRs that pertain to the acmpca service.
service/amplify
Issues and PRs that pertain to the amplify service.
service/apigateway
Issues and PRs that pertain to the apigateway service.
service/apigatewayv2
Issues and PRs that pertain to the apigatewayv2 service.
service/appautoscaling
Issues and PRs that pertain to the appautoscaling service.
service/appconfig
Issues and PRs that pertain to the appconfig service.
service/appmesh
Issues and PRs that pertain to the appmesh service.
service/apprunner
Issues and PRs that pertain to the apprunner service.
service/appstream
Issues and PRs that pertain to the appstream service.
service/appsync
Issues and PRs that pertain to the appsync service.
service/athena
Issues and PRs that pertain to the athena service.
service/auditmanager
Issues and PRs that pertain to the auditmanager service.
service/autoscaling
Issues and PRs that pertain to the autoscaling service.
service/autoscalingplans
Issues and PRs that pertain to the autoscalingplans service.
service/backup
Issues and PRs that pertain to the backup service.
service/batch
Issues and PRs that pertain to the batch service.
service/bedrockagent
Issues and PRs that pertain to the bedrockagent service.
service/budgets
Issues and PRs that pertain to the budgets service.
service/chatbot
Issues and PRs that pertain to the chatbot service.
service/chime
Issues and PRs that pertain to the chime service.
service/chimesdkmediapipelines
Issues and PRs that pertain to the chimesdkmediapipelines service.
service/cleanrooms
Issues and PRs that pertain to the cleanrooms service.
service/cloud9
Issues and PRs that pertain to the cloud9 service.
service/cloudformation
Issues and PRs that pertain to the cloudformation service.
service/cloudfront
Issues and PRs that pertain to the cloudfront service.
service/cloudsearch
Issues and PRs that pertain to the cloudsearch service.
service/cloudtrail
Issues and PRs that pertain to the cloudtrail service.
service/cloudwatch
Issues and PRs that pertain to the cloudwatch service.
service/codebuild
Issues and PRs that pertain to the codebuild service.
service/codecatalyst
Issues and PRs that pertain to the codecatalyst service.
service/codepipeline
Issues and PRs that pertain to the codepipeline service.
service/cognitoidentity
Issues and PRs that pertain to the cognitoidentity service.
service/cognitoidp
Issues and PRs that pertain to the cognitoidp service.
service/configservice
Issues and PRs that pertain to the configservice service.
service/connect
Issues and PRs that pertain to the connect service.
service/controltower
Issues and PRs that pertain to the controltower service.
service/customerprofiles
Issues and PRs that pertain to the customerprofiles service.
service/datasync
Issues and PRs that pertain to the datasync service.
service/datazone
Issues and PRs that pertain to the datazone service.
service/deploy
Issues and PRs that pertain to the deploy service.
service/devicefarm
Issues and PRs that pertain to the devicefarm service.
service/dlm
Issues and PRs that pertain to the dlm service.
service/dms
Issues and PRs that pertain to the dms service.
service/docdb
Issues and PRs that pertain to the docdb service.
service/drs
Issues and PRs that pertain to the drs service.
service/ds
Issues and PRs that pertain to the ds service.
service/dynamodb
Issues and PRs that pertain to the dynamodb service.
service/ec2ebs
Issues and PRs that pertain to the ec2ebs service.
service/ec2
Issues and PRs that pertain to the ec2 service.
service/ecr
Issues and PRs that pertain to the ecr service.
service/ecs
Issues and PRs that pertain to the ecs service.
service/efs
Issues and PRs that pertain to the efs service.
service/eks
Issues and PRs that pertain to the eks service.
service/elasticache
Issues and PRs that pertain to the elasticache service.
service/elasticbeanstalk
Issues and PRs that pertain to the elasticbeanstalk service.
service/elasticsearch
Issues and PRs that pertain to the elasticsearch service.
service/elastictranscoder
Issues and PRs that pertain to the elastictranscoder service.
service/elb
Issues and PRs that pertain to the elb service.
service/elbv2
Issues and PRs that pertain to the elbv2 service.
service/emr
Issues and PRs that pertain to the emr service.
service/emrserverless
Issues and PRs that pertain to the emrserverless service.
service/events
Issues and PRs that pertain to the events service.
service/evidently
Issues and PRs that pertain to the evidently service.
service/finspace
Issues and PRs that pertain to the finspace service.
service/firehose
Issues and PRs that pertain to the firehose service.
service/fis
Issues and PRs that pertain to the fis service.
service/fsx
Issues and PRs that pertain to the fsx service.
service/gamelift
Issues and PRs that pertain to the gamelift service.
service/globalaccelerator
Issues and PRs that pertain to the globalaccelerator service.
service/glue
Issues and PRs that pertain to the glue service.
service/grafana
Issues and PRs that pertain to the grafana service.
service/iam
Issues and PRs that pertain to the iam service.
service/imagebuilder
Issues and PRs that pertain to the imagebuilder service.
service/inspector
Issues and PRs that pertain to the inspector service.
service/inspector2
Issues and PRs that pertain to the inspector2 service.
service/internetmonitor
Issues and PRs that pertain to the internetmonitor service.
service/iot
Issues and PRs that pertain to the iot service.
service/ipam
Issues and PRs that pertain to the ipam service.
service/ivs
Issues and PRs that pertain to the ivs service.
service/ivschat
Issues and PRs that pertain to the ivschat service.
service/kafka
Issues and PRs that pertain to the kafka service.
service/kafkaconnect
Issues and PRs that pertain to the kafkaconnect service.
service/kendra
Issues and PRs that pertain to the kendra service.
service/keyspaces
Issues and PRs that pertain to the keyspaces service.
service/kinesis
Issues and PRs that pertain to the kinesis service.
service/kinesisanalytics
Issues and PRs that pertain to the kinesisanalytics service.
service/kinesisanalyticsv2
Issues and PRs that pertain to the kinesisanalyticsv2 service.
service/kms
Issues and PRs that pertain to the kms service.
service/lakeformation
Issues and PRs that pertain to the lakeformation service.
service/lambda
Issues and PRs that pertain to the lambda service.
service/lexmodels
Issues and PRs that pertain to the lexmodels service.
service/lexv2models
Issues and PRs that pertain to the lexv2models service.
service/licensemanager
Issues and PRs that pertain to the licensemanager service.
service/lightsail
Issues and PRs that pertain to the lightsail service.
tests
PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
verify
Pertains to the verify package (i.e., provider-level validating, diff suppression, etc.)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
tl;dr
acctest.Ct1
).acctest.Ct12Digit = "123456789012"
for test AWS account numbers.make fix-constants
).gofmt
andgoimports
on generated Go code.WriteTemplate()
toBufferTemplate()
to clarify memory vs. disk writing.Key Changes:
Constants for numeric string literals in tests did not provide the benefits hoped and made the code more difficult to read. They are being removed, with a constant
12345678901
being added.Example:
Previously, we relied on
go/format.Source
to format Go code we generate. However,go/format
package includes this warning:The pull request also improves the functionality of Go generators by expanding the formatting steps applied after code generation. Now, after the full composition of the generated Go files, both gofmt and goimports are automatically executed. These tools ensure:
This provides several benefits:
Example:
Refactoring of Generator Functions: Clarification of Roles
A key refactor has been made to clarify the distinction between buffering data during the generation process and writing data to the final destination (such as files). The following changes have been introduced:
WriteBytes()
,WriteTemplate()
, andWriteTemplateSet()
have been renamed to:BufferBytes()
BufferTemplate()
BufferTemplateSet()
These new function names better reflect their actual purpose: they buffer the generated content rather than directly writing it to a file. This change enhances code clarity by reducing potential confusion between buffering and writing operations, which are distinctly different phases in the generation process.
Write()
: TheWrite()
function remains unchanged, as it correctly describes its role of finalizing the process by actually writing the buffered data to the intended output destination (typically a file).Example:
Benefits:
Relations
Closes #0000
References
Output from Acceptance Testing