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

feat(spring-sdk): provide access to current state in views #1092

Merged
merged 4 commits into from Sep 9, 2022

Conversation

efgpinto
Copy link
Member

@efgpinto efgpinto commented Sep 2, 2022

References #1091

This MR:

  • adds access to current state in the context of a view
  • adds IT tests with valueentity, view and transformed view

@efgpinto efgpinto changed the title feat(sprind-sdk): provide access to current state in views feat(spring-sdk): provide access to current state in views Sep 2, 2022
@efgpinto efgpinto changed the base branch from main to spring-sdk September 2, 2022 14:43
@efgpinto efgpinto force-pushed the add_current_state_views branch 4 times, most recently from f853ac0 to a76f6e0 Compare September 8, 2022 22:57
@efgpinto efgpinto marked this pull request as ready for review September 8, 2022 23:07
@efgpinto
Copy link
Member Author

efgpinto commented Sep 8, 2022

Updated now to allow for passing the stateby param and ready for new review. Some tests failing with the Jackson parameters issue, will revisit tomorrow.

@efgpinto efgpinto force-pushed the add_current_state_views branch 3 times, most recently from 591ff07 to d7a4a02 Compare September 9, 2022 10:56
@efgpinto efgpinto force-pushed the add_current_state_views branch 2 times, most recently from 834a958 to dada7fa Compare September 9, 2022 12:29
Copy link
Member

@octonato octonato left a comment

Choose a reason for hiding this comment

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

LGTM

I did a quick review. Good to have another ✅ before merging

@@ -95,9 +95,9 @@ case class VirtualServiceMethod(component: Class[_], methodName: String, inputTy
* Build from methods annotated with @Subscription. Those methods are not annotated with Spring REST annotations, but
* they become a REST method at the end.
*/
case class RestServiceMethod(javaMethod: Method) extends AnyServiceMethod {
case class RestServiceMethod(javaMethod: Method, inputTypeParamIndex: Int = 0) extends AnyServiceMethod {
Copy link
Member

Choose a reason for hiding this comment

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

ahah!

Copy link
Member Author

Choose a reason for hiding this comment

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

what was that? :D

Copy link
Member

Choose a reason for hiding this comment

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

I think I added one h to much

It was intended to be: Aha!

Like in: Aha! Now we have a solution for skipping the first arg and extracting the next one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Aha! Now I get it! :D

Comment on lines -1019 to -1035
sample-spring-wiring-tests:
machine:
image: ubuntu-2004:202201-02
steps:
- checkout-and-merge-to-main
- setup_sbt
- restore_deps_cache
# note: `copy-from-workspace` requires `publish-local` to be run first as declared in workflow section below
- copy-from-workspace
- set-sdk-version
- run:
name: Spring SDK wiring tests
command: |
cd samples/spring-wiring-tests
echo "Running mvn with SDK version: '$SDK_VERSION'"
# no testing for now, only 'compile'
mvn -Dkalix-sdk.version=$SDK_VERSION verify -Pit
Copy link
Member

Choose a reason for hiding this comment

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

💯

Copy link
Contributor

@franciscolopezsancho franciscolopezsancho left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -17,12 +17,15 @@
package kalix.springsdk.impl.view

import com.google.protobuf.any.{ Any => ScalaPbAny }
import kalix.javasdk.Metadata
import kalix.javasdk.{ JsonSupport, Metadata }
Copy link
Contributor

Choose a reason for hiding this comment

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

two lines, one line? :)

Copy link
Member Author

@efgpinto efgpinto Sep 9, 2022

Choose a reason for hiding this comment

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

not sure what you mean :S would you elaborate, please?

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, you mean two separate lines?

I mean, I guess this should be automatic.. otherwise it's a pain.. I think this is fine if no checks are triggered. I checked that we have other instances in the code of using this format.

@efgpinto efgpinto merged commit b6d3754 into lightbend:spring-sdk Sep 9, 2022
@efgpinto efgpinto deleted the add_current_state_views branch September 9, 2022 15:16
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.

None yet

4 participants