)]}'
{"ceilometer/storage/impl_mongodb.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"a2afae31cbcdf27a0754968a37a5a0c024c2e7a1","unresolved":false,"context_lines":[{"line_number":829,"context_line":"    def record_alarm_change(self, alarm_change):"},{"line_number":830,"context_line":"        \"\"\"Record alarm change event."},{"line_number":831,"context_line":"        \"\"\""},{"line_number":832,"context_line":"        alarm_change[\u0027event_id\u0027] \u003d str(uuid.uuid4())"},{"line_number":833,"context_line":"        self.db.alarm_history.insert(alarm_change)"},{"line_number":834,"context_line":""},{"line_number":835,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAASn%2F%2F41Q%3D","line":832,"updated":"2013-08-28 11:51:47.000000000","message":"If it\u0027s exposed in the API, it shouldn\u0027t be generated by the storage driver.","commit_id":"37e1ad889cef95a3b141c6aebbb3f75ff5d35b58"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"fab55a1669c0ae822779b70803a871a63de88163","unresolved":false,"context_lines":[{"line_number":829,"context_line":"    def record_alarm_change(self, alarm_change):"},{"line_number":830,"context_line":"        \"\"\"Record alarm change event."},{"line_number":831,"context_line":"        \"\"\""},{"line_number":832,"context_line":"        alarm_change[\u0027event_id\u0027] \u003d str(uuid.uuid4())"},{"line_number":833,"context_line":"        self.db.alarm_history.insert(alarm_change)"},{"line_number":834,"context_line":""},{"line_number":835,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAASn%2F%2F4y8%3D","line":832,"in_reply_to":"AAAASn%2F%2F41Q%3D","updated":"2013-08-28 11:58:40.000000000","message":"Yikes, that\u0027s what we do currently for alarm IDs:\n\n- https://github.com/openstack/ceilometer/blob/master/ceilometer/storage/impl_mongodb.py#L791\n- https://github.com/openstack/ceilometer/blob/master/ceilometer/storage/impl_sqlalchemy.py#L577\n\nBTW the motivation for adding this event_id is just to facilitate pagination (i.e. to act as a marker attribute).","commit_id":"37e1ad889cef95a3b141c6aebbb3f75ff5d35b58"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"8d905a6377592b25873a92dcdbc99b08f9635d21","unresolved":false,"context_lines":[{"line_number":829,"context_line":"    def record_alarm_change(self, alarm_change):"},{"line_number":830,"context_line":"        \"\"\"Record alarm change event."},{"line_number":831,"context_line":"        \"\"\""},{"line_number":832,"context_line":"        alarm_change[\u0027event_id\u0027] \u003d str(uuid.uuid4())"},{"line_number":833,"context_line":"        self.db.alarm_history.insert(alarm_change)"},{"line_number":834,"context_line":""},{"line_number":835,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAASn%2F%2F4PM%3D","line":832,"in_reply_to":"AAAASn%2F%2F4dg%3D","updated":"2013-08-28 14:21:59.000000000","message":"I was suggesting  \"/alarm/\u003calarm-id\u003e/changes as opposed to /alarm/\u003calarm-id\u003e/history\". It seems more REST and about collections to me that way.\n\nBut I admit renaming event_id to change_id isn\u0027t bad at all, I didn\u0027t think about it.","commit_id":"37e1ad889cef95a3b141c6aebbb3f75ff5d35b58"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"d58c745deef4e7d9b493b257c0c151420006429d","unresolved":false,"context_lines":[{"line_number":829,"context_line":"    def record_alarm_change(self, alarm_change):"},{"line_number":830,"context_line":"        \"\"\"Record alarm change event."},{"line_number":831,"context_line":"        \"\"\""},{"line_number":832,"context_line":"        alarm_change[\u0027event_id\u0027] \u003d str(uuid.uuid4())"},{"line_number":833,"context_line":"        self.db.alarm_history.insert(alarm_change)"},{"line_number":834,"context_line":""},{"line_number":835,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAASn%2F%2F4dg%3D","line":832,"in_reply_to":"AAAASn%2F%2F4l4%3D","updated":"2013-08-28 13:20:24.000000000","message":"Makes sense, changing the latest patch set to generate the event ID in the API layer instead.\n\nAgreed the alarm IDs should be changed similarly.\n\nWhere you also suggesting that the path is modified to be /alarm/\u003calarm-id\u003e/changes as opposed to /alarm/\u003calarm-id\u003e/history, or that event_id is replaced with change_id, or both?","commit_id":"37e1ad889cef95a3b141c6aebbb3f75ff5d35b58"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"dc6cb1df2118e50552e5464a99d53ac7b5070451","unresolved":false,"context_lines":[{"line_number":829,"context_line":"    def record_alarm_change(self, alarm_change):"},{"line_number":830,"context_line":"        \"\"\"Record alarm change event."},{"line_number":831,"context_line":"        \"\"\""},{"line_number":832,"context_line":"        alarm_change[\u0027event_id\u0027] \u003d str(uuid.uuid4())"},{"line_number":833,"context_line":"        self.db.alarm_history.insert(alarm_change)"},{"line_number":834,"context_line":""},{"line_number":835,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAASn%2F%2F4l4%3D","line":832,"in_reply_to":"AAAASn%2F%2F4y8%3D","updated":"2013-08-28 12:47:22.000000000","message":"Well it seems fair to have an event_id, because we could also want to retrieve the change individually via:\n\nGET /alarm/\u003calarm-id\u003e/history/\u003cchange-id\u003e\n\n(Makes me think having changes instead of history may be better btw?)\n\n\nAnd as you say it can ease pagination. But as soon it\u0027s exposed via the API, it\u0027s not an internal detail of the storage driver, but something that should be handled the same way by all drivers IMHO.\n\n(we should fix this elsewhere too then :-)","commit_id":"37e1ad889cef95a3b141c6aebbb3f75ff5d35b58"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"2c2d767ec87a5b752e5b205deae065f36c836aa8","unresolved":false,"context_lines":[{"line_number":834,"context_line":"        \"\"\""},{"line_number":835,"context_line":"        self.db.alarm.remove({\u0027alarm_id\u0027: alarm_id})"},{"line_number":836,"context_line":""},{"line_number":837,"context_line":"    def get_alarm_changes(self, alarm_id, on_behalf_of):"},{"line_number":838,"context_line":"        \"\"\"Yields list of AlarmChanges describing alarm history"},{"line_number":839,"context_line":"        :param alarm_id: ID of alarm to return changes for"},{"line_number":840,"context_line":"        :param on_behalf_of: ID of tenant to scope changes query (None for"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2FgVM%3D","line":837,"updated":"2013-09-04 00:30:29.000000000","message":"I don\u0027t see any storage driver-level tests for these methods. Am I just missing them? (I looked for \"history\" in tests/storage/*.py)","commit_id":"7460c98f03cd38da88b1d2aaef8077802904d8df"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"18fde875f38336bfd71289a7b0cba86c1d16a965","unresolved":false,"context_lines":[{"line_number":834,"context_line":"        \"\"\""},{"line_number":835,"context_line":"        self.db.alarm.remove({\u0027alarm_id\u0027: alarm_id})"},{"line_number":836,"context_line":""},{"line_number":837,"context_line":"    def get_alarm_changes(self, alarm_id, on_behalf_of):"},{"line_number":838,"context_line":"        \"\"\"Yields list of AlarmChanges describing alarm history"},{"line_number":839,"context_line":"        :param alarm_id: ID of alarm to return changes for"},{"line_number":840,"context_line":"        :param on_behalf_of: ID of tenant to scope changes query (None for"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2FeGQ%3D","line":837,"in_reply_to":"AAAASn%2F%2FgVM%3D","updated":"2013-09-04 12:57:48.000000000","message":"Well the intention was that the test coverage is provided by the the alarm scenario tests which landed via the previous patch in this series.\n\n(i.e. as each storage driver is filled out, the test coverage from the scenario test comes into play ... before the storage driver change landed, the scenario tests are effectively skipped by virtue of the NotImplementedError being raised)","commit_id":"7460c98f03cd38da88b1d2aaef8077802904d8df"},{"author":{"_account_id":6682,"name":"Stas Maksimov","email":"maksimov@gmail.com","username":"maksimov"},"change_message_id":"dee0859ce2099afc7ce0397734836e253b3ba6e9","unresolved":false,"context_lines":[{"line_number":841,"context_line":"                             administrative user, indicating all projects)"},{"line_number":842,"context_line":"        \"\"\""},{"line_number":843,"context_line":"        q \u003d dict(alarm_id\u003dalarm_id)"},{"line_number":844,"context_line":"        if on_behalf_of is not None:"},{"line_number":845,"context_line":"            q[\u0027on_behalf_of\u0027] \u003d on_behalf_of"},{"line_number":846,"context_line":""},{"line_number":847,"context_line":"        sort \u003d [(\"timestamp\", pymongo.DESCENDING)]"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2FjvU%3D","line":844,"updated":"2013-09-03 14:32:42.000000000","message":"\u0027if on_behalf_of:\u0027 looks a bit shorter :-)","commit_id":"7460c98f03cd38da88b1d2aaef8077802904d8df"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"2c2d767ec87a5b752e5b205deae065f36c836aa8","unresolved":false,"context_lines":[{"line_number":844,"context_line":"        if on_behalf_of is not None:"},{"line_number":845,"context_line":"            q[\u0027on_behalf_of\u0027] \u003d on_behalf_of"},{"line_number":846,"context_line":""},{"line_number":847,"context_line":"        sort \u003d [(\"timestamp\", pymongo.DESCENDING)]"},{"line_number":848,"context_line":"        for alarm_change in self.db.alarm_history.find(q, sort\u003dsort):"},{"line_number":849,"context_line":"            ac \u003d {}"},{"line_number":850,"context_line":"            ac.update(alarm_change)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2FgW8%3D","line":847,"updated":"2013-09-04 00:30:29.000000000","message":"Are you using the descending sort to return the most recent changes first? Is that part of the spec for the method? (The docstring in the base class doesn\u0027t say, so we should make sure it does at some point.)\n\nI don\u0027t see any tests for the sort order -- none of the tests I found added more than one change to a given alarm, AFAICT. I\u0027m new to this code, though, so maybe I\u0027m missing it.","commit_id":"7460c98f03cd38da88b1d2aaef8077802904d8df"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"18fde875f38336bfd71289a7b0cba86c1d16a965","unresolved":false,"context_lines":[{"line_number":844,"context_line":"        if on_behalf_of is not None:"},{"line_number":845,"context_line":"            q[\u0027on_behalf_of\u0027] \u003d on_behalf_of"},{"line_number":846,"context_line":""},{"line_number":847,"context_line":"        sort \u003d [(\"timestamp\", pymongo.DESCENDING)]"},{"line_number":848,"context_line":"        for alarm_change in self.db.alarm_history.find(q, sort\u003dsort):"},{"line_number":849,"context_line":"            ac \u003d {}"},{"line_number":850,"context_line":"            ac.update(alarm_change)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2FeFM%3D","line":847,"in_reply_to":"AAAASn%2F%2FgW8%3D","updated":"2013-09-04 12:57:48.000000000","message":"I guess descending timestamp order seemed self-evident for a history API related to events that have a high degree of currency ... i.e. it\u0027s very likely that the most recent state transitions are of most interest to a caller of the API. I can add a statement to the doctsring if that would resolve your concern.\n\nRE test coverage, the order is asserted as a side effect of the alarm scenario tests mentioned above.","commit_id":"7460c98f03cd38da88b1d2aaef8077802904d8df"}]}
