)]}'
{"ceilometer/api/controllers/v2.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"2f0e483cda4f9f85fd137465b2f3295915368d78","unresolved":false,"context_lines":[{"line_number":500,"context_line":"        if len(sources) \u003d\u003d 1:"},{"line_number":501,"context_line":"            def_source \u003d sources.pop()"},{"line_number":502,"context_line":"        elif len(sources) \u003e 1:"},{"line_number":503,"context_line":"            raise wsme.exc.InvalidInput(\u0027source\u0027, sources.pop(),"},{"line_number":504,"context_line":"                                        \u0027can not post Samples %s\u0027 %"},{"line_number":505,"context_line":"                                        \u0027with different sources\u0027)"},{"line_number":506,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAQn%2F%2Fjgc%3D","line":503,"updated":"2013-07-29 10:27:43.000000000","message":"We could. I would a code comment we just don\u0027t want to do it yet.","commit_id":"c508d16d62acb8bce7dd3a8525119b367e807167"}],"tests/api/v2/test_post_samples_scenarios.py":[{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"59ca520ad83876de20a422a10332434499384955","unresolved":false,"context_lines":[{"line_number":22,"context_line":"import datetime"},{"line_number":23,"context_line":"import logging"},{"line_number":24,"context_line":"import testscenarios"},{"line_number":25,"context_line":"import pprint"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from oslo.config import cfg"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAQn%2F%2FW6w%3D","line":25,"updated":"2013-08-01 13:25:28.000000000","message":"alphabetical order","commit_id":"5430d165f36ac1c4d94fa8039f7ed7a87e62ed20"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"4c69bb58e6b846a769de2e1d8ab24b2ef2777394","unresolved":false,"context_lines":[{"line_number":22,"context_line":"import datetime"},{"line_number":23,"context_line":"import logging"},{"line_number":24,"context_line":"import testscenarios"},{"line_number":25,"context_line":"import pprint"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from oslo.config import cfg"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAQn%2F%2FWCQ%3D","line":25,"in_reply_to":"AAAAQn%2F%2FW6w%3D","updated":"2013-08-01 17:36:20.000000000","message":"Done","commit_id":"5430d165f36ac1c4d94fa8039f7ed7a87e62ed20"},{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"59ca520ad83876de20a422a10332434499384955","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        self.published \u003d []"},{"line_number":59,"context_line":"        self.stubs.Set(rpc, \u0027cast\u0027, self.faux_cast)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _find_sample_in_pipeline(self, sample, idx_msg\u003dNone, idx_sample\u003dNone):"},{"line_number":62,"context_line":"        published_samples \u003d []"},{"line_number":63,"context_line":"        for i, p in enumerate(self.published):"},{"line_number":64,"context_line":"            if idx_msg is None or idx_msg \u003d\u003d i:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAQn%2F%2FW6U%3D","line":61,"updated":"2013-08-01 13:25:28.000000000","message":"Hmm, I\u0027m not really a fan of this sort of code in unit tests. Are we testing the test or the production code?\n\nCan\u0027t we simplify the test to just check the modified function? Mock out what\u0027s not needed?","commit_id":"5430d165f36ac1c4d94fa8039f7ed7a87e62ed20"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"e100385fd3d0d6334dcbb00eae60da3086b22fe9","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        self.published \u003d []"},{"line_number":59,"context_line":"        self.stubs.Set(rpc, \u0027cast\u0027, self.faux_cast)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _find_sample_in_pipeline(self, sample, idx_msg\u003dNone, idx_sample\u003dNone):"},{"line_number":62,"context_line":"        published_samples \u003d []"},{"line_number":63,"context_line":"        for i, p in enumerate(self.published):"},{"line_number":64,"context_line":"            if idx_msg is None or idx_msg \u003d\u003d i:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAQn%2F%2FWog%3D","line":61,"in_reply_to":"AAAAQn%2F%2FW6U%3D","updated":"2013-08-01 14:51:40.000000000","message":"The rpc.cast is already mocked, this is a helper to check if a sample has been publisher in the correct order. I agree it is not really sexy, but I need this for the test   test_multiple_project_id_and_admin because I can\u0027t predict where the sample is.\n\nBut actually I\u0027m waiting for this: https://review.openstack.org/#/c/39068/\n\nIt remove the source arg of the PublisherContext, this will simplify the API part, and make the rpc.cast predictable in all tests.\n\nI have plan to remove this helper, and just cleanup the \u0027message_signature\u0027 of sample in \u0027faux_cast\u0027 mock.","commit_id":"5430d165f36ac1c4d94fa8039f7ed7a87e62ed20"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"4c69bb58e6b846a769de2e1d8ab24b2ef2777394","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        self.published \u003d []"},{"line_number":59,"context_line":"        self.stubs.Set(rpc, \u0027cast\u0027, self.faux_cast)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _find_sample_in_pipeline(self, sample, idx_msg\u003dNone, idx_sample\u003dNone):"},{"line_number":62,"context_line":"        published_samples \u003d []"},{"line_number":63,"context_line":"        for i, p in enumerate(self.published):"},{"line_number":64,"context_line":"            if idx_msg is None or idx_msg \u003d\u003d i:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAQn%2F%2FWCM%3D","line":61,"in_reply_to":"AAAAQn%2F%2FWog%3D","updated":"2013-08-01 17:36:20.000000000","message":"Done","commit_id":"5430d165f36ac1c4d94fa8039f7ed7a87e62ed20"},{"author":{"_account_id":7993,"name":"Frédéric FAURE","email":"frederic.faure@ysance.com","username":"frederic-faure"},"change_message_id":"0be58bad723b8c75faaaf5636970b9e44c7e9b1b","unresolved":false,"context_lines":[{"line_number":219,"context_line":"                              headers\u003d{\"X-Roles\": \"admin\"})"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        self.assertEquals(data.status_int, 200)"},{"line_number":222,"context_line":"        self.assertEquals(len(self.published), 4)"},{"line_number":223,"context_line":"        for x, s in enumerate(s1):"},{"line_number":224,"context_line":"            # source is modified to include the project_id."},{"line_number":225,"context_line":"            s[\u0027source\u0027] \u003d \u0027%s:%s\u0027 % (s[\u0027project_id\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAQn%2F%2Fa7c%3D","line":222,"updated":"2013-07-31 13:59:38.000000000","message":"4? Should the expected number of items in the self.published be 1 in terms of msg or 2 in terms of samples (I don\u0027t know if the msg in faux_cast passed into \"self.published.append((topic, msg))\" is the list of samples or a single sample extracted from the list).\n\nWhy testing the size only in this test and the one which leads to an error (test_wrong_project_id \u003d\u003e len\u003d0)? Doesn\u0027t make sense to test the size on each test to be sure having the expected number of \"samples/list of samples\"?\n\nBy the way when calling _find_sample_in_pipeline, you always set in these tests idx_msg to 0 or None. In which case should it be used with a value \u003e\u003d1?\n\nWhen POSTing a list of samples, are you expecting each of them having a unique \"message_id\" or a \"message_id\" shared between all the samples in a given POST?","commit_id":"5430d165f36ac1c4d94fa8039f7ed7a87e62ed20"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"b8fe998384a39c952542d0fbf36f2ef8bf9fc9f0","unresolved":false,"context_lines":[{"line_number":219,"context_line":"                              headers\u003d{\"X-Roles\": \"admin\"})"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        self.assertEquals(data.status_int, 200)"},{"line_number":222,"context_line":"        self.assertEquals(len(self.published), 4)"},{"line_number":223,"context_line":"        for x, s in enumerate(s1):"},{"line_number":224,"context_line":"            # source is modified to include the project_id."},{"line_number":225,"context_line":"            s[\u0027source\u0027] \u003d \u0027%s:%s\u0027 % (s[\u0027project_id\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAQn%2F%2Favs%3D","line":222,"in_reply_to":"AAAAQn%2F%2Fa7c%3D","updated":"2013-07-31 14:37:32.000000000","message":"Because there are two pipelines configured by default (a normal one and a cpu_util transformer one), that means each message are duplicated to be handle by each pipeline (the transformer don\u0027t publish any sample). A message can have many samples. Seconds, this is the admin case, admin can publish on different project. Here, the generated source are \n35b17138-b364-4e6a-a131-8f3099c5be68:closedstack and 4af38dca-f6fc-11e2-94f5-14dae9283f29:closedstack, actually the PublisherContext is per source I need to build two messages, one per source. So we have 2 messages sent in two pipelines, the number of published messages is 4. But only two of them have my published samples\n\nI don\u0027t check this in other tests because this is always two. the first message always have all samples, the rest of the test check the content of this samples.\nthe second message is always empty.\n\nset the message_id is forbidden in the API, it is generated by ceilometer.\nI have proposed a changeset for that: https://review.openstack.org/#/c/39033/\n\nNext step is to modify the PublishContext to return the generated message_id\nThen we can return it in the post-sample API too.","commit_id":"5430d165f36ac1c4d94fa8039f7ed7a87e62ed20"},{"author":{"_account_id":7993,"name":"Frédéric FAURE","email":"frederic.faure@ysance.com","username":"frederic-faure"},"change_message_id":"8ce2932b4b35ecbde3131b27c96e001afebddcaa","unresolved":false,"context_lines":[{"line_number":219,"context_line":"                              headers\u003d{\"X-Roles\": \"admin\"})"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        self.assertEquals(data.status_int, 200)"},{"line_number":222,"context_line":"        self.assertEquals(len(self.published), 4)"},{"line_number":223,"context_line":"        for x, s in enumerate(s1):"},{"line_number":224,"context_line":"            # source is modified to include the project_id."},{"line_number":225,"context_line":"            s[\u0027source\u0027] \u003d \u0027%s:%s\u0027 % (s[\u0027project_id\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAQn%2F%2FZzI%3D","line":222,"in_reply_to":"AAAAQn%2F%2FatI%3D","updated":"2013-07-31 18:26:07.000000000","message":"OK! :o)","commit_id":"5430d165f36ac1c4d94fa8039f7ed7a87e62ed20"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"9a1400307c7327018831c8da46a62c51497dbb50","unresolved":false,"context_lines":[{"line_number":219,"context_line":"                              headers\u003d{\"X-Roles\": \"admin\"})"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        self.assertEquals(data.status_int, 200)"},{"line_number":222,"context_line":"        self.assertEquals(len(self.published), 4)"},{"line_number":223,"context_line":"        for x, s in enumerate(s1):"},{"line_number":224,"context_line":"            # source is modified to include the project_id."},{"line_number":225,"context_line":"            s[\u0027source\u0027] \u003d \u0027%s:%s\u0027 % (s[\u0027project_id\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAQn%2F%2FatI%3D","line":222,"in_reply_to":"AAAAQn%2F%2Favs%3D","updated":"2013-07-31 14:40:06.000000000","message":"It seems publishing a message without samples is not optimal, I will propose a fix for that and fix this review to have 2 here :)","commit_id":"5430d165f36ac1c4d94fa8039f7ed7a87e62ed20"},{"author":{"_account_id":7993,"name":"Frédéric FAURE","email":"frederic.faure@ysance.com","username":"frederic-faure"},"change_message_id":"8ce2932b4b35ecbde3131b27c96e001afebddcaa","unresolved":false,"context_lines":[{"line_number":219,"context_line":"                              headers\u003d{\"X-Roles\": \"admin\"})"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        self.assertEquals(data.status_int, 200)"},{"line_number":222,"context_line":"        self.assertEquals(len(self.published), 4)"},{"line_number":223,"context_line":"        for x, s in enumerate(s1):"},{"line_number":224,"context_line":"            # source is modified to include the project_id."},{"line_number":225,"context_line":"            s[\u0027source\u0027] \u003d \u0027%s:%s\u0027 % (s[\u0027project_id\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAQn%2F%2FZzM%3D","line":222,"in_reply_to":"AAAAQn%2F%2Favs%3D","updated":"2013-07-31 18:26:07.000000000","message":"OK thx for the explanation: I didn\u0027t noticed the second pipeline + I forgot the PublisherContext per source \u003d\u003e now I understand! :o) So with the same source in the samples, you should have only one message (containing 2 samples) x 2 pipelines \u003d 2 messages published \"as always\". I thought that the message_id was an identifier for the sample, but it is actually an identifier for the transport unit. Interesting.\n\n\u003e\u003e\u003e No need for a \"sample_id\" at all?\n\n-----------------------------------------\n\nmessage_id forbidden in the API \u003d\u003e +1 reviewed! :o)\n\n-----------------------------------------\n\n\"Next step is to modify the PublishContext to return the generated message_id\" \u003d\u003e Nice!\n\n\u003e\u003e\u003e When messages are duplicated on multiple pipelines (I suppose to deal with multiple usages: pipeline on UDP for simple monitoring, pipeline on TCP for messages dedicated to billing, ...) \u003d\u003e message_id is duplicated too? Or another message_id is generated on each pipeline? In case of one generated message_id per pipeline, what to send back to the API? An array of message_id for each sample?","commit_id":"5430d165f36ac1c4d94fa8039f7ed7a87e62ed20"}]}
