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

[REFACTOR] Make WorkflowState more easily updated with a Builder Constructor from a previous state #713

Closed
dbwiddis opened this issue May 8, 2024 · 0 comments · Fixed by #778
Assignees
Labels
backlog Good to have functionality not critical for next release enhancement New feature or request

Comments

@dbwiddis
Copy link
Member

dbwiddis commented May 8, 2024

Is your feature request related to a problem?

Making one change on a WorkflowState object requires re-adding all the individual fields through the builder. See for example:

this.workflowState = new WorkflowState.Builder().workflowId(workflowState.getWorkflowId())
.error(workflowState.getError())
.state(workflowState.getState())
.resourcesCreated(workflowState.resourcesCreated())
.build();

What solution would you like?

Create a constructor on the Builder that accepts a previous state as its input and copies over the fields. Then only the changed fields need to be added. We do this for the Template class here.

What alternatives have you considered?

Leaving it as-is.

Do you have any additional context?

I actually did the work for this in my POC PR #631 so someone just needs to copy-paste some of those changes. :-)

@dbwiddis dbwiddis added enhancement New feature or request good first issue Good for newcomers untriaged and removed untriaged labels May 8, 2024
@dbwiddis dbwiddis added the backlog Good to have functionality not critical for next release label May 30, 2024
@dbwiddis dbwiddis self-assigned this Jul 12, 2024
@dbwiddis dbwiddis removed the good first issue Good for newcomers label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Good to have functionality not critical for next release enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant