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 lambda ASF API updates #6411

Merged
merged 3 commits into from Jul 7, 2022
Merged

fix lambda ASF API updates #6411

merged 3 commits into from Jul 7, 2022

Conversation

alexrashed
Copy link
Member

@alexrashed alexrashed commented Jul 7, 2022

Since lambda is a keyword, it cannot easily be used in imports. This is why the lambda service module is called awslambda instead of lambda (as the real service name is).
But the scaffold's upgrade function only detects services which are named the same way as the service (with some escaping logic). This is why the generated services cannot just be renamed.

This PR fixes the scaffold to fix the automatic ASF API updates for lambda by:

  • Adding a keyword escaping logic for service names in the scaffold.
  • Renaming the ASF API package from awslambda to lambda_ (which is the escaped service name).
  • Re-generating the API with the latest version of botocore.

I have verified that there are no other generated APIs which have a different name than the service.
Here's the bash snippet I created to verify that:

 find . -type d | grep -v __pycache__"" | grep -v -e "\.\$" | cut -c 3- | tr _ - | sed 's/-$//' \
   | xargs -I '{}' \
   bash -c 'SERVICE={} && cd ~/Repos/localstack-ext/.venv/lib/python3.10/site-packages/botocore/data && test -d $SERVICE || (echo $SERVICE not found; exit 1)'

@alexrashed alexrashed temporarily deployed to localstack-ext-tests July 7, 2022 08:49 Inactive
@coveralls
Copy link

coveralls commented Jul 7, 2022

Coverage Status

Coverage decreased (-0.003%) to 91.509% when pulling 25666e1 on fix-lambda-asf-api-updates into 0da0472 on master.

@github-actions
Copy link

github-actions bot commented Jul 7, 2022

LocalStack integration with Pro

       3 files  ±0         3 suites  ±0   59m 15s ⏱️ - 3m 40s
1 119 tests ±0  1 079 ✔️  - 1  40 💤 +1  0 ±0 
1 434 runs  ±0  1 365 ✔️  - 1  69 💤 +1  0 ±0 

Results for commit 25666e1. ± Comparison against base commit 0da0472.

♻️ This comment has been updated with latest results.

@thrau
Copy link
Member

thrau commented Jul 7, 2022

sorry @alexrashed ! i think #6409 created the conflict

Copy link
Member

@dominikschubert dominikschubert left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing this 👍

@alexrashed alexrashed temporarily deployed to localstack-ext-tests July 7, 2022 10:34 Inactive
Copy link
Member

@dfangl dfangl left a comment

Choose a reason for hiding this comment

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

🎉

@alexrashed alexrashed merged commit 6dc8ec9 into master Jul 7, 2022
@alexrashed alexrashed deleted the fix-lambda-asf-api-updates branch July 7, 2022 11:40
@localstack localstack locked and limited conversation to collaborators Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants