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: workflows support in java proto sdk #1971

Merged
merged 12 commits into from
Jan 24, 2024

Conversation

aludwiko
Copy link
Contributor

References

@aludwiko aludwiko linked an issue Jan 15, 2024 that may be closed by this pull request
@@ -303,6 +303,8 @@ final class WorkflowImpl(system: ActorSystem, val services: Map[String, Workflow
Future.successful(toProtoEffect(effect, command.id))

case Step(executeStep) =>
val context =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Context is required to call other components.

@aludwiko aludwiko changed the base branch from main to workflows-proto-api January 19, 2024 14:22
@aludwiko aludwiko changed the title [WIP] feat: workflows support in java proto sdk feat: workflows support in java proto sdk Jan 19, 2024
@aludwiko
Copy link
Contributor Author

Ready for the first round, just the codegen updates. Samples, and docs in the following PRs, because this one is big enough.

@johanandren
Copy link
Contributor

One good thing to try out with the refactoring, is to build a proto sample with current latest SDK, then bump to a local version including these changes and see if things break without deleting the old generated sources (user would have their own implementation in them so not so easy to just delete-regenerate)

Copy link
Contributor

@johanandren johanandren left a comment

Choose a reason for hiding this comment

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

Looks good so far, one problem with the entity type change.

Except for that I think next step is to add a sample with a workflow? (Edit: saw you plan to follow up PR that, I think in general it is good to do sample together with the actual feature because you may notice problems and better to have them right in the feature PR, rather than wrong broken merged to main, but do as you prefer)

@aludwiko
Copy link
Contributor Author

aludwiko commented Jan 22, 2024

One good thing to try out with the refactoring, is to build a proto sample with current latest SDK, then bump to a local version including these changes and see if things break without deleting the old generated sources (user would have their own implementation in them so not so easy to just delete-regenerate)

I tested that, and managed sources must be regenerated (*Provider classes). The existing unmanaged code is fine.

@aludwiko aludwiko force-pushed the 1382-workflow-codegen-for-java branch from f87346d to b516d07 Compare January 23, 2024 15:52
@github-actions github-actions bot added the Documentation Improvements or additions to the documentation label Jan 23, 2024
@aludwiko aludwiko changed the base branch from workflows-proto-api to main January 23, 2024 15:59
@aludwiko aludwiko changed the base branch from main to workflows-proto-api January 23, 2024 15:59
service.componentFullName,
throw new IllegalArgumentException(
"Service [" + service.messageType.fullyQualifiedProtoName + "] refers to entity [" + service.componentFullName +
s"], but no entity configuration is found for that component name. Entities: [${entities.keySet.mkString(", ")}]"))
"Service [" + service.messageType.fullyQualifiedProtoName + "] refers to stateful [" + service.componentFullName +
Copy link
Contributor

Choose a reason for hiding this comment

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

refers to stateful ["abc"] vs refers to component ["abc"] or refers to stateful component ["abc"]?

Also, why using both concatenation (+) and string interpolation (s) together?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, I think that mixing was used to avoid very long line.

@github-actions github-actions bot removed the Documentation Improvements or additions to the documentation label Jan 24, 2024
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

We can merge as such, but we still need to add compilation tests for generated code. Can be added in follow-up as this PR is already massive.


s"""package $packageName;
|
|${writeImports(imports)}
Copy link
Member

Choose a reason for hiding this comment

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

It's pity that we didn't refactored the java codegen to use our c interpolator. Check out the scala codegen for more details.

It's much easier to use the c interpolator and then we get the imports right out of the box.

We should do some gardening in the SDK to solve this kind of issues.

Copy link
Contributor Author

@aludwiko aludwiko Jan 24, 2024

Choose a reason for hiding this comment

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

issue created #1991

@aludwiko aludwiko merged commit 96cbee7 into workflows-proto-api Jan 24, 2024
68 checks passed
@aludwiko aludwiko deleted the 1382-workflow-codegen-for-java branch January 24, 2024 13:35
aludwiko added a commit that referenced this pull request Feb 1, 2024
* feat: workflows support in java proto sdk

* deprecated since

* codegen warning about deprecated usage of entity_type

* warnings about depreactions from the codegen

* runtime bump

* codegen with all possible descriptors for workflows

* updating scala samples

* typo removed

* improving generated integration test

* using pre released version of the runtime

* using pre released version of the runtime

* PR comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Workflow: codegen for Java and Scala
4 participants