Skip to content

Conversation

tejasgn1
Copy link
Contributor

@tejasgn1 tejasgn1 commented Oct 9, 2025

The changes in this PR were generated using CodeLoom-4-BedRock(CL4B) for Inspector service in Python language

@tejasgn1 tejasgn1 requested a review from rlhagerm October 9, 2025 22:52
@github-actions github-actions bot added the Python This issue relates to the AWS SDK for Python (boto3) label Oct 9, 2025
@tejasgn1 tejasgn1 self-assigned this Oct 9, 2025
# snippet-start:[inspector.yaml]
# Inspector code examples for the AWS SDK for Python (Boto3).
inspector_Hello:
title: Hello &Inspector;
Copy link
Contributor

Choose a reason for hiding this comment

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

We may have to add something to get the entities correct. For example, Inspector is INS1long.

title: Get &Inspector; account status
title_abbrev: Get account status
synopsis: get the status of &Inspector; for your account.
category: Basics
Copy link
Contributor

Choose a reason for hiding this comment

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

It's setting the category of all of these to Basics, I'm not sure that is necessary.

excerpts:
- description: Run an interactive scenario demonstrating &Inspector; features.
snippet_tags:
- python.example_code.inspector.InspectorScenario
Copy link
Contributor

Choose a reason for hiding this comment

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

Usually we show the wrapper here as well.

title: Learn the basics of &Inspector;
title_abbrev: Learn the basics
synopsis: learn the basics of &Inspector;.
category: Scenarios
Copy link
Contributor

Choose a reason for hiding this comment

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

This section should have a synopsis list.

from test_tools.glacier_stubber import GlacierStubber
from test_tools.glue_stubber import GlueStubber
from test_tools.iam_stubber import IamStubber
from test_tools.inspector_stubber import InspectorStubber
Copy link
Contributor

Choose a reason for hiding this comment

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

It's missing the line that adds the stubber below, which is causing the stubbed tests to fail with this error: test_tools.stubber_factory.StubberFactoryNotImplemented: If you see this exception, it probably means that you forg...

for finding in findings_list[
:2
]: # Show first 2 findings per severity
title = finding.get("title", "No title")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm unable to verify if any of these print statements work without simulating a severity finding.

"vulnerablePackages", []
)
if vulnerable_packages:
package = vulnerable_packages[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

If we aren't able to verify this with a finding, we probably shouldn't include it.



@pytest.mark.integ
def test_get_account_status_integration():
Copy link
Contributor

Choose a reason for hiding this comment

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

We would prefer to have a single integration test that runs the entire scenario and verifies that it makes it to the end successfully. When I ran these tests, it left my account with Inspector enabled instead of returning it to the disabled state.



@pytest.mark.parametrize(
"error_code", [None, "ValidationException", "AccessDeniedException"]
Copy link
Contributor

Choose a reason for hiding this comment

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

I was unable to run these tests without the stubber properly initialized.

print(f"CWE IDs: {', '.join(cwes)}")

# Show EPSS score
epss_score = details.get("epssScore")
Copy link
Contributor

Choose a reason for hiding this comment

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

We may need more parameter validation. For example, this property is an array, but the code is referencing and displaying it like a string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Python This issue relates to the AWS SDK for Python (boto3)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants