Closed michaelbrewer closed 2 years ago
I have a pull request that partially fixes this (as there is a lot of examples to migrate). So once there is feedback on this I can continue.
@heitorlessa @sthulb - as part of the original papercuts, we had discuss how many errors we have fund in the code examples, and that extracting them into separate files would allow us to add formatting (isort
, black
), check for syntax error (py_compile
) and perform linting (cfn-lint
etc..).
So in a series of pull requests, i have extracted and fixes all of the code examples (python, terraform and sam templates) and fixed (over 25 errors so far). Some of these pull requests has quite a few errors and some just have smaller formatting inconsistencies.
The pull requests associated with this issue will be resolved eventually. There’s a lot of them and they’re quite large too.
Yep and covers 25 error in the docs too
Updated preview of fixed docs is hosted here: https://gyft.github.io/aws-lambda-powertools-python/latest/
Up to version 1.25.10
@sthulb i have adding all of the missing bug reports for syntax errors identified from this task.
Updated preview of fixed docs is hosted here: gyft.github.io/aws-lambda-powertools-python/latest
Up to version 1.26.1
Comments on closed issues are hard for our team to see.
Is your feature request related to a problem? Please describe.
1067
1069
1207
1211
1212
1213
1214
1215
1216
1217
1223
Additional context
for a summaryDescribe the solution you'd like
In the past there was many documentation errors found like #1004 , on a regular basis i would try to help the community by verifying the code examples, that they can compile, linted, valid formatting and had the correct line highlights
As part of general papercuts #857 and then later #1009 it was decided to split up the examples into separate files so that they can be linted or validates.
Currently the AWS Lambda Documentation has many typos, syntax errors, missing imports, invalid yaml indentation and terraform errors (about 25 errors currently and we keeping on running into this errors each time code examples are updated or added (see #1004). Here is a list of some of them as separate issues:
Hosted version of this is at: https://gyft.github.io/aws-lambda-powertools-python/latest/
Describe alternatives you've considered
Keeping the examples inside the markdown docs. But we run into issues like below, where errors are not easily picked up
Additional context
As a side effect many existing errors will be resolved AND measures put in to prevent them from happening again. Here is a list of errors currently in the documentation
Lambda Layer - Terraform
exampleSAR - CDK
examplesExample: Least-privileged IAM permissions to deploy Layer
exampleCloning Logger config to all other registered standard loggers
which results in a errorAttributeError: module 'logging' has no attribute 'logger'
on line 8template.yml
indentsAssert multiple EMF blobs with pytest
exampleCreating a S3 Provider to fetch parameters
exampleAccessing processed messages via context manager
example removing unused imports and fix line highlights.Extending failure handling mechanism in BatchProcessor
examplesuccess_handler
Batch - Creating a custom batch processor exampleCustomizing boto configuration
examplevalidator_function.py
example, see Validation - Validate functionEventBridge Envelope
exampleAWS Serverless Application Model (SAM) example
Exception not affecting idempotency record sample
exampleReusing a DynamoDB table that uses a composite primary key
exampleUsing Idempotency with JSONSchema Validation utility
exampleDeserializing JSON before using as idempotency key
example in JMESPath Functions - page - Missing importcustom_jmespath_function.py
example in JMESPath Functions - page - Invalid python syntaxList of open pull requests
Originally part of a simple PR #1065 but now split up into smaller ones
1113
1137
1126
1121
1122
1117
1116
1123
1124
1114
1127
1128
1115
1125
1119
1118
1120