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
Added prior state to app.update event #330
Conversation
Hey shashidharatd! Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you've already signed the CLA. |
We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/87921292. |
Hi @shashidharatd, We noticed that you used the We have enabled a Sequel plugin that keeps track of previous changes on the model from the previous update. Could you possibly use Thanks, |
We already tested the idea of using dirty plugin, but there is a problem in one scenario. Instead of Thanks |
Hi @shashidharatd & @AmitRoushan We are uncomfortable with an approach that uses meta-programming to dynamically update the app object. We would prefer to see an approach that is able to gather the information about the changeset and pass it into the event repository. Additionally, we are now using this repository in multiple places, so the way we want it to work may be in a bit of flux at this time: https://github.com/cloudfoundry/cloud_controller_ng/blob/master/app/handlers/processes_handler.rb#L151 |
51d1500
to
4640d52
Compare
As per comment, now we are not using meta-programming. We have added a new method prior_state in Please review and let us know if any things missed or any concerns Thanks |
Hi @shashidharatd and @AmitRoushan, We think the changes look good. We would like to see some unit tests around the Thanks, |
Solution to the story :- 'As a CF api consumer I expect that /v2/events returns prior state as a part of its metadata for all app.update events' [#74624460] After this commit, /v2/events will contain prior state as part of metadata for all app.update event.
4640d52
to
400dead
Compare
Added testcases for prior_state function. Testcases are covering following scenarios: 1. when 'STOPPED' app is 'STARTED'. 2. when app is 'STARTED' which is not staged and not started. 3. when staging is pending and app is restaged. 4. prior state for different state changes.
f89c9a8
to
50de285
Compare
Hi, Test cases are covering following scenarios:
Also we have added the comments in test cases for scenarios. Please let us know if this is sufficient. Thanks, |
Closing due to inactivity. This is a good idea, however, there are so many other changes that happen to an app besides START and STOP. |
Solution to the story :- 'As a CF api consumer I expect that /v2/events returns prior state as a part of its metadata for all app.update events'
[#74624460]
After this commit, /v2/events will contain prior state as part of metadata for all app.update event.
For eg...