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 workflow subOrchestration creation #7385

Merged
merged 5 commits into from
Jan 16, 2024

Conversation

shivamkm07
Copy link
Contributor

Description

It fixes workflow sub-orchestration creation by passing correctly the CreateWorkflowInstanceRequest at the time of Sub-orchestration creation. The struct was added as part of #7308.

The PR also adds integration test for the same.

Issue reference

Please reference the issue this PR will close: #7384

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
@shivamkm07 shivamkm07 requested review from a team as code owners January 15, 2024 17:09
Copy link

codecov bot commented Jan 15, 2024

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (46971d6) 62.21% compared to head (187f105) 62.17%.

Files Patch % Lines
...runtime/wfengine/backends/actors/workflow_actor.go 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7385      +/-   ##
==========================================
- Coverage   62.21%   62.17%   -0.05%     
==========================================
  Files         239      239              
  Lines       21942    21950       +8     
==========================================
- Hits        13652    13647       -5     
- Misses       7158     7174      +16     
+ Partials     1132     1129       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

mukundansundar
mukundansundar previously approved these changes Jan 15, 2024
@mukundansundar mukundansundar added this to the v1.13 milestone Jan 15, 2024
Copy link
Contributor

@DeepanshuA DeepanshuA left a comment

Choose a reason for hiding this comment

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

I tested it at my end as well, there was an issue and with this fix, it is working. LGTM

@@ -598,12 +598,21 @@ func (wf *workflowActor) runWorkflow(ctx context.Context, actorID string, remind
if errMarshal != nil {
return errMarshal
}

requestBytes := eventData
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this not backwards-incompatible? If a sidecar that is running 1.12 receives this message, it may not know how to parse this?

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 think not. If a sidecar is running 1.12, here we will be sending only startEvent as rawData: https://github.com/dapr/dapr/blob/release-1.12/pkg/runtime/wfengine/workflow.go#L485

and then we would be parsing that only in CreateWorkflowInstanceMethod:

startEvent, err := backend.UnmarshalHistoryEvent(startEventBytes)

The issue here is PR #7308 added the struct here:

var createWorkflowInstanceRequest CreateWorkflowInstanceRequest
but missed to add here and so the inconsistency causing the issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

So #7308 is not backwards-compatible?

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 meant #7308 is backwards compatible. It's just that it introduced a bug and the current PR fixes it. But it should worknwell even if the sidecar is from 1.12.

@cgillum
Copy link
Contributor

cgillum commented Jan 15, 2024

If this was a regression, we should consider adding a unit test in pkg/runtime/wfengine/wfengine_test.go to cover the child workflows scenario (a.k.a. sub-orchestrations).

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
@shivamkm07
Copy link
Contributor Author

If this was a regression, we should consider adding a unit test in pkg/runtime/wfengine/wfengine_test.go to cover the child workflows scenario (a.k.a. sub-orchestrations).

Added

@mukundansundar
Copy link
Contributor

/test-version-skew

@dapr-bot
Copy link
Collaborator

dapr-bot commented Jan 16, 2024

Dapr Version Skew e2e test (control-plane-master - 1.12.3)

🔗 Link to Action run

Commit ref: 24613a4

✅ Version Skew tests passed

@dapr-bot
Copy link
Collaborator

dapr-bot commented Jan 16, 2024

Dapr Version Skew integration test (dapr-sidecar-master - 1.12.3)

🔗 Link to Action run

Commit ref: 24613a4

✅ Version Skew tests passed

@dapr-bot
Copy link
Collaborator

dapr-bot commented Jan 16, 2024

Dapr Version Skew e2e test (dapr-sidecar-master - 1.12.3)

🔗 Link to Action run

Commit ref: 24613a4

❌ Version Skew tests failed

Please check the logs for details on the error.

@dapr-bot
Copy link
Collaborator

dapr-bot commented Jan 16, 2024

Dapr Version Skew integration test (control-plane-master - 1.12.3)

🔗 Link to Action run

Commit ref: 24613a4

✅ Version Skew tests passed

@mukundansundar
Copy link
Contributor

/test-sdk-all

@mukundansundar
Copy link
Contributor

/ok-to-test

@dapr-bot
Copy link
Collaborator

dapr-bot commented Jan 16, 2024

Dapr SDK Go test

🔗 Link to Action run

Commit ref: 24613a4

✅ Go SDK tests passed

@dapr-bot
Copy link
Collaborator

dapr-bot commented Jan 16, 2024

Dapr SDK Java test

🔗 Link to Action run

Commit ref: 24613a4

❌ Java SDK tests failed

Please check the logs for details on the error.

@dapr-bot
Copy link
Collaborator

dapr-bot commented Jan 16, 2024

Dapr SDK Python test

🔗 Link to Action run

Commit ref: 24613a4

✅ Python SDK tests passed

@dapr-bot
Copy link
Collaborator

dapr-bot commented Jan 16, 2024

Dapr E2E test

🔗 Link to Action run

Commit ref: 24613a4

✅ Infrastructure deployed

Cluster Resource group name Azure region
Linux Dapr-E2E-dapre2ee2f090a946l westus3
Windows Dapr-E2E-dapre2ee2f090a946w westus3
Linux/arm64 Dapr-E2E-dapre2ee2f090a946la eastus

✅ Build succeeded for linux/amd64

  • Image tag: dapre2ee2f090a946l
  • Test image tag: dapre2ee2f090a946l

✅ Build succeeded for windows/amd64

  • Image tag: dapre2ee2f090a946w
  • Test image tag: dapre2ee2f090a946w

❌ Tests failed on windows/amd64

Please check the logs for details on the error.

❌ Tests failed on linux/amd64

Please check the logs for details on the error.

@dapr-bot
Copy link
Collaborator

dapr-bot commented Jan 16, 2024

Dapr SDK JS test

🔗 Link to Action run

Commit ref: 24613a4

✅ JS SDK tests passed

@mukundansundar
Copy link
Contributor

/ok-to-test

@dapr-bot
Copy link
Collaborator

dapr-bot commented Jan 16, 2024

Dapr E2E test

🔗 Link to Action run

Commit ref: 187f105

✅ Build succeeded for linux/amd64

  • Image tag: dapre2eccc71e44ecl
  • Test image tag: dapre2eccc71e44ecl

✅ Infrastructure deployed

Cluster Resource group name Azure region
Linux Dapr-E2E-dapre2eccc71e44ecl westus3
Windows Dapr-E2E-dapre2eccc71e44ecw westus3
Linux/arm64 Dapr-E2E-dapre2eccc71e44ecla eastus

✅ Build succeeded for windows/amd64

  • Image tag: dapre2eccc71e44ecw
  • Test image tag: dapre2eccc71e44ecw

❌ Tests failed on windows/amd64

Please check the logs for details on the error.

❌ Tests failed on linux/amd64

Please check the logs for details on the error.

@mukundansundar mukundansundar merged commit cb02cff into dapr:master Jan 16, 2024
30 of 32 checks passed
cicoyle pushed a commit to cicoyle/dapr that referenced this pull request May 24, 2024
* fix workflow subOrchestration

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding UT for child workflow creation

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

---------

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
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.

Workflow Sub-Orchestration creation not working
6 participants