Repository navigation
Add: activate pipeline runs fetchRevisions-hook - #209
LevelbossMike wants to merge 1 commit into
Conversation
|
Generally makes sense but I'm curious what the actual use case is here, since you need to provide a revision key to the activate pipeline anyway. |
|
Most plugins that implement the I think in most scenarios it makes more sense to build on the already implemented
|
It makes sense for the activate pipeline command to run the `fetchRevisions`-hook because activation will depend on the available revisions in most cases. Also the deploy command needs to run `fetchRevisions` because it might want to activate the deployed revision in the deploy step when passing `--activate=true`
644b5bb to
1a42f60
Compare
|
Hmm, I would think the activate hook would optimistically assume it had On Sunday, August 30, 2015, Michael Klein [email protected] wrote:
|
|
Not sure how the pipeline should then know of the error or how to handle it. In the redis case 'current' would simply point to an invalid value and in the S3 case you'd try to copy the content of a non existent file to The only way you'd know that the passed revision to You need a list of valid revisions in the activate hook. When the user passes an invalid revision you need to stop the pipeline and error out. If we run the fetchRevisions hook we will have the available revisions available via the deployment context. If not we would need to implement a method that lists the revisions internally and use that. This is most likely what fetchRevisions uses internally and its much easier and more dry to use the deployment contest written by |
|
Does this mean that in order for the activate hook to work, the user needs to have installed a plugin that implements the fetchRevisions hook? Which means that the plugin developer needs to have understood this conversation we are having right here? Is that going to pose a bit of a disconnect? |
|
No. Activate will just run the fetchRevisions hook so that an index plugin that needs a list of revisions when running If a plugin developer decided to use a private method to get a list of available revisions or does not care about valid revisions the developer can just ignore the fetchRevisions hook and not implement it. |
|
@LevelbossMike I had been thinking that in the redis case, the redis plugin can validate the specified revisionKey by attempting to read from the key and making sure there is something there. In the s3-index case, if the call to I feel comfortable with either approach. I don't think including the fetchRevisions hook is strictly necessary, and think it's strange to depend on it in the |
|
mmh. makes sense. I'll change the s3-index implementation accordingly. |
We don't want to run the fetchRevisions hook in every command that might need it (i.e. `deploy` and `activate`). Plugin authors should implement a private function that fetches revisions if a plugin needs that to function correctly. See ember-cli-deploy/ember-cli-deploy#209 for a discussion about this.
It makes sense for the activate pipeline command to run the
fetchRevisions-hook because activation will depend on theavailable revisions in most cases.