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(122): split switch state to separate file #127

Merged
merged 1 commit into from
Nov 17, 2022
Merged

fix(122): split switch state to separate file #127

merged 1 commit into from
Nov 17, 2022

Conversation

lsytj0413
Copy link
Collaborator

Signed-off-by: lsytj0413 511121939@qq.com

Many thanks for submitting your Pull Request ❤️!

What this PR does / why we need it:

Special notes for reviewers:

Additional information (if needed):

Fixed #122

model/switch_state.go Outdated Show resolved Hide resolved
model/switch_state.go Outdated Show resolved Hide resolved
Copy link
Member

@spolti spolti left a comment

Choose a reason for hiding this comment

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

can you please also add a test using yaml or json that have a invalid switch state (different than Data or Event based switch)? Just to make sure that the parser will complain if something unexpected is typed, e.g. a typo.

model/switch_state_test.go Outdated Show resolved Hide resolved
model/switch_state.go Outdated Show resolved Hide resolved
model/switch_state.go Outdated Show resolved Hide resolved
model/switch_state.go Outdated Show resolved Hide resolved
model/switch_state.go Outdated Show resolved Hide resolved
model/switch_state.go Outdated Show resolved Hide resolved
model/switch_state.go Show resolved Hide resolved
model/switch_state.go Outdated Show resolved Hide resolved
@lsytj0413
Copy link
Collaborator Author

can you please also add a test using yaml or json that have a invalid switch state (different than Data or Event based switch)? Just to make sure that the parser will complain if something unexpected is typed, e.g. a typo.

Can you explain more clearly (a example will be helpful). IMO, if the user set any field than specification, there will be no error reported (because we only unmarshal the known field).

@ricardozanini
Copy link
Member

@spolti can you answer the comments? @lsytj0413 can you please rebase?
Sorry for the late reply, I was on PTO.

@spolti
Copy link
Member

spolti commented Nov 14, 2022

can you please also add a test using yaml or json that have a invalid switch state (different than Data or Event based switch)? Just to make sure that the parser will complain if something unexpected is typed, e.g. a typo.

Can you explain more clearly (a example will be helpful). IMO, if the user set any field than specification, there will be no error reported (because we only unmarshal the known field).

A good test could be marshall and unmarshall like we did here: https://github.com/serverlessworkflow/sdk-go/blob/main/parser/parser_test.go#L609

use a proposital type to define, let's say, "eventCondition", the result should be nil pointer or a error log telling the value is not valid,.

@lsytj0413
Copy link
Collaborator Author

A good test could be marshall and unmarshall like we did here: https://github.com/serverlessworkflow/sdk-go/blob/main/parser/parser_test.go#L609

use a proposital type to define, let's say, "eventCondition", the result should be nil pointer or a error log telling the value is not valid,.

done, PTAL

@lsytj0413
Copy link
Collaborator Author

@ricardozanini resolved conflict, PTAL

Signed-off-by: lsytj0413 <511121939@qq.com>
Copy link
Member

@spolti spolti left a comment

Choose a reason for hiding this comment

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

Many thanks. :)

@ricardozanini ricardozanini merged commit 7b28917 into serverlessworkflow:main Nov 17, 2022
@lsytj0413 lsytj0413 deleted the fix-122 branch November 17, 2022 14:05
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.

Move SwitchState to an separate switch_state.go file
3 participants