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

add fetchRevisionshook to deploy and activate pipelines #323

Merged
merged 1 commit into from
Dec 30, 2015

Conversation

sethpollack
Copy link
Contributor

No description provided.

@lukemelia
Copy link
Contributor

I don't necessarily disagree with the position you've placed this hook, but what is the rationale for where in the pipeline it should be added?

@sethpollack
Copy link
Contributor Author

I based it off #209

@lukemelia
Copy link
Contributor

I'm +1 on this. I'd like the other team members to weigh in.

@ghedamat
Copy link
Collaborator

ghedamat commented Dec 4, 2015

Curiosity, what is the use case?

I wonder if it would be better to call fetchRevision after activate hooks so you get the most recent data?

@sethpollack
Copy link
Contributor Author

@ghedamat the activate hook will supply the activated revision key so you will still have everything you need. Also you may want to check for the revision before you try to activate it.

@sethpollack
Copy link
Contributor Author

Also in my case I want to get the previously activated revision so I can generate a change-log. Once activate runs I wont have that info anymore.

@ghedamat
Copy link
Collaborator

ghedamat commented Dec 4, 2015

@sethpollack I figured that was the case

@lukemelia I think this is an example where order of hooks might be debatable (by other plugin authors)

but I'm +1 to merge

@LevelbossMike
Copy link
Member

I am 👍 on this. Most likely it's enough to have fetchRevisions run directly before activation as the rest of the hooks shouldn't affect the revisions at all.

@duizendnegen
Copy link
Contributor

We also supported previousActivatedRevision in Redis, azure-tables - what's the use case besides generating the diff?I don't mind the change, but I would want to keep an eye on the actual impact

On Fri, Dec 4, 2015 at 7:49 PM, Michael Klein notifications@github.com
wrote:

I am 👍 on this.

Reply to this email directly or view it on GitHub:
#323 (comment)

@LevelbossMike
Copy link
Member

The reason behind that was that you most often need information about the deployed revisions when doing an activation (e.g. for displaying changes or checking if if the revision to activate is present at all). I already did a pr for this a while ago because I thought merging the revision information onto the deployment context was a good idea to check for available revisions in the s3-index plugin. We decided against that as we thought that a private function in the plugin works as well.

As it turns out now it's also useful for regular users to access "deployed revisions" information (for creating changesets, creating a message if an activation is a new deployment or a rollback etc.). When thinking about it the state of 'available revisions' definitely is also part of the whole 'deployment context'. I am looking forward to this change 👍

I think we should have as much information as possible available on the deployment context just to make it easy for users to customize. Also finding the previous activated revisions (in a private plugin method) most likely involves fetching the deployed revisions so I don't think it hurts to put this information on the deployment context as well (as we are requesting the information internally anyway).

@duizendnegen
Copy link
Contributor

I think we should have as little information as possible available on the deployment context - we should do our best to support the use cases in a generic way, but not give any additional information - every piece of information should be seen as a burden you have to support.

I'm 👍 on the approach and implementation, but I'm a little skeptical if we don't see a use case that we otherwise couldn't cover, or a group of existing use cases which are easier/more intuitive to tackle generically.

With that, I'll leave it to you ladies & gents to make a decision on this.

@lukemelia
Copy link
Contributor

FYI, there has been some more back and forth about among core contributors off-Github and we should have a decision and plan very soon.

@sethpollack
Copy link
Contributor Author

Ok awesome, thanks!

@lukemelia
Copy link
Contributor

@sethpollack et al. We have decided to update pipelines to add a new hook fetchInitialRevisions and to include fetchRevisions in some pipelines where it isn't now.

The new fetchInitialRevisions hook will be added at the following locations:

  • deploy pipeline: inserted before willUpload
  • activate pipeline: inserted before willActivate

The fetchRevisions hook will be added at the following locations:

  • deploy pipeline: before didActivate if running with --activate or before didDeploy if running without --activate
  • activate pipeline: before didActivate

fetchInitialRevisions would populate revisionData.initial on the context, and fetchRevisions would populate revisionData as plugins do today. This should provide enough richness for plugins to implement changelogs, clear notifications, etc.

@sethpollack Are you interested in implementing these changes?

@sethpollack
Copy link
Contributor Author

@lukemelia Yeah, I can implement it.

@duizendnegen
Copy link
Contributor

Ideally there'd be some legacy check where ECD checks whether plugins
implement fetchRevisions but not fetchInitialRevisions - it would then wrap
the secondary promise to fill revisionData.initial as detailed above, with
a warning
The alternative scenario is working with all plugin authors to move every
plugin that implements the fetchRevisions hook and update it - not
unfeasible, there'll be about 10 at maximum I assume

On Tue, 15 Dec 2015 16:10 Seth Pollack notifications@github.com wrote:

@lukemelia https://github.com/lukemelia Yeah, I can implement it.


Reply to this email directly or view it on GitHub
#323 (comment)
.

@lukemelia
Copy link
Contributor

@duizendnegen The only think that would suffer if fetchInitialRevisions is plugins which rely on it (of which there are zero so far), so I think there will be some natural time delay and natural peer pressure that will help address this via your "alternative" scenario.

@lukemelia
Copy link
Contributor

@sethpollack Thanks for your work on this and your patience. Can you squash this into one commit, please?

@sethpollack
Copy link
Contributor Author

@lukemelia done!

lukemelia added a commit that referenced this pull request Dec 30, 2015
add `fetchRevisions`hook to deploy and activate pipelines
@lukemelia lukemelia merged commit 5d87368 into ember-cli-deploy:master Dec 30, 2015
@lukemelia
Copy link
Contributor

Thanks for your work and on this @sethpollack!

@sethpollack
Copy link
Contributor Author

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

5 participants