)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"3e05c208abf62364a314db2184cc52415124f662","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Pradeep Kilambi \u003cpkilambi@redhat.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-04-08 15:01:12 -0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"WIP: Add support for ArchivePolicy Rule Endpoints"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I8a71f25fe25c4be20d14d695c52fa7cb6efcb14b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9aa53dc9_55b7daf4","line":7,"updated":"2015-04-09 13:19:35.000000000","message":"Just put WIP in the review, not in the commit message. Write a proper one. :)","commit_id":"2fe10e66160a12f6208631e60cda971b312b9bd2"}],"doc/source/rest.j2":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e7098360ed26183de93501782ec12987851003e5","unresolved":false,"context_lines":[{"line_number":148,"context_line":"based on a matched pattern."},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"An Archive policy rule has a few properties: a name to identify it, an archive"},{"line_number":151,"context_line":"policy name that will be used to store and metric pattern to match metric names."},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"An archive policy rule for example could be a mapping to default a medium archive"},{"line_number":154,"context_line":"policy for any volume metric with a pattern say volume.*. When a sample metric"}],"source_content_type":"text/x-jinja2","patch_set":8,"id":"7aaa499b_befd7970","line":151,"updated":"2015-04-10 16:28:18.000000000","message":"missing word after \"store\"?","commit_id":"1931de2235923cb986625517f6b657c7d2a0f9f8"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e7098360ed26183de93501782ec12987851003e5","unresolved":false,"context_lines":[{"line_number":152,"context_line":""},{"line_number":153,"context_line":"An archive policy rule for example could be a mapping to default a medium archive"},{"line_number":154,"context_line":"policy for any volume metric with a pattern say volume.*. When a sample metric"},{"line_number":155,"context_line":"is posted with with a name of volume.size that would match the mattern and the"},{"line_number":156,"context_line":"rule kicks in and sets the archive policy to medium."},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"To create a rule, the following API request should be used:"}],"source_content_type":"text/x-jinja2","patch_set":8,"id":"7aaa499b_1eefcdb1","line":155,"updated":"2015-04-10 16:28:18.000000000","message":"double with\n\ns/mattern/pattern/","commit_id":"1931de2235923cb986625517f6b657c7d2a0f9f8"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e7098360ed26183de93501782ec12987851003e5","unresolved":false,"context_lines":[{"line_number":153,"context_line":"An archive policy rule for example could be a mapping to default a medium archive"},{"line_number":154,"context_line":"policy for any volume metric with a pattern say volume.*. When a sample metric"},{"line_number":155,"context_line":"is posted with with a name of volume.size that would match the mattern and the"},{"line_number":156,"context_line":"rule kicks in and sets the archive policy to medium."},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"To create a rule, the following API request should be used:"},{"line_number":159,"context_line":""}],"source_content_type":"text/x-jinja2","patch_set":8,"id":"7aaa499b_e1512010","line":156,"updated":"2015-04-10 16:28:18.000000000","message":"I feel like there may be some confusion in terminology above.\n\nAt the moment we create a metric by doing a post with a body of:\n\n    {\"archive_policy_name\": \"something\"}\n\nwe get back an id that helps to identify the URI where we will post _measures_: /v1/metric/$UUID/measures.\n\nOr we include metric information when creating a resource (such as an instance).\n\nIs the idea here that when we do the creating of a resource we can use archive policy rules to get default archive policies in the metrics that we request when creating the resource? I think it is only in this context where a metric has a name.","commit_id":"1931de2235923cb986625517f6b657c7d2a0f9f8"},{"author":{"_account_id":6924,"name":"Pradeep Kilambi","email":"pkilambi@redhat.com","username":"pkilambi"},"change_message_id":"cccf553f2a9bc0c5c804cf3cd3063d005c1bb686","unresolved":false,"context_lines":[{"line_number":153,"context_line":"An archive policy rule for example could be a mapping to default a medium archive"},{"line_number":154,"context_line":"policy for any volume metric with a pattern say volume.*. When a sample metric"},{"line_number":155,"context_line":"is posted with with a name of volume.size that would match the mattern and the"},{"line_number":156,"context_line":"rule kicks in and sets the archive policy to medium."},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"To create a rule, the following API request should be used:"},{"line_number":159,"context_line":""}],"source_content_type":"text/x-jinja2","patch_set":8,"id":"7aaa499b_f8baf1bf","line":156,"in_reply_to":"7aaa499b_e1512010","updated":"2015-04-11 14:28:20.000000000","message":"@cdent: I looked at the Metrics model initially and there was name, so i assumed it would be leveraged in the rest api. To your point we dont actually check the name in the controller post call. I think we\u0027ll need to check that and make metric name\u003dNone as an optional value. I also check with jd and he mentioned that the name match is intended to happen on post /v1/metric.","commit_id":"1931de2235923cb986625517f6b657c7d2a0f9f8"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"cf6b63db5b35117d9223357fd13e56b722f1aa85","unresolved":false,"context_lines":[{"line_number":170,"context_line":"It is possible to delete an archive policy rule:"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"{{ scenarios[\u0027delete-archive-policy-rule\u0027][\u0027doc\u0027] }}"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"Resources"},{"line_number":175,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":176,"context_line":""}],"source_content_type":"text/x-jinja2","patch_set":8,"id":"7aaa499b_dc9029ef","line":173,"updated":"2015-04-13 11:19:00.000000000","message":"+ you need to document the pattern format (or put a link to its documentation)","commit_id":"1931de2235923cb986625517f6b657c7d2a0f9f8"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"65994103e5f8d0c604098c860969312754c3a047","unresolved":false,"context_lines":[{"line_number":148,"context_line":"based on a matched pattern."},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"An Archive policy rule has a few properties: a name to identify it, an archive"},{"line_number":151,"context_line":"policy name that will be used to store the policy name and metric pattern to "},{"line_number":152,"context_line":"match metric names."},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"An archive policy rule for example could be a mapping to default a medium archive"}],"source_content_type":"text/x-jinja2","patch_set":9,"id":"7aaa499b_c7226901","line":151,"updated":"2015-04-14 09:57:12.000000000","message":"EOL whitespace alert","commit_id":"8eb25828511286477201e516649bb3ad30625628"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"65994103e5f8d0c604098c860969312754c3a047","unresolved":false,"context_lines":[{"line_number":152,"context_line":"match metric names."},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"An archive policy rule for example could be a mapping to default a medium archive"},{"line_number":155,"context_line":"policy for any volume metric with a pattern say volume.*. When a sample metric"},{"line_number":156,"context_line":"is posted with with a name of volume.size that would match the mattern and the"},{"line_number":157,"context_line":"rule kicks in and sets the archive policy to medium."},{"line_number":158,"context_line":""}],"source_content_type":"text/x-jinja2","patch_set":9,"id":"7aaa499b_677a75f3","line":155,"updated":"2015-04-14 09:57:12.000000000","message":"s/say/matching/","commit_id":"8eb25828511286477201e516649bb3ad30625628"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"65994103e5f8d0c604098c860969312754c3a047","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"An archive policy rule for example could be a mapping to default a medium archive"},{"line_number":155,"context_line":"policy for any volume metric with a pattern say volume.*. When a sample metric"},{"line_number":156,"context_line":"is posted with with a name of volume.size that would match the mattern and the"},{"line_number":157,"context_line":"rule kicks in and sets the archive policy to medium."},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"To create a rule, the following API request should be used:"}],"source_content_type":"text/x-jinja2","patch_set":9,"id":"7aaa499b_e76e852e","line":156,"updated":"2015-04-14 09:57:12.000000000","message":"s/mattern/pattern/","commit_id":"8eb25828511286477201e516649bb3ad30625628"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"65994103e5f8d0c604098c860969312754c3a047","unresolved":false,"context_lines":[{"line_number":154,"context_line":"An archive policy rule for example could be a mapping to default a medium archive"},{"line_number":155,"context_line":"policy for any volume metric with a pattern say volume.*. When a sample metric"},{"line_number":156,"context_line":"is posted with with a name of volume.size that would match the mattern and the"},{"line_number":157,"context_line":"rule kicks in and sets the archive policy to medium."},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"To create a rule, the following API request should be used:"},{"line_number":160,"context_line":""}],"source_content_type":"text/x-jinja2","patch_set":9,"id":"7aaa499b_67615539","line":157,"updated":"2015-04-14 09:57:12.000000000","message":"kicks in is a bit folksy, do we care?","commit_id":"8eb25828511286477201e516649bb3ad30625628"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"d9e94b102b7f3e4db82271e3559b2328e0d85021","unresolved":false,"context_lines":[{"line_number":142,"context_line":"Archive Policy Rule"},{"line_number":143,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"Gnocchi provides a resource type that is called archive_policy_rule. An archive"},{"line_number":146,"context_line":"policy rule defines a mapping between a metric and an archive policy. This gives"},{"line_number":147,"context_line":"users ability to pre-define rules so an archive policy is assigned to metrics"},{"line_number":148,"context_line":"based on a matched pattern."}],"source_content_type":"text/x-jinja2","patch_set":10,"id":"7aaa499b_d430c0a0","line":145,"updated":"2015-04-14 18:55:45.000000000","message":"Don\u0027t use \"resource type\" as it\u0027s not a resource AT ALL. That was a mistake I fixed in another paragraph already.\n\nAlso use `` around archive_policy_rule.","commit_id":"a132ae48f0f909b39bf102044580cc426a7078e3"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"d9e94b102b7f3e4db82271e3559b2328e0d85021","unresolved":false,"context_lines":[{"line_number":147,"context_line":"users ability to pre-define rules so an archive policy is assigned to metrics"},{"line_number":148,"context_line":"based on a matched pattern."},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"An Archive policy rule has a few properties: a name to identify it, an archive"},{"line_number":151,"context_line":"policy name that will be used to store the policy name and metric pattern to"},{"line_number":152,"context_line":"match metric names."},{"line_number":153,"context_line":""}],"source_content_type":"text/x-jinja2","patch_set":10,"id":"7aaa499b_94e11801","line":150,"updated":"2015-04-14 18:55:45.000000000","message":"s/Archive/archive/","commit_id":"a132ae48f0f909b39bf102044580cc426a7078e3"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"d9e94b102b7f3e4db82271e3559b2328e0d85021","unresolved":false,"context_lines":[{"line_number":152,"context_line":"match metric names."},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"An archive policy rule for example could be a mapping to default a medium archive"},{"line_number":155,"context_line":"policy for any volume metric with a pattern matching volume.*. When a sample metric"},{"line_number":156,"context_line":"is posted with a name of volume.size, that would match the pattern and the"},{"line_number":157,"context_line":"rule applies and sets the archive policy to medium."},{"line_number":158,"context_line":""}],"source_content_type":"text/x-jinja2","patch_set":10,"id":"7aaa499b_54e4b00b","line":155,"updated":"2015-04-14 18:55:45.000000000","message":"`volume.*`","commit_id":"a132ae48f0f909b39bf102044580cc426a7078e3"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"d9e94b102b7f3e4db82271e3559b2328e0d85021","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"An archive policy rule for example could be a mapping to default a medium archive"},{"line_number":155,"context_line":"policy for any volume metric with a pattern matching volume.*. When a sample metric"},{"line_number":156,"context_line":"is posted with a name of volume.size, that would match the pattern and the"},{"line_number":157,"context_line":"rule applies and sets the archive policy to medium."},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"To create a rule, the following API request should be used:"}],"source_content_type":"text/x-jinja2","patch_set":10,"id":"7aaa499b_f4bbbce3","line":156,"updated":"2015-04-14 18:55:45.000000000","message":"`volume.size`","commit_id":"a132ae48f0f909b39bf102044580cc426a7078e3"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"d9e94b102b7f3e4db82271e3559b2328e0d85021","unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":"The metric_pattern is used to pattern match so as some examples,"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"- * matches anything"},{"line_number":166,"context_line":"- disk.* matches disk.io"},{"line_number":167,"context_line":"- disk.io.* matches disk.io.rate"},{"line_number":168,"context_line":""}],"source_content_type":"text/x-jinja2","patch_set":10,"id":"7aaa499b_74d0cc1f","line":165,"updated":"2015-04-14 18:55:45.000000000","message":"`*`","commit_id":"a132ae48f0f909b39bf102044580cc426a7078e3"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"d9e94b102b7f3e4db82271e3559b2328e0d85021","unresolved":false,"context_lines":[{"line_number":163,"context_line":"The metric_pattern is used to pattern match so as some examples,"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"- * matches anything"},{"line_number":166,"context_line":"- disk.* matches disk.io"},{"line_number":167,"context_line":"- disk.io.* matches disk.io.rate"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"Once created, you can retrieve the rule information:"}],"source_content_type":"text/x-jinja2","patch_set":10,"id":"7aaa499b_54cb9072","line":166,"updated":"2015-04-14 18:55:45.000000000","message":"`disk.*` and `disk.io`","commit_id":"a132ae48f0f909b39bf102044580cc426a7078e3"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"d9e94b102b7f3e4db82271e3559b2328e0d85021","unresolved":false,"context_lines":[{"line_number":164,"context_line":""},{"line_number":165,"context_line":"- * matches anything"},{"line_number":166,"context_line":"- disk.* matches disk.io"},{"line_number":167,"context_line":"- disk.io.* matches disk.io.rate"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"Once created, you can retrieve the rule information:"},{"line_number":170,"context_line":""}],"source_content_type":"text/x-jinja2","patch_set":10,"id":"7aaa499b_f4a29cad","line":167,"updated":"2015-04-14 18:55:45.000000000","message":"`disk.io.*` and `disk.io.rate`","commit_id":"a132ae48f0f909b39bf102044580cc426a7078e3"}],"doc/source/rest.yaml":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"cf6b63db5b35117d9223357fd13e56b722f1aa85","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    {"},{"line_number":86,"context_line":"      \"name\": \"test_rule\","},{"line_number":87,"context_line":"      \"metric_pattern\": \"my.metric.pattern\","},{"line_number":88,"context_line":"      \"archive_policy_name\": \"low\""},{"line_number":89,"context_line":"    }"},{"line_number":90,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":8,"id":"7aaa499b_bc955de5","line":87,"updated":"2015-04-13 11:19:00.000000000","message":"Would be cool to use a pattern such as disk.* or something like that","commit_id":"1931de2235923cb986625517f6b657c7d2a0f9f8"}],"gnocchi/archive_policy.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"161b33e24b7e6dc1448359f20ad1a76418951b65","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        }"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"class ArchivePolicyRule(object):"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def __init__(self, name, archive_policy_name, metric_pattern):"},{"line_number":172,"context_line":"        self.name \u003d name"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aaa499b_2e19de88","line":169,"updated":"2015-04-14 14:13:21.000000000","message":"This class is never used AFAICT, just drop it.","commit_id":"8eb25828511286477201e516649bb3ad30625628"}],"gnocchi/indexer/sqlalchemy.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"3e05c208abf62364a314db2184cc52415124f662","unresolved":false,"context_lines":[{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def list_archive_policy_rules(self):"},{"line_number":125,"context_line":"        session \u003d self.engine_facade.get_session()"},{"line_number":126,"context_line":"        return [dict(ap) for ap in session.query(ArchivePolicyRule).all()]"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    def get_archive_policy_rule(self, name):"},{"line_number":129,"context_line":"        session \u003d self.engine_facade.get_session()"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa53dc9_3598d677","line":126,"updated":"2015-04-09 13:19:35.000000000","message":"We now return object rather than dict, that can be jsonify()ed.","commit_id":"2fe10e66160a12f6208631e60cda971b312b9bd2"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"3e05c208abf62364a314db2184cc52415124f662","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        session \u003d self.engine_facade.get_session()"},{"line_number":130,"context_line":"        apr \u003d session.query(ArchivePolicyRule).get(name)"},{"line_number":131,"context_line":"        if apr:"},{"line_number":132,"context_line":"            return dict(apr)"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def delete_archive_policy_rule(self, name):"},{"line_number":135,"context_line":"        session \u003d self.engine_facade.get_session()"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa53dc9_f59dce66","line":132,"updated":"2015-04-09 13:19:35.000000000","message":"Same here.","commit_id":"2fe10e66160a12f6208631e60cda971b312b9bd2"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"3e05c208abf62364a314db2184cc52415124f662","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                    ArchivePolicyRule.name \u003d\u003d name).delete() \u003d\u003d 0:"},{"line_number":139,"context_line":"                raise indexer.NoSuchArchivePolicyRule(name)"},{"line_number":140,"context_line":"        except exception.DBError as e:"},{"line_number":141,"context_line":"            # violations"},{"line_number":142,"context_line":"            if isinstance(e.inner_exception, sqlalchemy.exc.IntegrityError):"},{"line_number":143,"context_line":"                raise indexer.ArchivePolicyRuleInUse(name)"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa53dc9_75809ef7","line":141,"updated":"2015-04-09 13:19:35.000000000","message":"Do you mean a foreign key error? Add a TODO to fix that when oslo.db supports it.","commit_id":"2fe10e66160a12f6208631e60cda971b312b9bd2"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"3e05c208abf62364a314db2184cc52415124f662","unresolved":false,"context_lines":[{"line_number":155,"context_line":"        except exception.DBDuplicateEntry:"},{"line_number":156,"context_line":"            raise indexer.ArchivePolicyRuleAlreadyExists("},{"line_number":157,"context_line":"                archive_policy_rule.name)"},{"line_number":158,"context_line":"        return dict(ap)"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def create_metric(self, id, created_by_user_id, created_by_project_id,"},{"line_number":161,"context_line":"                      archive_policy_name,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa53dc9_357fb616","line":158,"updated":"2015-04-09 13:19:35.000000000","message":"return ap","commit_id":"2fe10e66160a12f6208631e60cda971b312b9bd2"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"cf6b63db5b35117d9223357fd13e56b722f1aa85","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        session \u003d self.engine_facade.get_session()"},{"line_number":138,"context_line":"        apr \u003d session.query(ArchivePolicyRule).get(name)"},{"line_number":139,"context_line":"        if apr:"},{"line_number":140,"context_line":"            return apr"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def delete_archive_policy_rule(self, name):"},{"line_number":143,"context_line":"        session \u003d self.engine_facade.get_session()"}],"source_content_type":"text/x-python","patch_set":8,"id":"7aaa499b_3c782dc4","line":140,"updated":"2015-04-13 11:19:00.000000000","message":"You can just return apr directly, no need for a if since if it\u0027s None it will return None anyway.","commit_id":"1931de2235923cb986625517f6b657c7d2a0f9f8"}],"gnocchi/indexer/sqlalchemy_base.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"3e05c208abf62364a314db2184cc52415124f662","unresolved":false,"context_lines":[{"line_number":238,"context_line":"    )"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    name \u003d sqlalchemy.Column(sqlalchemy.String(255), primary_key\u003dTrue)"},{"line_number":241,"context_line":"    archive_policy_name \u003d sqlalchemy.Column("},{"line_number":242,"context_line":"        sqlalchemy.String(255),"},{"line_number":243,"context_line":"        nullable\u003dFalse)"},{"line_number":244,"context_line":"    metric_pattern \u003d sqlalchemy.Column(sqlalchemy.String(255))"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa53dc9_d571aa45","line":241,"updated":"2015-04-09 13:19:35.000000000","message":"This must be a foreign key.","commit_id":"2fe10e66160a12f6208631e60cda971b312b9bd2"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"cf6b63db5b35117d9223357fd13e56b722f1aa85","unresolved":false,"context_lines":[{"line_number":292,"context_line":"        sqlalchemy.ForeignKey(\u0027archive_policy.name\u0027,"},{"line_number":293,"context_line":"                              ondelete\u003d\"RESTRICT\"),"},{"line_number":294,"context_line":"        nullable\u003dFalse)"},{"line_number":295,"context_line":"    metric_pattern \u003d sqlalchemy.Column(sqlalchemy.String(255))"}],"source_content_type":"text/x-python","patch_set":8,"id":"7aaa499b_fc2f659f","line":295,"updated":"2015-04-13 11:19:00.000000000","message":"nullable\u003dFalse I think","commit_id":"1931de2235923cb986625517f6b657c7d2a0f9f8"}],"gnocchi/rest/__init__.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"3e05c208abf62364a314db2184cc52415124f662","unresolved":false,"context_lines":[{"line_number":276,"context_line":"        body \u003d deserialize(ArchivePolicyRuleSchema)"},{"line_number":277,"context_line":"        # Validate the data"},{"line_number":278,"context_line":"        try:"},{"line_number":279,"context_line":"            apr \u003d archive_policy.ArchivePolicyRule.from_dict(body)"},{"line_number":280,"context_line":"        except ValueError as e:"},{"line_number":281,"context_line":"            abort(400, e)"},{"line_number":282,"context_line":"        enforce(\"create archive policy rule\", apr.to_dict())"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa53dc9_9519e2d9","line":279,"updated":"2015-04-09 13:19:35.000000000","message":"This does not validate anything, you can remove it all together.\n\nThe object itself does not look like it\u0027s useful as it\u0027s a simple dict in the end.","commit_id":"2fe10e66160a12f6208631e60cda971b312b9bd2"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"3e05c208abf62364a314db2184cc52415124f662","unresolved":false,"context_lines":[{"line_number":279,"context_line":"            apr \u003d archive_policy.ArchivePolicyRule.from_dict(body)"},{"line_number":280,"context_line":"        except ValueError as e:"},{"line_number":281,"context_line":"            abort(400, e)"},{"line_number":282,"context_line":"        enforce(\"create archive policy rule\", apr.to_dict())"},{"line_number":283,"context_line":"        try:"},{"line_number":284,"context_line":"            ap \u003d pecan.request.indexer.create_archive_policy_rule(apr)"},{"line_number":285,"context_line":"        except indexer.ArchivePolicyRuleAlreadyExists as e:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa53dc9_3529f6e6","line":282,"updated":"2015-04-09 13:19:35.000000000","message":"You can use body rather than apr.to_dict()","commit_id":"2fe10e66160a12f6208631e60cda971b312b9bd2"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"3e05c208abf62364a314db2184cc52415124f662","unresolved":false,"context_lines":[{"line_number":281,"context_line":"            abort(400, e)"},{"line_number":282,"context_line":"        enforce(\"create archive policy rule\", apr.to_dict())"},{"line_number":283,"context_line":"        try:"},{"line_number":284,"context_line":"            ap \u003d pecan.request.indexer.create_archive_policy_rule(apr)"},{"line_number":285,"context_line":"        except indexer.ArchivePolicyRuleAlreadyExists as e:"},{"line_number":286,"context_line":"            abort(409, e)"},{"line_number":287,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa53dc9_5586badb","line":284,"updated":"2015-04-09 13:19:35.000000000","message":"You can use 3 args instead. :)","commit_id":"2fe10e66160a12f6208631e60cda971b312b9bd2"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"cf6b63db5b35117d9223357fd13e56b722f1aa85","unresolved":false,"context_lines":[{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    if not isinstance(target, dict):"},{"line_number":93,"context_line":"        target \u003d target.__dict__"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    if not pecan.request.policy_enforcer.enforce(rule, target, creds):"},{"line_number":96,"context_line":"        abort(403)"},{"line_number":97,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7aaa499b_bc18bd85","side":"PARENT","line":94,"updated":"2015-04-13 11:19:00.000000000","message":"unrelated change","commit_id":"b62d61982d3aaef536c7e07efa056d507057ed4b"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e7098360ed26183de93501782ec12987851003e5","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        except indexer.ArchivePolicyRuleAlreadyExists as e:"},{"line_number":276,"context_line":"            abort(409, e)"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        location \u003d \"/v1/archive_policy_rule/\" + ap[\u0027name\u0027]"},{"line_number":279,"context_line":"        set_resp_location_hdr(location)"},{"line_number":280,"context_line":"        pecan.response.status \u003d 201"},{"line_number":281,"context_line":"        return ap"}],"source_content_type":"text/x-python","patch_set":8,"id":"7aaa499b_01d3ec39","line":278,"updated":"2015-04-10 16:28:18.000000000","message":"As far as I can tell this means we can\u0027t have a rule name containing a \u0027/\u0027 character: It won\u0027t be escaped to %2F by set_resp_location_hdr.\n\nThis is fine because most web servers do a completely dismal job of dealing with %2F but I thought I ought to mention it in case it is a concern.","commit_id":"1931de2235923cb986625517f6b657c7d2a0f9f8"},{"author":{"_account_id":6924,"name":"Pradeep Kilambi","email":"pkilambi@redhat.com","username":"pkilambi"},"change_message_id":"cccf553f2a9bc0c5c804cf3cd3063d005c1bb686","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        except indexer.ArchivePolicyRuleAlreadyExists as e:"},{"line_number":276,"context_line":"            abort(409, e)"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        location \u003d \"/v1/archive_policy_rule/\" + ap[\u0027name\u0027]"},{"line_number":279,"context_line":"        set_resp_location_hdr(location)"},{"line_number":280,"context_line":"        pecan.response.status \u003d 201"},{"line_number":281,"context_line":"        return ap"}],"source_content_type":"text/x-python","patch_set":8,"id":"7aaa499b_0c82f500","line":278,"in_reply_to":"7aaa499b_01d3ec39","updated":"2015-04-11 14:28:20.000000000","message":"agreed! i guess we can worry about it when we run into such case. I\u0027ll leave it the way it is for now.","commit_id":"1931de2235923cb986625517f6b657c7d2a0f9f8"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"cf6b63db5b35117d9223357fd13e56b722f1aa85","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        except indexer.ArchivePolicyRuleAlreadyExists as e:"},{"line_number":276,"context_line":"            abort(409, e)"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        location \u003d \"/v1/archive_policy_rule/\" + ap[\u0027name\u0027]"},{"line_number":279,"context_line":"        set_resp_location_hdr(location)"},{"line_number":280,"context_line":"        pecan.response.status \u003d 201"},{"line_number":281,"context_line":"        return ap"}],"source_content_type":"text/x-python","patch_set":8,"id":"7aaa499b_570e3235","line":278,"in_reply_to":"7aaa499b_0c82f500","updated":"2015-04-13 11:19:00.000000000","message":"I think we already have the problem with archive policies. So if we decide to solve it at some point we\u0027ll do for all. :)","commit_id":"1931de2235923cb986625517f6b657c7d2a0f9f8"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"161b33e24b7e6dc1448359f20ad1a76418951b65","unresolved":false,"context_lines":[{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    if not isinstance(target, dict):"},{"line_number":93,"context_line":"        target \u003d target.__dict__"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    if not pecan.request.policy_enforcer.enforce(rule, target, creds):"},{"line_number":96,"context_line":"        abort(403)"},{"line_number":97,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7aaa499b_6e824696","side":"PARENT","line":94,"updated":"2015-04-14 14:13:21.000000000","message":"unrelated","commit_id":"b62d61982d3aaef536c7e07efa056d507057ed4b"}],"gnocchi/tests/test_rest.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e7098360ed26183de93501782ec12987851003e5","unresolved":false,"context_lines":[{"line_number":600,"context_line":"            self.assertIn(apj, aps)"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":""},{"line_number":603,"context_line":"class ArchivePolicyRuleTest(RestTest):"},{"line_number":604,"context_line":""},{"line_number":605,"context_line":"    def test_post_archive_policy_rule(self):"},{"line_number":606,"context_line":"        name \u003d \"test_ap_rule\""}],"source_content_type":"text/x-python","patch_set":8,"id":"7aaa499b_c18184fd","line":603,"updated":"2015-04-10 16:28:18.000000000","message":"We can probably get away with having just the gabbi tests if we prefer that. From what I can see most of the assertions you\u0027ve made here can be expressed in the gabbi yaml file, especially if using \u0027response_json_paths\u0027 and the \u0027magic\u0027 replacement tools.","commit_id":"1931de2235923cb986625517f6b657c7d2a0f9f8"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"cf6b63db5b35117d9223357fd13e56b722f1aa85","unresolved":false,"context_lines":[{"line_number":600,"context_line":"            self.assertIn(apj, aps)"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":""},{"line_number":603,"context_line":"class ArchivePolicyRuleTest(RestTest):"},{"line_number":604,"context_line":""},{"line_number":605,"context_line":"    def test_post_archive_policy_rule(self):"},{"line_number":606,"context_line":"        name \u003d \"test_ap_rule\""}],"source_content_type":"text/x-python","patch_set":8,"id":"7aaa499b_d73122ee","line":603,"in_reply_to":"7aaa499b_7ce7d5e4","updated":"2015-04-13 11:19:00.000000000","message":"I\u0027d prefer we go full gabbi where possible. It\u0027s less verbose and less error prone than using the generic test framework.","commit_id":"1931de2235923cb986625517f6b657c7d2a0f9f8"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"4f9776124d86f34b614309f58b1b78551b4ccf1c","unresolved":false,"context_lines":[{"line_number":600,"context_line":"            self.assertIn(apj, aps)"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":""},{"line_number":603,"context_line":"class ArchivePolicyRuleTest(RestTest):"},{"line_number":604,"context_line":""},{"line_number":605,"context_line":"    def test_post_archive_policy_rule(self):"},{"line_number":606,"context_line":"        name \u003d \"test_ap_rule\""}],"source_content_type":"text/x-python","patch_set":8,"id":"7aaa499b_7ce7d5e4","line":603,"in_reply_to":"7aaa499b_ac79c131","updated":"2015-04-13 11:06:47.000000000","message":"I don\u0027t feel strongly about it all. Early on there was some discussion about moving all the self.app webtests into gabbi, or at least removing the duplicates but then we sort of settled on not worrying too much one way or another.\n\nPerhaps jd can weigh in here with an opinion?","commit_id":"1931de2235923cb986625517f6b657c7d2a0f9f8"},{"author":{"_account_id":6924,"name":"Pradeep Kilambi","email":"pkilambi@redhat.com","username":"pkilambi"},"change_message_id":"cccf553f2a9bc0c5c804cf3cd3063d005c1bb686","unresolved":false,"context_lines":[{"line_number":600,"context_line":"            self.assertIn(apj, aps)"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":""},{"line_number":603,"context_line":"class ArchivePolicyRuleTest(RestTest):"},{"line_number":604,"context_line":""},{"line_number":605,"context_line":"    def test_post_archive_policy_rule(self):"},{"line_number":606,"context_line":"        name \u003d \"test_ap_rule\""}],"source_content_type":"text/x-python","patch_set":8,"id":"7aaa499b_ac79c131","line":603,"in_reply_to":"7aaa499b_c18184fd","updated":"2015-04-11 14:28:20.000000000","message":"if you feel strongly about moving this to gabbi i can. But since this covers the api similar to other controller tests. I\u0027ll leave this as is. Is the intent in the long term to move everything to gabbi or have both?","commit_id":"1931de2235923cb986625517f6b657c7d2a0f9f8"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"d9e94b102b7f3e4db82271e3559b2328e0d85021","unresolved":false,"context_lines":[{"line_number":600,"context_line":"            self.assertIn(apj, aps)"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":""},{"line_number":603,"context_line":"class ArchivePolicyRuleTest(RestTest):"},{"line_number":604,"context_line":""},{"line_number":605,"context_line":"    def test_post_archive_policy_rule(self):"},{"line_number":606,"context_line":"        name \u003d \"test_ap_rule\""}],"source_content_type":"text/x-python","patch_set":10,"id":"7aaa499b_f4905c45","line":603,"updated":"2015-04-14 18:55:45.000000000","message":"If I\u0027m not mistaken you wrote Gabbi tests doing that so you can drop them.","commit_id":"a132ae48f0f909b39bf102044580cc426a7078e3"}]}
