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

Adds --with-dependencies flag #650

Merged
merged 6 commits into from
May 30, 2019

Conversation

JayjeetAtGithub
Copy link
Collaborator

Addresses #625

@pep8speaks
Copy link

pep8speaks commented May 15, 2019

Hello @JayjeetAtGithub! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2019-05-29 19:35:11 UTC

@JayjeetAtGithub
Copy link
Collaborator Author

JayjeetAtGithub commented May 15, 2019

@ivotron Please review. It's ready. Thanks !

Copy link
Collaborator

@ivotron ivotron left a comment

Choose a reason for hiding this comment

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

thanks a lot @JayjeetAtGithub! please take a look at the comments


# test --with-dependencies flag
popper run test
popper run --with-dependencies test
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we check the output in order to ensure that only dependent actions get executed? Also, we can skip the previous popper run test as that functionality is being checked somewhere else

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ivotron Are we required to match the output with a hardcoded output ? If thats the case, we might use --dry-run flag.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, using --dry-run would speedup the execution. No need to compare to hardcoded strings though. We could run with and without --with-dependencies and ensure that the latter is including dependent actions in the execution

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ivotron On running without --with-dependencies, the actions defined in the needs attribute of the referenced action will get executed ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

no, only the given action

@@ -157,7 +157,7 @@ def instantiate_runners(self):
a, self.workspace, self.env,
self.dry_run)

def run(self, action_name=None, reuse=False, parallel=False):
def run(self, action_name=None, with_dependencies=False):
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can simplify the implementation of this feature by extending the Workfow.get_stages() function so that it can be given an action where to start generating stages. In this way, the logic of running a workflow stays the same (i.e. no modifications would be needed).

@JayjeetAtGithub
Copy link
Collaborator Author

@ivotron Please have a look at the approach.

if action_name:
self.wf.get_runner(action_name).run(reuse)
if self.action_name:
if self.with_dependencies:
Copy link
Collaborator

Choose a reason for hiding this comment

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

looks like this condition is doing the same as the outer else below (lines 195-196), right? Can we instead remove it?

@@ -79,25 +79,35 @@ def get_stages(self):
'next', set()))
current_stage = next_stage

def complete_graph(self):
def complete_graph(self, action_name=None):
Copy link
Collaborator

@ivotron ivotron May 23, 2019

Choose a reason for hiding this comment

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

can we update the docstring so it explains the purpose of this new parameter? Is this new parameter restricting how deep the completion goes? I feel like the code is a bit difficult to parse.

Conceptually, it might be more readable to let the complete_graph work on the complete graph and then implement any sort of filtering or ad-hoc graph traversal separately. So in this case, we could leave the complete_graph function as it was before, and instead add an optional action parameter to the get_stages method that indicates that we want to traverse the graph from the root to the given action (as opposed to going from the root to the end of the graph when this action parameter is None), ignoring any nodes that are not a direct dependency to this given action

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay

@ivotron ivotron mentioned this pull request May 24, 2019
@JayjeetAtGithub
Copy link
Collaborator Author

JayjeetAtGithub commented May 29, 2019

@ivotron Please have a look ! I have followed the approach as of filtering actions but now with dependencies.

@ivotron ivotron merged commit a65509a into getpopper:master May 30, 2019
@ivotron
Copy link
Collaborator

ivotron commented May 30, 2019

thanks a lot!

ivotron pushed a commit that referenced this pull request May 24, 2020
Adds ability to run an action and all of its dependencies (up to that action)

fixes #625
ivotron pushed a commit that referenced this pull request May 25, 2020
Adds ability to run an action and all of its dependencies (up to that action)

fixes #625
ivotron pushed a commit that referenced this pull request May 25, 2020
Adds ability to run an action and all of its dependencies (up to that action)

fixes #625
ivotron pushed a commit that referenced this pull request May 25, 2020
Adds ability to run an action and all of its dependencies (up to that action)

fixes #625
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants