Repository navigation
Conversation
There was a problem hiding this comment.
🤖 AI Code Example Review
This PR is a well-structured, complete implementation of the SESv2 Search and Filter scenario. It satisfies all specification requirements, includes unit and integration tests with proper stubbing infrastructure, handles errors correctly, and follows the repo's established patterns. A few minor nits and one policy observation are noted below.
Detailed Review
-
[policy] No unit tests cover the scenario orchestration class (
SearchFilterBasicsScenario.run_scenario) directly with stubs — only the wrapper methods and an end-to-end integration test are present. Comparable scenarios (e.g., ControlTower) include atest_scenario_run.pythat exercises the full orchestration path with mocked wrappers. This is not a blocking defect but should be tracked as a gap. -
[nit]
scenario_sesv2_search_filter_basics.pyuses hardcoded resource names (marketing-campaign-set,marketing@example.com, etc.) that are unlikely to be unique if the scenario is run in an account that already has similarly named resources. The integration test correctly uses UUID suffixes; the runnable scenario could benefit from the same approach, or at minimum a comment explaining the expected naming convention. -
[nit] In
sesv2_wrapper.py, the type annotationboto3.clienton the__init__parameter is not a valid type —boto3.clientis a factory function, not a type. The correct annotation isbotocore.client.BaseClientor a string literal'botocore.client.SESv2'. This mirrors a pre-existing pattern in the repo, so it is a nit rather than a blocking issue. -
[nit]
scenario_sesv2_search_filter_basics.pyimportsClientErrorfrombotocore.exceptionsbut never raises or re-raises it directly — it is only used inside_setup_email_identitiesand_setup_tenantsas an exception to catch. The import is correct and used, so this is just a note that the module-level exception handler inmain()usesExceptionwhich is broader than necessary. -
[nit] The
conftest.pyuses a relativesys.path.append("../../../..")which is fragile and depends on the working directory at pytest invocation time. The comparablecontroltowerexample usesos.path.abspathto compute paths robustly. Thesys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))line is fine; thesys.path.append("../../../..")line is the fragile one. -
[nit] The
_cleanupmethod inSearchFilterBasicsScenariodoes not swallowClientErroron individual resource deletions. If a single delete fails (e.g., resource was already deleted or never created due to an earlier error), thefinallyblock will raise before cleaning up remaining resources. The wrapper'sdelete_*methods already swallowNotFoundException, but other errors (e.g., throttling) will propagate and abort cleanup mid-loop. Wrapping each deletion in a try/except inside_cleanup— as done in the integration test's fixture teardown — would make cleanup more robust. -
[nit]
requirements.txtbumps the minimumboto3/botocoreversion to1.43.105for new APIs (CreateTenant,ListTenants,DeleteTenant). The inline comment explaining why this bump is needed would help reviewers and future maintainers understand the constraint. -
[nit]
sesv2_metadata.yamlentries forsesv2_CreateConfigurationSet,sesv2_CreateTenant,sesv2_DeleteConfigurationSet, andsesv2_DeleteTenanthave emptydescription:fields. Other comparable entries in the file provide brief descriptions; these should be filled in for consistency. -
[nit] The
test_scenario_complete_integrationfunction patchesscenario_sesv2_search_filter_basics.time.sleepto avoid the 15-second wait. The patch target is correct and the scenario'sfinallyblock ensures cleanup, but the test does not assert anything beyond 'no exception raised'. A minimal assertion (e.g., that the scenario printed the completion banner) would make the test more meaningful, though the current approach is acceptable. -
[nit]
sesv2_stubber.pyimportsfrom boto3 import clientat the top level but only uses it as a type annotation. The idiomatic pattern in the repo's other stubbers (e.g.,ses_stubber.py) importsboto3directly and annotates withboto3.client. Either approach is fine, but consistency with the existing stubbers is preferred.
Reviewed at commit ad9f3ef7ebbf3d8602d05c84590baf28596dae69. This review was generated automatically using Amazon Bedrock. It compares your changes against existing examples and coding guidelines. Findings are labeled by severity (blocking / nit / policy) and reflect only the commit above. Please use your judgment — this is advisory, not authoritative.
- Use filter values that return a subset, and page through results with a wrapper method - Replace the fixed 15s sleep with a check of the filtered list calls - Track created resources during setup and don't delete configuration sets that already existed - Attempt every cleanup delete and report any that fail - Remove duplicate CreateEmailIdentity and DeleteEmailIdentity snippet tags - Build the test_tools path in conftest.py from __file__ - Add stubbed unit tests for the scenario Changes made with AI tools and reviewed by Cainan Enneking.
There was a problem hiding this comment.
🤖 AI Code Example Review
This PR is in excellent shape. All prior blocking and nit items from the previous review have been addressed: _cleanup now wraps each deletion in its own try/except (prior inline comment resolved), the scenario orchestration is fully tested via test_sesv2_search_filter_scenario.py (prior policy item resolved), and conftest.py uses os.path.join(os.path.dirname(__file__), ...) consistently (prior nit resolved). The remaining minor items from the previous review that are still technically present are noted below, but none are new or blocking.
Detailed Review
-
[nit]
sesv2_metadata.yaml— thesesv2_CreateConfigurationSet,sesv2_CreateTenant,sesv2_DeleteConfigurationSet, andsesv2_DeleteTenantentries still have no top-leveltitle:,title_abbrev:, ordescription:fields (onlylanguages:andservices:are present). Other action-level entries in the file typically include at least a brief description. This was flagged in the previous review and remains unchanged. -
[nit]
python/test_tools/sesv2_stubber.pyline 9 —from boto3 import clientis imported but used only as a type annotation on the__init__parameter (sesv2_client: client).boto3.clientis a factory function, not a type; the idiomatic annotation used elsewhere in the repo isboto3.client(as a string reference) orbotocore.client.BaseClient. This was noted in the prior review and remains. It is purely cosmetic and does not affect runtime behavior. -
[nit]
scenario_sesv2_search_filter_basics.py— the module-level hardcoded resource names (marketing-campaign-set,marketing@example.com,customer-alpha, etc.) are not unique across concurrent runs or accounts that already have these resources. The integration test correctly uses UUID suffixes; a comment in the scenario explaining why these fixed names are intentional (or using a UUID suffix here too) would improve robustness. This was flagged previously and is still present. -
[nit]
requirements.txtbumpsboto3/botocoreto>=1.43.105. A short inline comment explaining why this minimum version is required (newCreateTenant,ListTenants,DeleteTenantAPIs) would help future maintainers. This was noted before and is still absent. -
[policy] The previous review noted the absence of a
test_scenario_run.py-style test that exercises the fullrun_scenario()orchestration path with mocked wrappers (as seen in the ControlTower comparable). This has now been addressed bytest_sesv2_search_filter_scenario.py, which includestest_run_scenariocovering the complete orchestration. This item is resolved. -
[nit]
test_sesv2_search_filter_integ.py—test_scenario_complete_integrationpatchestime.sleepto avoid the wait but asserts nothing beyond "no exception raised". A minimal assertion (e.g., checking the printed output contains the completion banner) would make the test more meaningful. This was noted previously and is still present, though the current approach is acceptable. -
[nit] The overall code quality is high: clear step-by-step comments, consistent pagination patterns across all three list methods, robust cleanup that continues on individual failures, and well-structured stubber methods. The scenario, wrapper, unit tests, integration tests, stubber, and metadata are all present and consistent.
Reviewed at commit f1f5b598aeed385c28647efa78ba4a941f0fcbc3. This review was generated automatically using Amazon Bedrock. It compares your changes against existing examples and coding guidelines. Findings are labeled by severity (blocking / nit / policy) and reflect only the commit above. Please use your judgment — this is advisory, not authoritative.
There was a problem hiding this comment.
🤖 AI Code Example Review
This PR is in excellent shape. All previously raised items have been addressed in prior commits, and the current commit introduces no new defects. The code is well-structured, complete, and follows established repo patterns.
Detailed Review
-
[nit] Prior item (type annotation
boto3.clienton__init__parameter insesv2_wrapper.py, line 28) — still present in the current code.boto3.clientis a factory function, not a valid type annotation. The correct annotation would bebotocore.client.BaseClientor simply omitting it. This is a cosmetic nit consistent with a pre-existing pattern in the repo. -
[nit] Prior item (hardcoded resource names in
scenario_sesv2_search_filter_basics.py) — still present. Names likemarketing-campaign-setandmarketing@example.comcould collide with existing resources. A comment near the constants explaining the expected naming convention, or a note that this is intentional for the scenario, would help. The integration test correctly uses UUID suffixes, so this inconsistency remains a minor nit. -
[nit] Prior item (
sesv2_metadata.yamlentries forsesv2_CreateConfigurationSet,sesv2_CreateTenant,sesv2_DeleteConfigurationSet, andsesv2_DeleteTenanthave nodescription:field at the top level) — still present in the current diff. Other comparable entries include brief top-leveldescription:fields. This is cosmetic. -
[nit] The
conftest.pyusessys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", "..", ".."))withos.path.join(which is robust), unlike the prior concern aboutsys.path.append("../../../..")that was noted in an earlier review round. The path construction is now safe — this item is addressed. -
[nit] The
test_scenario_complete_integrationintegration test asserts only thatrun_scenario()does not raise. Adding even a minimal assertion (e.g., checking that the scenario printed the completion banner) would make the test more meaningful. This was noted in the prior review and remains a minor nit. -
[policy] The
sesv2_SearchFilterBasicsmetadata entry'ssynopsis_listuses plain text bullets rather than the&SESv2;entity reference style used elsewhere in the YAML file (e.g., compare withsesv2_Scenario_EmailAttachments). This is a documentation consistency policy note, not a code defect. -
[nit]
sesv2_wrapper.py'slist_configuration_sets,list_email_identities, andlist_tenantsall uselist()anddict()constructors instead of the more idiomatic[]and{}literals. This is a minor style inconsistency with common Python idioms, though it has no functional impact. -
[nit] The
requirements.txtbump toboto3>=1.43.105andbotocore>=1.43.105lacks an inline comment explaining why this specific version is required (i.e., that it adds theFilterparameter to the SES v2 list operations). The scenario README mentions this, but a one-line comment inrequirements.txtwould help future maintainers. -
Overall, the implementation is comprehensive: all prior blocking issues are resolved, cleanup is robust (each deletion is independently try/except wrapped), tests cover the scenario orchestration, wrapper methods, pagination, wait logic, and both unit and integration paths. The code is clean, well-commented, and closely follows repo patterns.
Reviewed at commit 15525d17d37a8ad06ff650b5aeb1210b49562264. This review was generated automatically using Amazon Bedrock. It compares your changes against existing examples and coding guidelines. Findings are labeled by severity (blocking / nit / policy) and reflect only the commit above. Please use your judgment — this is advisory, not authoritative.
This pull request adds the SESv2 Search and Filter example scenario.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.