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(scheduler-alpha): scheduler input always get transformed to string with extra double quotes #31894

Merged
merged 23 commits into from
Oct 28, 2024

Conversation

samson-keung
Copy link
Contributor

@samson-keung samson-keung commented Oct 24, 2024

Issue # (if applicable)

Tracking #31785.

Reason for this change

When using ScheduleTargetInput.fromText("some-string"), the string is always wrapped with an extra double quotes in the final template:

"Input": "\"some-string\"",

Customers cannot get rid of the extra escaped double quotes other than using escape hatches.

Description of changes

Skip converting the text to JSON string, which is the reason causing the extra double quotes.

Description of how you validated changes

Unit test and integ test.

Checklist


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


BREAKING CHANGE: Got rid of extra double quotes on Schedule input which blocks customer intention of using no double quotes in the input text

@aws-cdk-automation aws-cdk-automation requested a review from a team October 24, 2024 20:27
@github-actions github-actions bot added the p2 label Oct 24, 2024
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Oct 24, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@aws-cdk-automation aws-cdk-automation dismissed their stale review October 24, 2024 21:25

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@samson-keung samson-keung force-pushed the scheduler-reduce-key-permissions branch 2 times, most recently from 7c611ac to 01b387a Compare October 24, 2024 21:47
@samson-keung samson-keung force-pushed the scheduler-reduce-key-permissions branch from 01b387a to fb485c7 Compare October 24, 2024 22:05
@samson-keung samson-keung force-pushed the scheduler-reduce-key-permissions branch from d55f6c2 to 475fd3f Compare October 25, 2024 05:41
@samson-keung samson-keung force-pushed the scheduler-reduce-key-permissions branch from 475fd3f to 5b81a3e Compare October 25, 2024 15:43
@samson-keung samson-keung changed the title fix(scheduler-targets-alpha): unnecessary KMS permissions granted to Schedule role fix(scheduler-alpha): scheduler input always get transformed to string with extra double quotes Oct 26, 2024
@samson-keung samson-keung marked this pull request as ready for review October 26, 2024 04:17
@@ -41,7 +41,7 @@ export abstract class ScheduleTargetInput {
}

class FieldAwareEventInput extends ScheduleTargetInput {
constructor(private readonly input: any) {
constructor(private readonly input: any, private readonly toJsonString: boolean) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is probably a better implementation approach but since this is only used internal/private in the class, I will fix the behaviour for now, then improve the design for easier readability and maintainability in subsequent PRs.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think its fine honestly

Copy link
Contributor

Choose a reason for hiding this comment

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

I see a similar class in aws-events where the second parameter is the inputType and the bind method handles the input accordingly. Could we do something similar here?

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Oct 26, 2024
@@ -41,7 +41,7 @@ export abstract class ScheduleTargetInput {
}

class FieldAwareEventInput extends ScheduleTargetInput {
constructor(private readonly input: any) {
constructor(private readonly input: any, private readonly toJsonString: boolean) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think its fine honestly

Copy link
Contributor

mergify bot commented Oct 28, 2024

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 Oct 28, 2024
Copy link
Contributor

mergify bot commented Oct 28, 2024

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).

@@ -41,7 +41,7 @@ export abstract class ScheduleTargetInput {
}

class FieldAwareEventInput extends ScheduleTargetInput {
constructor(private readonly input: any) {
constructor(private readonly input: any, private readonly toJsonString: boolean) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I see a similar class in aws-events where the second parameter is the inputType and the bind method handles the input accordingly. Could we do something similar here?

Copy link
Contributor

mergify bot commented Oct 28, 2024

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
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 09521ad
  • 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 186b8ab into aws:main Oct 28, 2024
9 checks passed
Copy link
Contributor

mergify bot commented Oct 28, 2024

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).

Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2024
@samson-keung samson-keung deleted the scheduler-reduce-key-permissions branch October 28, 2024 18:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
contribution/core This is a PR that came from AWS. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants