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

chore(ecs-patterns): ScheduledFargateTaskProps is exposing unused props from FargateServiceBaseProps #26737

Merged
merged 5 commits into from
Aug 18, 2023

Conversation

lpizzinidev
Copy link
Contributor

@lpizzinidev lpizzinidev commented Aug 12, 2023

ScheduledFargateTaskProps was extending the FargateServiceBaseProps interface.
The only property used from that interface is platformVersion.

This change adds warning messages if the unused properties are specified:

  • taskDefinition
  • cpu
  • memoryLimitMiB
  • runtimePlatform

Closes #26702.


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

@github-actions github-actions bot added star-contributor [Pilot] contributed between 25-49 PRs to the CDK bug This issue is a bug. effort/small Small work item – less than a day of effort labels Aug 12, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team August 12, 2023 13:23
@github-actions github-actions bot added the p1 label Aug 12, 2023
Copy link
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

Unfortunately, our dear friend backwards compatibility raises its ugly head again (let me reformat to make this more readable):

API elements with incompatible changes:

err  - IFACE aws-cdk-lib.aws_ecs_patterns.ScheduledFargateTaskProps:
    not assignable to all base types anymore:
        aws-cdk-lib.aws_ecs_patterns.ScheduledFargateTaskProps does not extend aws-cdk-lib.aws_ecs_patterns.FargateServiceBaseProps

err  - PROP aws-cdk-lib.aws_ecs_patterns.ScheduledFargateTaskProps.cpu:
    has been removed

err  - PROP aws-cdk-lib.aws_ecs_patterns.ScheduledFargateTaskProps.memoryLimitMiB:
    has been removed
err  - PROP aws-cdk-lib.aws_ecs_patterns.ScheduledFargateTaskProps.runtimePlatform:
    has been removed
err  - PROP aws-cdk-lib.aws_ecs_patterns.ScheduledFargateTaskProps.taskDefinition:
    has been removed

Once an API has been locked in, the only way to deal with this is by using runtime validation.

And we can't really break any currently succeeding synths either, so we'd have to add a warning.

@lpizzinidev
Copy link
Contributor Author

@rix0rrr
So we should switch back to ScheduledFargateTaskProps implementing FargateServiceBaseProps and adding annotation warnings for the unused props?

@rix0rrr
Copy link
Contributor

rix0rrr commented Aug 17, 2023

@rix0rrr So we should switch back to ScheduledFargateTaskProps implementing FargateServiceBaseProps and adding annotation warnings for the unused props?

Yep!

@lpizzinidev lpizzinidev changed the title chore(ecs-patterns): ScheduledFargateTaskProps was exposing unused props from FargateServiceBaseProps chore(ecs-patterns): ScheduledFargateTaskProps is exposing unused props from FargateServiceBaseProps Aug 18, 2023
@mergify mergify bot dismissed rix0rrr’s stale review August 18, 2023 07:28

Pull request has been modified.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Aug 18, 2023
Copy link
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

Cheers!

@mergify
Copy link
Contributor

mergify bot commented Aug 18, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Aug 18, 2023
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 4b61e92
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 52b43fc into aws:main Aug 18, 2023
12 checks passed
@mergify
Copy link
Contributor

mergify bot commented Aug 18, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. effort/small Small work item – less than a day of effort p1 star-contributor [Pilot] contributed between 25-49 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(ecs-patterns): ScheduledFargateTask - cpu and memoryLimitMiB construct props are ignored
3 participants