)]}'
{"refstack/api/controllers/products.py":[{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"b9e619adb37cd55250f2428a7455b9b9f650b99d","unresolved":false,"context_lines":[{"line_number":116,"context_line":"                           else const.CLOUD)"},{"line_number":117,"context_line":"        if product[\u0027type\u0027] \u003d\u003d const.SOFTWARE:"},{"line_number":118,"context_line":"            product[\u0027product_id\u0027] \u003d six.text_type(uuid.uuid4())"},{"line_number":119,"context_line":"        vendor_id \u003d product.pop(\u0027organization_id\u0027, None)"},{"line_number":120,"context_line":"        if not vendor_id:"},{"line_number":121,"context_line":"            # create fake vendor for new product"},{"line_number":122,"context_line":"            # TODO(andrey-mp): maybe just fill with info here and create"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab6814e_166e5c96","line":119,"range":{"start_line":119,"start_character":8,"end_line":119,"end_character":17},"updated":"2016-05-23 21:51:15.000000000","message":"Should we check whether this is a Foundation organization?\n\nMore fundamental question is do we allow Foundation to be able to create product?  If not, we may need to update the spec [1] to clarify.\n\n[1] https://github.com/openstack/refstack/blob/master/specs/mitaka/approved/product-registration-api.rst","commit_id":"676b90ee7cd66a2a965c515de8f1048d6c28833f"},{"author":{"_account_id":10234,"name":"Andrey Pavlov","email":"andrey.mp@gmail.com","username":"andrey-mp"},"change_message_id":"a1f8d51cf0b4ec8d84f02f1763bbbbf5c2e07e69","unresolved":false,"context_lines":[{"line_number":116,"context_line":"                           else const.CLOUD)"},{"line_number":117,"context_line":"        if product[\u0027type\u0027] \u003d\u003d const.SOFTWARE:"},{"line_number":118,"context_line":"            product[\u0027product_id\u0027] \u003d six.text_type(uuid.uuid4())"},{"line_number":119,"context_line":"        vendor_id \u003d product.pop(\u0027organization_id\u0027, None)"},{"line_number":120,"context_line":"        if not vendor_id:"},{"line_number":121,"context_line":"            # create fake vendor for new product"},{"line_number":122,"context_line":"            # TODO(andrey-mp): maybe just fill with info here and create"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab6814e_be3f3bd5","line":119,"range":{"start_line":119,"start_character":8,"end_line":119,"end_character":17},"in_reply_to":"bab6814e_166e5c96","updated":"2016-05-25 08:02:07.000000000","message":"I thought that Foundation should create \u0027OpenStack\u0027 product...","commit_id":"676b90ee7cd66a2a965c515de8f1048d6c28833f"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"b9e619adb37cd55250f2428a7455b9b9f650b99d","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            # create fake vendor for new product"},{"line_number":122,"context_line":"            # TODO(andrey-mp): maybe just fill with info here and create"},{"line_number":123,"context_line":"            # at DB layer in one transaction"},{"line_number":124,"context_line":"            vendor \u003d {\u0027name\u0027: \u0027Vendor #\u0027 + str(int(random.random() * 1e8))}"},{"line_number":125,"context_line":"            vendor \u003d db.add_organization(vendor, creator)"},{"line_number":126,"context_line":"            vendor_id \u003d vendor[\u0027id\u0027]"},{"line_number":127,"context_line":"        product[\u0027organization_id\u0027] \u003d vendor_id"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab6814e_36ae00e8","line":124,"range":{"start_line":124,"start_character":11,"end_line":124,"end_character":75},"updated":"2016-05-23 21:51:15.000000000","message":"If a vendor_id is not passing in, this section of code would create a different default vendor ID each time.\n\nShould the default vendor ID be associated with a user and can be re-used each time a vendor_id is not passing in? The vendor id could be something like vendor_{user_UUID}.","commit_id":"676b90ee7cd66a2a965c515de8f1048d6c28833f"},{"author":{"_account_id":10234,"name":"Andrey Pavlov","email":"andrey.mp@gmail.com","username":"andrey-mp"},"change_message_id":"a1f8d51cf0b4ec8d84f02f1763bbbbf5c2e07e69","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            # create fake vendor for new product"},{"line_number":122,"context_line":"            # TODO(andrey-mp): maybe just fill with info here and create"},{"line_number":123,"context_line":"            # at DB layer in one transaction"},{"line_number":124,"context_line":"            vendor \u003d {\u0027name\u0027: \u0027Vendor #\u0027 + str(int(random.random() * 1e8))}"},{"line_number":125,"context_line":"            vendor \u003d db.add_organization(vendor, creator)"},{"line_number":126,"context_line":"            vendor_id \u003d vendor[\u0027id\u0027]"},{"line_number":127,"context_line":"        product[\u0027organization_id\u0027] \u003d vendor_id"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab6814e_c15b422d","line":124,"range":{"start_line":124,"start_character":11,"end_line":124,"end_character":75},"in_reply_to":"bab6814e_36ae00e8","updated":"2016-05-25 08:02:07.000000000","message":"good desicion. will do.","commit_id":"676b90ee7cd66a2a965c515de8f1048d6c28833f"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"b9e619adb37cd55250f2428a7455b9b9f650b99d","unresolved":false,"context_lines":[{"line_number":151,"context_line":"            # user can mark product as public only if"},{"line_number":152,"context_line":"            # his/her vendor is public(official)"},{"line_number":153,"context_line":"            public \u003d api_utils.str_to_bool(kw[\u0027public\u0027])"},{"line_number":154,"context_line":"            if (vendor[\u0027type\u0027] not in (const.OFFICIAL_VENDOR, const.FOUNDATION)"},{"line_number":155,"context_line":"                    and public):"},{"line_number":156,"context_line":"                pecan.abort(403, \u0027Forbidden.\u0027)"},{"line_number":157,"context_line":"            product_info[\u0027public\u0027] \u003d public"},{"line_number":158,"context_line":"        if \u0027properties\u0027 in kw:"},{"line_number":159,"context_line":"            product_info[\u0027properties\u0027] \u003d json.dumps(kw[\u0027properties\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab6814e_e5715caa","line":156,"range":{"start_line":154,"start_character":12,"end_line":156,"end_character":46},"updated":"2016-05-23 21:51:15.000000000","message":"A default vendor which is created automatically will never be a public vendor.  Does this mean that these products can never be exposed to the public?  If this is the case, what would be the benefit of allowing an individual user to create products?","commit_id":"676b90ee7cd66a2a965c515de8f1048d6c28833f"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"ab6438f7df0ad0cd18d2aa2c2082d80a951a36e8","unresolved":false,"context_lines":[{"line_number":151,"context_line":"            # user can mark product as public only if"},{"line_number":152,"context_line":"            # his/her vendor is public(official)"},{"line_number":153,"context_line":"            public \u003d api_utils.str_to_bool(kw[\u0027public\u0027])"},{"line_number":154,"context_line":"            if (vendor[\u0027type\u0027] not in (const.OFFICIAL_VENDOR, const.FOUNDATION)"},{"line_number":155,"context_line":"                    and public):"},{"line_number":156,"context_line":"                pecan.abort(403, \u0027Forbidden.\u0027)"},{"line_number":157,"context_line":"            product_info[\u0027public\u0027] \u003d public"},{"line_number":158,"context_line":"        if \u0027properties\u0027 in kw:"},{"line_number":159,"context_line":"            product_info[\u0027properties\u0027] \u003d json.dumps(kw[\u0027properties\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab6814e_257364e9","line":156,"range":{"start_line":154,"start_character":12,"end_line":156,"end_character":46},"in_reply_to":"bab6814e_c59ff863","updated":"2016-05-23 22:10:38.000000000","message":"Does this mean that we would allow making a product public even if the vendor is not?","commit_id":"676b90ee7cd66a2a965c515de8f1048d6c28833f"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"34e129118836cd62a4128a385c96de48a4e46985","unresolved":false,"context_lines":[{"line_number":151,"context_line":"            # user can mark product as public only if"},{"line_number":152,"context_line":"            # his/her vendor is public(official)"},{"line_number":153,"context_line":"            public \u003d api_utils.str_to_bool(kw[\u0027public\u0027])"},{"line_number":154,"context_line":"            if (vendor[\u0027type\u0027] not in (const.OFFICIAL_VENDOR, const.FOUNDATION)"},{"line_number":155,"context_line":"                    and public):"},{"line_number":156,"context_line":"                pecan.abort(403, \u0027Forbidden.\u0027)"},{"line_number":157,"context_line":"            product_info[\u0027public\u0027] \u003d public"},{"line_number":158,"context_line":"        if \u0027properties\u0027 in kw:"},{"line_number":159,"context_line":"            product_info[\u0027properties\u0027] \u003d json.dumps(kw[\u0027properties\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab6814e_c59ff863","line":156,"range":{"start_line":154,"start_character":12,"end_line":156,"end_character":46},"in_reply_to":"bab6814e_e5715caa","updated":"2016-05-23 22:03:53.000000000","message":"I thought it would be beneficial for a user\u0027s own reference when testing other vendor\u0027s products or even their own.","commit_id":"676b90ee7cd66a2a965c515de8f1048d6c28833f"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"b9e619adb37cd55250f2428a7455b9b9f650b99d","unresolved":false,"context_lines":[{"line_number":159,"context_line":"            product_info[\u0027properties\u0027] \u003d json.dumps(kw[\u0027properties\u0027])"},{"line_number":160,"context_line":"        db.update_product(product_info)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        pecan.response.status \u003d 201"},{"line_number":163,"context_line":"        product \u003d db.get_product(id)"},{"line_number":164,"context_line":"        product[\u0027can_manage\u0027] \u003d True"},{"line_number":165,"context_line":"        return product"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab6814e_8aa97f27","line":162,"range":{"start_line":162,"start_character":32,"end_line":162,"end_character":35},"updated":"2016-05-23 21:51:15.000000000","message":"Should this be 200?","commit_id":"676b90ee7cd66a2a965c515de8f1048d6c28833f"},{"author":{"_account_id":10234,"name":"Andrey Pavlov","email":"andrey.mp@gmail.com","username":"andrey-mp"},"change_message_id":"a1f8d51cf0b4ec8d84f02f1763bbbbf5c2e07e69","unresolved":false,"context_lines":[{"line_number":159,"context_line":"            product_info[\u0027properties\u0027] \u003d json.dumps(kw[\u0027properties\u0027])"},{"line_number":160,"context_line":"        db.update_product(product_info)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        pecan.response.status \u003d 201"},{"line_number":163,"context_line":"        product \u003d db.get_product(id)"},{"line_number":164,"context_line":"        product[\u0027can_manage\u0027] \u003d True"},{"line_number":165,"context_line":"        return product"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab6814e_818c9a36","line":162,"range":{"start_line":162,"start_character":32,"end_line":162,"end_character":35},"in_reply_to":"bab6814e_8aa97f27","updated":"2016-05-25 08:02:07.000000000","message":"spec describes 200. but this is copy-paste from vendors )\nshould be 200","commit_id":"676b90ee7cd66a2a965c515de8f1048d6c28833f"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"b9e619adb37cd55250f2428a7455b9b9f650b99d","unresolved":false,"context_lines":[{"line_number":174,"context_line":"                not api_utils.check_user_is_vendor_admin(vendor_id)):"},{"line_number":175,"context_line":"            pecan.abort(403, \u0027Forbidden.\u0027)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        db.delete_product(id)"},{"line_number":178,"context_line":"        pecan.response.status \u003d 204"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab6814e_cab427d6","line":177,"range":{"start_line":177,"start_character":8,"end_line":177,"end_character":28},"updated":"2016-05-23 21:51:15.000000000","message":"For the case where a new default vendor was created for each product creation without vendor_id passing in, do we want to also delete the vendor when its product is deleted?","commit_id":"676b90ee7cd66a2a965c515de8f1048d6c28833f"},{"author":{"_account_id":10234,"name":"Andrey Pavlov","email":"andrey.mp@gmail.com","username":"andrey-mp"},"change_message_id":"a1f8d51cf0b4ec8d84f02f1763bbbbf5c2e07e69","unresolved":false,"context_lines":[{"line_number":174,"context_line":"                not api_utils.check_user_is_vendor_admin(vendor_id)):"},{"line_number":175,"context_line":"            pecan.abort(403, \u0027Forbidden.\u0027)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        db.delete_product(id)"},{"line_number":178,"context_line":"        pecan.response.status \u003d 204"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab6814e_417e32af","line":177,"range":{"start_line":177,"start_character":8,"end_line":177,"end_character":28},"in_reply_to":"bab6814e_cab427d6","updated":"2016-05-25 08:02:07.000000000","message":"I rework creation of default vendor and here deletion of vendor will be harmful.","commit_id":"676b90ee7cd66a2a965c515de8f1048d6c28833f"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"c97802275b559f0cc25342654fa1a6de82c43f59","unresolved":false,"context_lines":[{"line_number":124,"context_line":"            default_vendor_name \u003d \u0027vendor_\u0027 + creator"},{"line_number":125,"context_line":"            vendors \u003d db.get_organizations_by_user(creator)"},{"line_number":126,"context_line":"            for v in vendors:"},{"line_number":127,"context_line":"                if v[\u0027name\u0027] \u003d\u003d default_vendor_name:"},{"line_number":128,"context_line":"                    vendor_id \u003d vendor[\u0027id\u0027]"},{"line_number":129,"context_line":"                    break"},{"line_number":130,"context_line":"            else:"},{"line_number":131,"context_line":"                vendor \u003d {\u0027name\u0027: default_vendor_name}"}],"source_content_type":"text/x-python","patch_set":4,"id":"9abb7d3a_bf47c875","line":128,"range":{"start_line":127,"start_character":15,"end_line":128,"end_character":44},"updated":"2016-05-31 16:40:56.000000000","message":"May need to initialize the \"vendor\" variable?  Got this error when testing the scenario with this body:\n\n{ \"name\":\"my distro 1\", \"product_type\": 0, \"description\":\"test delete\"}\n\nResponse:\nstatus: 500 Internal Server Error\nDate: Tue, 31 May 2016 16:30:35 GMT\nServer: gunicorn/18.0\nConnection: close\nContent-Length: 113\nContent-Type: application/json\n\n{\"code\": 500, \"detail\": \"local variable \u0027vendor\u0027 referenced before assignment\", \"title\": \"Internal Server Error\"}","commit_id":"f700b70ac8037740fd2469e8b45506da4da9fd4d"},{"author":{"_account_id":10234,"name":"Andrey Pavlov","email":"andrey.mp@gmail.com","username":"andrey-mp"},"change_message_id":"3ef4ac16db3b6d43a16a71017716e7c2dba32d9f","unresolved":false,"context_lines":[{"line_number":124,"context_line":"            default_vendor_name \u003d \u0027vendor_\u0027 + creator"},{"line_number":125,"context_line":"            vendors \u003d db.get_organizations_by_user(creator)"},{"line_number":126,"context_line":"            for v in vendors:"},{"line_number":127,"context_line":"                if v[\u0027name\u0027] \u003d\u003d default_vendor_name:"},{"line_number":128,"context_line":"                    vendor_id \u003d vendor[\u0027id\u0027]"},{"line_number":129,"context_line":"                    break"},{"line_number":130,"context_line":"            else:"},{"line_number":131,"context_line":"                vendor \u003d {\u0027name\u0027: default_vendor_name}"}],"source_content_type":"text/x-python","patch_set":4,"id":"9abb7d3a_ca9be716","line":128,"range":{"start_line":127,"start_character":15,"end_line":128,"end_character":44},"in_reply_to":"9abb7d3a_bf47c875","updated":"2016-05-31 18:39:18.000000000","message":"Thanks for catch.\nI\u0027ve added test for this case.","commit_id":"f700b70ac8037740fd2469e8b45506da4da9fd4d"}],"refstack/db/sqlalchemy/api.py":[{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"34e129118836cd62a4128a385c96de48a4e46985","unresolved":false,"context_lines":[{"line_number":554,"context_line":""},{"line_number":555,"context_line":""},{"line_number":556,"context_line":"def get_public_products(allowed_keys\u003dNone):"},{"line_number":557,"context_line":"    \"\"\"Get public products by list of types.\"\"\""},{"line_number":558,"context_line":"    session \u003d get_session()"},{"line_number":559,"context_line":"    items \u003d ("},{"line_number":560,"context_line":"        session.query(models.Product)"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab6814e_a57c74ec","line":557,"range":{"start_line":557,"start_character":27,"end_line":557,"end_character":44},"updated":"2016-05-23 22:03:53.000000000","message":"A bit of a nit: Is \"by list of types\" accurate here? Product type doesn\u0027t seem to factor into this function\u0027s query.","commit_id":"676b90ee7cd66a2a965c515de8f1048d6c28833f"},{"author":{"_account_id":10234,"name":"Andrey Pavlov","email":"andrey.mp@gmail.com","username":"andrey-mp"},"change_message_id":"a1f8d51cf0b4ec8d84f02f1763bbbbf5c2e07e69","unresolved":false,"context_lines":[{"line_number":554,"context_line":""},{"line_number":555,"context_line":""},{"line_number":556,"context_line":"def get_public_products(allowed_keys\u003dNone):"},{"line_number":557,"context_line":"    \"\"\"Get public products by list of types.\"\"\""},{"line_number":558,"context_line":"    session \u003d get_session()"},{"line_number":559,"context_line":"    items \u003d ("},{"line_number":560,"context_line":"        session.query(models.Product)"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab6814e_3e906bec","line":557,"range":{"start_line":557,"start_character":27,"end_line":557,"end_character":44},"in_reply_to":"bab6814e_a57c74ec","updated":"2016-05-25 08:02:07.000000000","message":"ops - old comment. should be updated.","commit_id":"676b90ee7cd66a2a965c515de8f1048d6c28833f"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"34e129118836cd62a4128a385c96de48a4e46985","unresolved":false,"context_lines":[{"line_number":564,"context_line":""},{"line_number":565,"context_line":""},{"line_number":566,"context_line":"def get_products(allowed_keys\u003dNone):"},{"line_number":567,"context_line":"    \"\"\"Get all products by list of types.\"\"\""},{"line_number":568,"context_line":"    session \u003d get_session()"},{"line_number":569,"context_line":"    items \u003d ("},{"line_number":570,"context_line":"        session.query(models.Product)"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab6814e_6573ac16","line":567,"range":{"start_line":567,"start_character":24,"end_line":567,"end_character":41},"updated":"2016-05-23 22:03:53.000000000","message":"Same.","commit_id":"676b90ee7cd66a2a965c515de8f1048d6c28833f"}],"refstack/db/sqlalchemy/models.py":[{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"34e129118836cd62a4128a385c96de48a4e46985","unresolved":false,"context_lines":[{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    id \u003d sa.Column(sa.String(36), primary_key\u003dTrue,"},{"line_number":227,"context_line":"                   default\u003dlambda: six.text_type(uuid.uuid4()))"},{"line_number":228,"context_line":"    product_id \u003d sa.Column(sa.String(36), nullable\u003dFalse)"},{"line_number":229,"context_line":"    name \u003d sa.Column(sa.String(80), nullable\u003dFalse)"},{"line_number":230,"context_line":"    description \u003d sa.Column(sa.Text())"},{"line_number":231,"context_line":"    organization_id \u003d sa.Column(sa.String(36),"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab6814e_319e7f63","line":228,"range":{"start_line":228,"start_character":51,"end_line":228,"end_character":56},"updated":"2016-05-23 22:03:53.000000000","message":"This should probably be updated to nullable\u003dTrue to match the DB.","commit_id":"676b90ee7cd66a2a965c515de8f1048d6c28833f"},{"author":{"_account_id":10234,"name":"Andrey Pavlov","email":"andrey.mp@gmail.com","username":"andrey-mp"},"change_message_id":"a1f8d51cf0b4ec8d84f02f1763bbbbf5c2e07e69","unresolved":false,"context_lines":[{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    id \u003d sa.Column(sa.String(36), primary_key\u003dTrue,"},{"line_number":227,"context_line":"                   default\u003dlambda: six.text_type(uuid.uuid4()))"},{"line_number":228,"context_line":"    product_id \u003d sa.Column(sa.String(36), nullable\u003dFalse)"},{"line_number":229,"context_line":"    name \u003d sa.Column(sa.String(80), nullable\u003dFalse)"},{"line_number":230,"context_line":"    description \u003d sa.Column(sa.Text())"},{"line_number":231,"context_line":"    organization_id \u003d sa.Column(sa.String(36),"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab6814e_3e74ebfb","line":228,"range":{"start_line":228,"start_character":51,"end_line":228,"end_character":56},"in_reply_to":"bab6814e_319e7f63","updated":"2016-05-25 08:02:07.000000000","message":"yes. my fault.","commit_id":"676b90ee7cd66a2a965c515de8f1048d6c28833f"}]}
