Refactoring uncovered conditional task operations
I began the code intended to split the sphinx functionality off into its own plugin. The spaghetti code in this thing was driving me insane so I decided to just go ahead and convert the plugin classes to a far easier to read and manage style. I wanted to make sure that i didn't change the functions of a task in the process of my refactoring so i setup a big array of tests that check the task graph of each task, so i have a baseline of before refactoring and then after refactoring. During the test run, i found something very troubling. The operations of a task change depending on what plugin applies it. meaning the buildPex task that is in the python-pex plugin is very different from the buildPex thats in the python-cli plugin.
Now my personal style says this is a huge no-no. The buildPex task should have the same function no matter what. Thats how we ensure our builds are repeatable. So there should be a buildPex and a buildPex-cli.
What do you want me to do?
Here's what i mean.
Problems I have found the 'buildPex' task changes based on what plugin is installed. Meaning if you include the 'com.linkedin.python-pex' plugin, it has this trait
:buildPex
\--- :buildWheels
5\--- :installProject
55\--- :installTestRequirements
555\--- :installPythonRequirements
5555\--- :installBuildRequirements
55555\--- :installSetupRequirements
555555\--- :installLinks
5555555\--- :createVirtualEnvironment
55555555\--- :pinRequirements
But, if you add the com.linkedin.python-cli plugin, then the 'buildPex' task looks like this
:buildPex
+--- :buildWheels
|4\--- :installProject
|54\--- :installTestRequirements
|554\--- :installPythonRequirements
|5554\--- :installBuildRequirements
|55554\--- :installSetupRequirements
|555554\--- :installLinks
|5555554\--- :createVirtualEnvironment
|55555554\--- :pinRequirements
\--- :generateCompletions
5+--- :installBuildRequirements
5|4\--- :installSetupRequirements
5|54\--- :installLinks
5|554\--- :createVirtualEnvironment
5|5554\--- :pinRequirements
5\--- :installProject
55\--- :installTestRequirements
555\--- :installPythonRequirements
5555\--- :installBuildRequirements
55555\--- :installSetupRequirements
555555\--- :installLinks
5555555\--- :createVirtualEnvironment
55555555\--- :pinRequirements
This happens because the python-cli plugin adds an additional dependency to the task
This issue extends to the package deployable task from pex as well where if you just add the pex plugin, the task looks like
:packageDeployable
\--- :buildPex
5\--- :buildWheels
55\--- :installProject
555\--- :installTestRequirements
5555\--- :installPythonRequirements
55555\--- :installBuildRequirements
555555\--- :installSetupRequirements
5555555\--- :installLinks
55555555\--- :createVirtualEnvironment
555555555\--- :pinRequirements
but after applying the cli task, the task looks like this
:packageDeployable
\--- :buildPex
5+--- :buildWheels
5|4\--- :installProject
5|54\--- :installTestRequirements
5|554\--- :installPythonRequirements
5|5554\--- :installBuildRequirements
5|55554\--- :installSetupRequirements
5|555554\--- :installLinks
5|5555554\--- :createVirtualEnvironment
5|55555554\--- :pinRequirements
5\--- :generateCompletions
55+--- :installBuildRequirements
55|4\--- :installSetupRequirements
55|54\--- :installLinks
55|554\--- :createVirtualEnvironment
55|5554\--- :pinRequirements
55\--- :installProject
555\--- :installTestRequirements
5555\--- :installPythonRequirements
55555\--- :installBuildRequirements
555555\--- :installSetupRequirements
5555555\--- :installLinks
55555555\--- :createVirtualEnvironment
555555555\--- :pinRequirements
the flyer plugin does the same, by adding a depends on the installproject task of setupResourceLink, it changes the way the task operates for the whole stack