Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ehuelsmann
Copy link
Member

@ehuelsmann ehuelsmann commented Aug 3, 2021

Description

Closes #106. Moves the responsibility of instantiating history classes from the factory
and the persister into the Workflow class.

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project, please see the contribution guidelines.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@ehuelsmann ehuelsmann added the enhancement Feature/improvement label Aug 3, 2021
@ehuelsmann ehuelsmann added this to the 2.0 milestone Aug 3, 2021
@ehuelsmann ehuelsmann requested a review from jonasbn August 3, 2021 22:05
@ehuelsmann
Copy link
Member Author

I'm pondering the 'breakingchange' tag. I'm not actually sure this one breaks anything: there was no need to adapt the test suite to implement this change...

@coveralls
Copy link

coveralls commented Aug 3, 2021

Coverage Status

Coverage increased (+0.03%) to 92.233% when pulling cc9f71e on ehuelsmann:history-class into 82dd62c on jonasbn:master.

Copy link
Collaborator

@jonasbn jonasbn left a comment

Choose a reason for hiding this comment

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

Approved

Closes perl-workflow#106. Moves the responsibility of instantiating history classes from the factory
and the persister into the Workflow class.
@ehuelsmann
Copy link
Member Author

Step 1: conflicts resolved.

Note that the actions were inserting history items of type 'Workflow::History'
which is the supertype of the configured history item.  Change the history
addition to simply provide the construction parameters of the history object
instead of providing the history object itself.
- Merge two constant strings which would be concatenated later
- Indentation in a code example for better readability
Since the history class can be changed on the workflow, it's the
responsibility of Workflow to instantiate its history items. In our
examples, promote that pattern (instead of the older pattern where
the history class would be hard-coded).
@ehuelsmann
Copy link
Member Author

Step 2: Add tests and documentation tweaks.

@ehuelsmann ehuelsmann marked this pull request as ready for review August 13, 2021 09:27
@ehuelsmann
Copy link
Member Author

@jonasbn this PR is now ready for final review and merging.

Please note that although I changed the code in the test suite to stop adding Workflow::History->new() items, this is only required because I changed the configured history class on workflow.xml. In legacy code bases, no history class will be configured, meaning the class will default to Workflow::History and "manually" adding history items of that type will succeed.

Copy link
Collaborator

@jonasbn jonasbn left a comment

Choose a reason for hiding this comment

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

Approved

@jonasbn jonasbn merged commit 5e691d8 into perl-workflow:master Aug 18, 2021
@ehuelsmann ehuelsmann deleted the history-class branch August 18, 2021 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Feature/improvement

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Allow the use of user-provided history class

3 participants