Skip to content
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

fix: Handle global value for Function CodeUri in Package #1766

Merged
merged 8 commits into from
Jan 31, 2020

Conversation

awood45
Copy link
Member

@awood45 awood45 commented Jan 31, 2020

Issue #, if available: #1706

Why is this change necessary?

The sam package command does not read any global values over the course of packaging - traditionally, only build and deploy functionality would use any values. Issue #1706 points to an uncommon use case that exposes that some global values do need to be considered, at minimum so that package won't break deploy.

How does it address the issue?

Creates an apply_global_values method that fetches global values we use (currently just the one) and applies them if/when they are applicable.

What side effects does this change have?

None

Checklist:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@awood45 awood45 requested a review from sanathkr January 31, 2020 00:10
samcli/lib/package/artifact_exporter.py Show resolved Hide resolved
samcli/lib/package/artifact_exporter.py Outdated Show resolved Hide resolved
samcli/lib/package/artifact_exporter.py Outdated Show resolved Hide resolved
resource_type = resource.get("Type", None)
resource_dict = resource.get("Properties", None)

if "CodeUri" not in resource and resource_type == AWS_SERVERLESS_FUNCTION:
Copy link
Contributor

Choose a reason for hiding this comment

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

The bug doesn't state, but DefinitionUri of Globals->Api also needs same treatment

Copy link
Member Author

Choose a reason for hiding this comment

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

Will check this with the Layers issue as well.

@jfuss
Copy link
Contributor

jfuss commented Jan 31, 2020

Does Globals also support Layers? If so, that also will need to be added.

@awood45
Copy link
Member Author

awood45 commented Jan 31, 2020

I believe that Globals would indeed support layers. I'll look in to that.

@awood45
Copy link
Member Author

awood45 commented Jan 31, 2020

Sounds like Globals do not yet support Layers, so no-op there.

This would actually be a gate for all possible global checks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants