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

done method in PrismTask class #29

Closed
prism-admin opened this issue Aug 13, 2023 · 2 comments · Fixed by #31
Closed

done method in PrismTask class #29

prism-admin opened this issue Aug 13, 2023 · 2 comments · Fixed by #31
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers

Comments

@prism-admin
Copy link
Contributor

Is your feature request related to a problem? Please describe.

When running a Prism project, I want to be able to skip tasks that are already "Done". I can do this while running individual tasks (i.e., if I run a specific Prism task, then the task will skip upstream tasks that have a target). However, I want to be able to do this when running the project as a whole.

Describe the solution you'd like

  • Add a done method to the PrismTask class. This function must return either True of `False.
class PrismTask:
    ...
    def done(self, hooks):
        # do something here
        return True
  • Users can overwrite this this function in their own task definitions.
  • When running each task in a project, call done() before calling exec()

Describe alternatives you've considered
N/A

Additional context
N/A

@prism-admin prism-admin added documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers labels Aug 13, 2023
@NotNullBool
Copy link

So the done method is meant to be a protected method called by execute. That can be over written by sub classes. However the done method will be only accessible by the execute method correct? No one else is meant to call this method?

@prism-admin
Copy link
Contributor Author

So the done method is meant to be a protected method called by execute. That can be over written by sub classes. However the done method will be only accessible by the execute method correct? No one else is meant to call this method?

Yes, that's correct. Users will be able to define custom logic for their task's done method, but they will never need to call it directly.

NotNullBool added a commit to NotNullBool/prism that referenced this issue Aug 13, 2023
@prism-admin prism-admin linked a pull request Aug 21, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants