Skip to content

Conversation

maxhoheiser
Copy link
Member

@maxhoheiser maxhoheiser commented Aug 23, 2024

Motivation

This PR adds the ability to extend the TargetSenderFactory by targets defined in localstack-pro.
Furthermore, it makes testing fixtures available to localstack-pro

Testing

Since ECS is a pro feature, the aws validated test can be found in the companion branch.

@maxhoheiser maxhoheiser added aws:events Amazon EventBridge semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases labels Aug 23, 2024
@maxhoheiser maxhoheiser self-assigned this Aug 23, 2024
Copy link

github-actions bot commented Aug 23, 2024

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 52m 30s ⏱️ + 1m 22s
3 826 tests ±0  3 508 ✅ ±0  318 💤 ±0  0 ❌ ±0 
3 828 runs  ±0  3 508 ✅ ±0  320 💤 ±0  0 ❌ ±0 

Results for commit e2c37cd. ± Comparison against base commit 35cb30e.

♻️ This comment has been updated with latest results.

@maxhoheiser maxhoheiser marked this pull request as ready for review August 23, 2024 14:17
}

# Remove any keys with a value of None
kwargs = {k: v for k, v in kwargs.items() if v is not None}
Copy link
Member

Choose a reason for hiding this comment

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

Hierarchical configs can still contain None values. Example: NetworkConfiguration.awsvpcConfiguration.subnets

Copy link
Member Author

Choose a reason for hiding this comment

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

they should not be passed as input arguments to overwrite potential defaults if they are empty, also if they are empty lists, especially with required values like subnets.


def _validate_input(self, target: Target):
super()._validate_input(target)
if not collections.get_safe(target, "$.EcsParameters.TaskDefinitionArn"):
raise ValueError("EcsParameters.TaskDefinitionArn is required for ECS target")
ecs_parameters = target.get("EcsParameters", {})
if ecs_parameters.get("LaunchType", {}) == "FARGATE":
Copy link
Member

Choose a reason for hiding this comment

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

Are these validations based on service knowledge or manual testing?
Mostly a notice because the ext tests cover the happy path and don't snapshot any validation errors.

Copy link
Member Author

Choose a reason for hiding this comment

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

provider knowledge, no testing of errors is added for now

Copy link

S3 Image Test Results (AMD64 / ARM64)

  2 files  ±0    2 suites  ±0   3m 26s ⏱️ -6s
420 tests ±0  368 ✅ ±0   52 💤 ±0  0 ❌ ±0 
840 runs  ±0  736 ✅ ±0  104 💤 ±0  0 ❌ ±0 

Results for commit 61b2652. ± Comparison against base commit 2ca5d19.

@maxhoheiser maxhoheiser force-pushed the feature/eventbridge_v2/ecs-target branch 2 times, most recently from b5d4c0f to f923913 Compare August 27, 2024 11:54
@giograno giograno added this to the Playground milestone Aug 28, 2024
@maxhoheiser maxhoheiser force-pushed the feature/eventbridge_v2/ecs-target branch 3 times, most recently from f578238 to cabb5fb Compare September 25, 2024 06:36
@maxhoheiser maxhoheiser force-pushed the feature/eventbridge_v2/ecs-target branch from 7ce2910 to b19d0b7 Compare October 2, 2024 08:47
@localstack-bot
Copy link
Contributor

Currently, only patch changes are allowed on master. Your PR labels (aws:events, semver: minor) indicate that it cannot be merged into the master at this time.

@maxhoheiser maxhoheiser force-pushed the feature/eventbridge_v2/ecs-target branch 2 times, most recently from a52d2c5 to e0bab5e Compare October 14, 2024 06:51
@maxhoheiser maxhoheiser force-pushed the feature/eventbridge_v2/ecs-target branch 3 times, most recently from f7f0d39 to c516d51 Compare October 21, 2024 08:14
@simonrw simonrw force-pushed the feature/eventbridge_v2/ecs-target branch from c516d51 to 9f281ea Compare December 3, 2024 14:44
@simonrw simonrw force-pushed the feature/eventbridge_v2/ecs-target branch from 93b2df7 to e2c37cd Compare December 4, 2024 13:52
Copy link
Member

@joe4dev joe4dev left a comment

Choose a reason for hiding this comment

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

We are missing the new service dependency definition for ecs in localstack-core/localstack/utils/bootstrap.py:API_DEPENDENCIES_OPTIONAL for test selection.

Otherwise, lgtm.

@joe4dev
Copy link
Member

joe4dev commented Dec 5, 2024

We are missing the new service dependency definition for ecs in localstack-core/localstack/utils/bootstrap.py:API_DEPENDENCIES_OPTIONAL for test selection.

Otherwise, lgtm.

Update: Looking at the Lambda example and how service dependencies are merged, I think this dependency should be added in ext here localstack-pro-core/localstack/pro/core/utils/aws/service_dependencies.py:API_DEPENDENCIES_OPTIONAL_EXT

@simonrw simonrw changed the title Feature/Eventbridge v2: Add ECS target Feature/Eventbridge v2: Support extending targets Dec 6, 2024
@simonrw simonrw changed the title Feature/Eventbridge v2: Support extending targets Feature/Eventbridge v2: Support extending targets in ext Dec 6, 2024
@simonrw simonrw changed the title Feature/Eventbridge v2: Support extending targets in ext Feature/Eventbridge v2: Support extending available targets Dec 6, 2024
@simonrw simonrw merged commit 994758a into master Dec 6, 2024
35 checks passed
@simonrw simonrw deleted the feature/eventbridge_v2/ecs-target branch December 6, 2024 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws:events Amazon EventBridge semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants