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(iot-events): support all binary operators #19889

Merged
merged 4 commits into from
Jul 29, 2022

Conversation

yamatatsu
Copy link
Contributor

@yamatatsu yamatatsu commented Apr 13, 2022

This PR adds rest binary operators of IoT Events.
This PR does not add new integ tests because of this conversation.


All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

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

@gitpod-io
Copy link

gitpod-io bot commented Apr 13, 2022

@aws-cdk-automation aws-cdk-automation requested a review from a team April 13, 2022 00:15
@github-actions github-actions bot added the p2 label Apr 13, 2022
@yamatatsu yamatatsu changed the title feat(iotevents): add all binary operations feat(iotevents): support all binary operators Apr 13, 2022
/**
* Create a expression as String from the given string.
*/
public static asString(value: string): Expression {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the rename from fromString to asString ? asString implies a conversion to me, which is not what is happening.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, when users want to use literal string in the expression, it is needed to use fromString with double-quotes as following:

fromString('"my-data"')

And when users want to use literal number, it is needed to use fromString with string as following:

fromString('12.5')

Actually, I want to provide fromString and fromNumber as following:

fromString('my-data') // double-quotes is not needed
fromNumber(12.5) // apply number instead of string

But already I have used fromString name space...
literalString and literalNumber are better?

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, the iotevents-actions package seems to be experimental, which means we are technically allowed to break its behavior in breaking ways if we figure out we made a mistake in the past (that's what the point of that stability is).

So I'd prefer for us to keep the prime real estate names, and change the behavior of fromString and fromNumber to have the desired behavior.

If you are concerned about inconveniencing users, fair enough and I love that instinct. We can choose to do one of the following things:

  • Introduce a feature flag to gate the old vs new behavior of the fromString() method.
  • Introduce a new method (immediately @deprecated) named legacyFromString() or something, and clearly explain in the PR body that users relying on the old behavior should either fix their code or switch to the other method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rix0rrr
Thanks for your suggestion!
I have reverted the commit for asString and asNumber. And I will implement fromString and fromNumber as breaking change in another PR. Because it will have small changing some tests already written.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm creating the PR yamatatsu#30 for breaking change of the behavior of Expression.fromString().

@mergify mergify bot dismissed rix0rrr’s stale review April 17, 2022 10:25

Pull request has been modified.

@yamatatsu yamatatsu requested a review from rix0rrr April 17, 2022 12:03
@TheRealAmazonKendra TheRealAmazonKendra changed the base branch from v1-main to main July 13, 2022 00:06
@TheRealAmazonKendra
Copy link
Contributor

@yamatatsu Ouch. Another one our branch change blew up. Sorry that the lag in our reviews has caused so much extra work overall.

Copy link
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a comment

Choose a reason for hiding this comment

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

Just putting this in changes requested so that I'll be able to tell more easily when it's been rebased.

@yamatatsu yamatatsu force-pushed the iotevents-rest-binary-expressions branch from a63fc40 to bcda92d Compare July 29, 2022 13:18
@mergify mergify bot dismissed TheRealAmazonKendra’s stale review July 29, 2022 13:19

Pull request has been modified.

@yamatatsu
Copy link
Contributor Author

@TheRealAmazonKendra
Thanks for your comments and mention! I've rebased and pass CI.
Are there something that I should do?

@TheRealAmazonKendra TheRealAmazonKendra changed the title feat(iotevents): support all binary operators chore(iot-events): support all binary operators Jul 29, 2022
@mergify
Copy link
Contributor

mergify bot commented Jul 29, 2022

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: a8b5c67
  • 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 9e6d2cd into aws:main Jul 29, 2022
@mergify
Copy link
Contributor

mergify bot commented Jul 29, 2022

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

josephedward pushed a commit to josephedward/aws-cdk that referenced this pull request Aug 30, 2022
This PR adds rest binary operators of IoT Events.
This PR does not add new integ tests because of [this conversation](aws#19329 (comment)).

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants