-
Notifications
You must be signed in to change notification settings - Fork 10
WIP: publish files for discussion #24
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
base: trunk
Are you sure you want to change the base?
Conversation
runner validation policy After the JSON was properly validated and parsed, the resource needs have been collected, the steps are run. So: We have been discussing this on slack for a while now, pr #18 reflected that with a more offensive approach to exceptions. But while approaching other steps I begun to wonder:
As an idea: |
@@ -7,6 +7,7 @@ | |||
|
|||
class DownloadWordPressStepRunner extends InstallAssetStepRunner { | |||
|
|||
//TODO why is this download and not install? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Installation is a separate step. The developer may not want to run the installation wizard automatically.
@@ -10,6 +10,8 @@ | |||
|
|||
|
|||
class InstallAssetStepRunner extends BaseStepRunner { | |||
// TODO following the github API - this is not an exposed step - maybe it's internals should be used by other steps and not extended? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the same thought, just couldn't think of the right names for things.
} | ||
function run(MkdirStep $input) { | ||
$path = $input->path; | ||
$this->fileManager->assertNoFileExists($path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line obscures that $path
is relative to the document root and needs to be resolved.
As a rule of thumb, steps are atomic commands that should always fail when they can't accomplish the task. It's up to the runner to decide what to do with that failure.
Let's start with just enough feedback for the developer to debug their issue. Then we'll improve the error messages in any place that will confuse the API consumers.
Here's the entry to the rabbit hole: WordPress/wordpress-playground#605 tl;dr – some failures may not be worth crashing the entire Blueprint execution pipeline. I may have an optional plugin or a content export file and I'm fine if they can't be set up.
The runner could still produce warnings when a non-critical step fails.
It's up to the developers to decide, they would explicitly mark specific steps in their Blueprints as "okay to fail".
What do you mean by a tree? I think of it as a linear flow like a Dockerfile.
For now, any state that was left on the disk after the last successful step.
Not in v1.
What do you mean? I don't understand this question.
The steps shouldn't be concerned with that at all. A step only has an input and an output, it doesn't care about the resolution logic or execution order.
It will take some time to get there, but it would be a great developer tool! |
Ok. Thanks for the details answers and links. This allows me to continue adding tests. Huzzah! I now see the heuristic I should take.
I see this an a issue that should be addressed rather quickly. Since, this means after a blueprint fails somewhere in the middle. It can't be rerun easily. I'd imagine achieving effective idempotency could be a goal here.
I run a blueprint once. It gets me a bunch of resources. But fails at the very last moment. I run it the second time and the resources that were procured are already there. If not, we get the worst of both world - on one hand, the changes of steps are not reverted, and on the other - the resource streams have to be prepared anew. |
+1
Aha! The runtime will be responsible for caching the downloads. Network transfer should only happen on cache miss. |
🚧 Work in progress 🚧
uploaded for ease of discussion only, even if parts of this will become the basis for changes to the codebase it will be done in a separate PR
Issues to discuss: