-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: add --output json flag (sam build) #9136
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -807,19 +807,23 @@ def _build_function( # pylint: disable=R1710 | |
| specified_workflow=specified_workflow if supported_specified_workflow else None, | ||
| ) | ||
|
|
||
| return self._build_function_in_process( | ||
| config, | ||
| code_dir, | ||
| artifact_dir, | ||
| scratch_dir, | ||
| manifest_path, | ||
| runtime, | ||
| architecture, | ||
| options, | ||
| dependencies_dir, | ||
| download_dependencies, | ||
| self._combine_dependencies, | ||
| ) | ||
| try: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [BUG] The new Consequence: for try:
if self._container_manager:
return self._build_function_on_container(...)
return self._build_function_in_process(...)
except BuildError as ex:
ex.resource_name = function_name
raiseLayer builds ( |
||
| return self._build_function_in_process( | ||
| config, | ||
| code_dir, | ||
| artifact_dir, | ||
| scratch_dir, | ||
| manifest_path, | ||
| runtime, | ||
| architecture, | ||
| options, | ||
| dependencies_dir, | ||
| download_dependencies, | ||
| self._combine_dependencies, | ||
| ) | ||
| except BuildError as ex: | ||
| ex.resource_name = function_name | ||
| raise | ||
|
|
||
| # pylint: disable=fixme | ||
| # FIXME: we need to throw an exception here, packagetype could be something else | ||
|
|
||
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.
[BUG] The JSON success payload's
resourceslist is built only fromself.get_resources_to_build().functions, dropping layers.ResourcesToBuildCollectorexposes bothfunctionsandlayers(seesamcli/lib/providers/provider.py:229), andsam buildbuilds both. A template that contains onlyAWS::Serverless::LayerVersionresources — or a mixed template — will produce a JSON success payload with an incomplete (or empty)resourcesarray, which is misleading to any downstream tooling that iterates the list.Include layers, e.g.:
Also note that
f.full_pathis not strictly a CloudFormation logical id for nested-stack resources (it usesParentStack/ChildLogicalIdnotation); consumers reading the field namedlogical_idmay not expect the slash-separated form shown byfull_path. Either rename the field toresource_id/path, or emit the raw logical id.