Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove legacy lambda provider #9543

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

Merged
merged 4 commits into from
Nov 6, 2023
Merged

Remove legacy lambda provider #9543

merged 4 commits into from
Nov 6, 2023

Conversation

joe4dev
Copy link
Member

@joe4dev joe4dev commented Nov 2, 2023

Companion PR: https://github.com/localstack/localstack-ext/pull/2296

Motivation

Following the deprecation of the old Lambda provider in v2.0, we can finally get rid of the old Lambda provider in v3.0.

Changes

  • Remove the code of the legacy Lambda provider previously moved into legacy packages in Move lambda v1 to legacy package #9473
  • Remove deprecated Lambda configuration options
  • Remove legacy tests
  • Remove conditions in Lambda tests depending on old vs. new provider
  • Remove CI testing for the old Lambda provider

Notes

  • The current implementation for event source listeners relies on the LegacyInvocationResult, which has been re-named and preserved until we re-work event source mappings (e.g., the sqs_event_source_listener still depends on the LegacyInvocationResult and the adapers can be removed post v3).
  • The current implementation of the DLQ helper relies on the LegacyInvocationException, which has been re-named and preserved until we re-work the DQL util _send_to_dead_letter_queue.

Discussion

  • localstack/runtime/analytics.py Do we keep the analytics of deprecated variables post 3.0?
    • It could help to understand how many users set the option
    • It might distort the actual use of the variable because the option is ignored or require additional filtering

@joe4dev joe4dev added the semver: major Breaking changes which can be included in a major release only label Nov 2, 2023
@joe4dev joe4dev added this to the 3.0 milestone Nov 2, 2023
@joe4dev joe4dev self-assigned this Nov 2, 2023
@joe4dev joe4dev mentioned this pull request Nov 2, 2023
20 tasks
@coveralls
Copy link

coveralls commented Nov 2, 2023

Coverage Status

coverage: 84.23% (+0.4%) from 83.855%
when pulling 88193c6 on remove-lambda-legacy
into 541593a on release/v3.0.

Copy link

github-actions bot commented Nov 2, 2023

LocalStack Community integration with Pro

       2 files  ±  0         2 suites  ±0   1h 0m 35s ⏱️ - 3m 15s
2 302 tests  - 23  1 785 ✔️  - 5  517 💤  - 18  0 ±0 
2 303 runs   - 23  1 785 ✔️  - 5  518 💤  - 18  0 ±0 

Results for commit 88193c6. ± Comparison against base commit 541593a.

♻️ This comment has been updated with latest results.

@@ -242,6 +242,13 @@ def is_affected(self) -> bool:
"1.4.0",
"This feature is marked for removal. Please use AWS client API to seed Kinesis streams.",
),
EnvVarDeprecation(
"PROVIDER_OVERRIDE_LAMBDA",
Copy link
Member Author

Choose a reason for hiding this comment

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

Adding the provider override as a deprecation option helps users cleaning up their configuration

@@ -20,8 +20,10 @@
"KINESIS_PROVIDER",
"KMS_PROVIDER",
"LAMBDA_DOWNLOAD_AWS_LAYERS",
# Irrelevant post v3 but intentionally tracked for some time
"LAMBDA_EXECUTOR",
Copy link
Member Author

Choose a reason for hiding this comment

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

It might be interesting to know how many users still have legacy variables configured post v3 🤷

Copy link
Member

Choose a reason for hiding this comment

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

can't hurt and we can still turn it off later 👍

@@ -0,0 +1,11 @@
# TODO: remove this legacy construct when re-working event source mapping.
Copy link
Member Author

@joe4dev joe4dev Nov 3, 2023

Choose a reason for hiding this comment

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

The event source mapping should be reworked post v3 but I tried to keep this removal PR minimal and avoid functional changes.

@@ -37,6 +36,14 @@ def get_sqs_client(function_version, client_config=None):
).sqs


# TODO: remove once DLQ handling is refactored following the removal of the legacy lambda provider
Copy link
Member Author

Choose a reason for hiding this comment

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

The DLQ utilility should be reworked post v3 but I tried to keep this removal PR minimal and avoid functional changes.

Copy link
Member

Choose a reason for hiding this comment

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

good choice 😁

@@ -123,12 +119,10 @@ def _send_and_receive_messages():
# this will fail in november 2286, if this code is still around by then, read this comment and update to 10
assert int(math.log10(timestamp)) == 9

# FIXME remove usage of this config value with 2.0
@patch.object(config, "SYNCHRONOUS_KINESIS_EVENTS", False)
# TODO: is this test relevant for the new provider without patching SYNCHRONOUS_KINESIS_EVENTS?
Copy link
Member Author

Choose a reason for hiding this comment

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

❓ Is this test still relevant?

  • It appears AWS-validated but breaking
  • The patching of SYNCHRONOUS_KINESIS_EVENTS was only relevant for the old provider

Copy link
Member

Choose a reason for hiding this comment

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

prob not, but let's defer that until later

@alexrashed alexrashed force-pushed the release/v3.0 branch 2 times, most recently from fb5da7d to 99278b3 Compare November 4, 2023 13:46
@joe4dev joe4dev force-pushed the remove-lambda-legacy branch 2 times, most recently from 7850f27 to 7494c20 Compare November 6, 2023 12:38
@joe4dev joe4dev marked this pull request as ready for review November 6, 2023 12:43
@joe4dev joe4dev requested a review from HarshCasper as a code owner November 6, 2023 12:43
@joe4dev joe4dev mentioned this pull request Nov 6, 2023
5 tasks
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!

Very thorough removal of nearly everything from the legacy provider! Awesome 🚀

@@ -123,12 +119,10 @@ def _send_and_receive_messages():
# this will fail in november 2286, if this code is still around by then, read this comment and update to 10
assert int(math.log10(timestamp)) == 9

# FIXME remove usage of this config value with 2.0
@patch.object(config, "SYNCHRONOUS_KINESIS_EVENTS", False)
# TODO: is this test relevant for the new provider without patching SYNCHRONOUS_KINESIS_EVENTS?
Copy link
Member

Choose a reason for hiding this comment

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

prob not, but let's defer that until later

@@ -37,6 +36,14 @@ def get_sqs_client(function_version, client_config=None):
).sqs


# TODO: remove once DLQ handling is refactored following the removal of the legacy lambda provider
Copy link
Member

Choose a reason for hiding this comment

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

good choice 😁

@@ -20,8 +20,10 @@
"KINESIS_PROVIDER",
"KMS_PROVIDER",
"LAMBDA_DOWNLOAD_AWS_LAYERS",
# Irrelevant post v3 but intentionally tracked for some time
"LAMBDA_EXECUTOR",
Copy link
Member

Choose a reason for hiding this comment

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

can't hurt and we can still turn it off later 👍

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.

LGTM! All those removed lines 🤩

We still need to keep them in the `CONFIG_ENV_VARS` if we still want deprecation messages to be shown in the LocalStack container.
@joe4dev joe4dev force-pushed the remove-lambda-legacy branch from 7494c20 to 88193c6 Compare November 6, 2023 19:55
@joe4dev joe4dev merged commit e2b109b into release/v3.0 Nov 6, 2023
@joe4dev joe4dev deleted the remove-lambda-legacy branch November 6, 2023 22:25
localstack-bot pushed a commit that referenced this pull request Nov 7, 2023
alexrashed pushed a commit that referenced this pull request Nov 7, 2023
alexrashed pushed a commit that referenced this pull request Nov 7, 2023
localstack-bot pushed a commit that referenced this pull request Nov 9, 2023
alexrashed pushed a commit that referenced this pull request Nov 9, 2023
alexrashed pushed a commit that referenced this pull request Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: major Breaking changes which can be included in a major release only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants