Skip to content

Conversation

@presidento
Copy link
Contributor

The problem was that if both a and b tasks have same pre and post hooks, the a b was extended and deduplicated to pre a post b. But the post hook means that it must be run after the original task.

With this commit there are 3 rules of deduplication:

  • don't touch direct task calls (a a b must remain the same)
  • keep only the first of the same pre-hooked tasks (pre a pre b becomes pre a b)
  • keep only the last of the same post-hooked tasks (a post b post becomes a b post)

Fixes #298

The problem was that if both `a` and `b` tasks have same
`pre` and `post` hooks, the `a b` was extended and
deduplicated to `pre a post b`. But the post hook means that
it must be run after the original task.

With this commit there are 3 rules of deduplication:
- don't touch direct task calls (`a a b` must remain the same)
- keep only the first of the same pre-hooked tasks
- keep only the last of the same post-hooked tasks

Fixes pyinvoke#298

Signed-off-by: Máté Farkas <[email protected]>
@codecov-io
Copy link

Current coverage is 93.23%

Merging #299 into master will increase coverage by +0.03% as of 25368ef

@@            master    #299   diff @@
======================================
  Files           20      20       
  Stmts         1722    1730     +8
  Branches       298     300     +2
  Methods          0       0       
======================================
+ Hit           1605    1613     +8
  Partial         31      31       
  Missed          86      86       

Review entire Coverage Diff as of 25368ef

Powered by Codecov. Updated on successful CI builds.

@bitprophet
Copy link
Member

Thanks. At this time, I do agree with the overall intent here (re: pushing post-hooked dependencies to the last spot possible). Need to scan the actual diff harder but adding to a release milestone.

@presidento
Copy link
Contributor Author

I am happy to fix if you don't think the current implementation is not fit to the actual conception. (We would like to use this functionality.)

@bitprophet bitprophet modified the milestones: 0.13, 0.14 Jun 11, 2016
@mnagy
Copy link

mnagy commented Mar 15, 2017

Hello, any news? I'd really love to see this fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants