)]}'
{"nova/objects/build_request.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aab1a7564867610448a24aeab17b4aad69f90367","unresolved":false,"context_lines":[{"line_number":419,"context_line":"    return context.session.query(api_models.BuildRequest).\\"},{"line_number":420,"context_line":"        filter_by(instance_uuid\u003dnull()).\\"},{"line_number":421,"context_line":"        limit(limit).\\"},{"line_number":422,"context_line":"        all()"},{"line_number":423,"context_line":""},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"@db.api_context_manager.writer"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_433437fa","line":422,"range":{"start_line":422,"start_character":8,"end_line":422,"end_character":13},"updated":"2016-12-09 18:54:22.000000000","message":"Seems this should just be delete() so we delete up to limit build requests, which would be more efficient than querying to limit and then deleting \u003c\u003d limit.","commit_id":"6f5d916b80acdd4059360c8e6768a160540285b4"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"8be4a6fd34e036a41320dfacad750e66fe6c69f1","unresolved":false,"context_lines":[{"line_number":419,"context_line":"    return context.session.query(api_models.BuildRequest).\\"},{"line_number":420,"context_line":"        filter_by(instance_uuid\u003dnull()).\\"},{"line_number":421,"context_line":"        limit(limit).\\"},{"line_number":422,"context_line":"        all()"},{"line_number":423,"context_line":""},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"@db.api_context_manager.writer"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_1efff401","line":422,"updated":"2016-12-09 18:56:28.000000000","message":"This should just delete here. You should be able to get a count of what was deleted if you need that.","commit_id":"6f5d916b80acdd4059360c8e6768a160540285b4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"17ff422a8f5e80da9e59b48ad4263ca8ab67ef6e","unresolved":false,"context_lines":[{"line_number":419,"context_line":"    return context.session.query(api_models.BuildRequest).\\"},{"line_number":420,"context_line":"        filter_by(instance_uuid\u003dnull()).\\"},{"line_number":421,"context_line":"        limit(limit).\\"},{"line_number":422,"context_line":"        all()"},{"line_number":423,"context_line":""},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"@db.api_context_manager.writer"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_fe5dd815","line":422,"in_reply_to":"3a71b18c_1efff401","updated":"2016-12-09 19:00:38.000000000","message":"Bulk delete doesn\u0027t work with limit so I tend to think we should honor the count as it\u0027s part of the CLI contract. If someone passes 0 or 1 as a dry run we should probably honor that.","commit_id":"6f5d916b80acdd4059360c8e6768a160540285b4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aab1a7564867610448a24aeab17b4aad69f90367","unresolved":false,"context_lines":[{"line_number":448,"context_line":"    :param count: The max number of build requests to delete."},{"line_number":449,"context_line":"    :type count: int"},{"line_number":450,"context_line":"    :returns: 2-item tuple of"},{"line_number":451,"context_line":"        (total number of orphaned build requests, number deleted)"},{"line_number":452,"context_line":"    \"\"\""},{"line_number":453,"context_line":"    orphaned_build_requests \u003d ("},{"line_number":454,"context_line":"        _get_build_requests_with_no_instance_uuid(context, count))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_c384c7b2","line":451,"range":{"start_line":451,"start_character":9,"end_line":451,"end_character":14},"updated":"2016-12-09 18:54:22.000000000","message":"This isn\u0027t really accurate as we\u0027ve limited the number we got back.","commit_id":"6f5d916b80acdd4059360c8e6768a160540285b4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9e77032a7b86b65bf1774be04f3e56873bd43328","unresolved":false,"context_lines":[{"line_number":448,"context_line":"    :param count: The max number of build requests to delete."},{"line_number":449,"context_line":"    :type count: int"},{"line_number":450,"context_line":"    :returns: 2-item tuple of"},{"line_number":451,"context_line":"        (total number of orphaned build requests, number deleted)"},{"line_number":452,"context_line":"    \"\"\""},{"line_number":453,"context_line":"    orphaned_build_requests \u003d ("},{"line_number":454,"context_line":"        _get_build_requests_with_no_instance_uuid(context, count))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_ca1777ec","line":451,"range":{"start_line":451,"start_character":9,"end_line":451,"end_character":14},"in_reply_to":"3a71b18c_3e34b0f9","updated":"2016-12-09 20:34:21.000000000","message":"I\u0027ve updated this wording in PS3.","commit_id":"6f5d916b80acdd4059360c8e6768a160540285b4"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a5ecec1c801e1322747bdbc9e427b2456b847f71","unresolved":false,"context_lines":[{"line_number":448,"context_line":"    :param count: The max number of build requests to delete."},{"line_number":449,"context_line":"    :type count: int"},{"line_number":450,"context_line":"    :returns: 2-item tuple of"},{"line_number":451,"context_line":"        (total number of orphaned build requests, number deleted)"},{"line_number":452,"context_line":"    \"\"\""},{"line_number":453,"context_line":"    orphaned_build_requests \u003d ("},{"line_number":454,"context_line":"        _get_build_requests_with_no_instance_uuid(context, count))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_3e34b0f9","line":451,"range":{"start_line":451,"start_character":9,"end_line":451,"end_character":14},"in_reply_to":"3a71b18c_c384c7b2","updated":"2016-12-09 19:58:54.000000000","message":"Yeah, it\u0027s \"total retrieved\" I guess.","commit_id":"6f5d916b80acdd4059360c8e6768a160540285b4"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"8be4a6fd34e036a41320dfacad750e66fe6c69f1","unresolved":false,"context_lines":[{"line_number":451,"context_line":"        (total number of orphaned build requests, number deleted)"},{"line_number":452,"context_line":"    \"\"\""},{"line_number":453,"context_line":"    orphaned_build_requests \u003d ("},{"line_number":454,"context_line":"        _get_build_requests_with_no_instance_uuid(context, count))"},{"line_number":455,"context_line":"    done \u003d 0"},{"line_number":456,"context_line":"    for orphan_buildreq in orphaned_build_requests:"},{"line_number":457,"context_line":"        result \u003d _destroy_in_db(context, orphan_buildreq.id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_3e29108a","line":454,"updated":"2016-12-09 18:56:28.000000000","message":"Personally I think you should ignore count for this migration. Its usefulness is in allowing deployers to avoid running migrations that will impact db performance, but doing this delete should be safe even without a limit.","commit_id":"6f5d916b80acdd4059360c8e6768a160540285b4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"17ff422a8f5e80da9e59b48ad4263ca8ab67ef6e","unresolved":false,"context_lines":[{"line_number":451,"context_line":"        (total number of orphaned build requests, number deleted)"},{"line_number":452,"context_line":"    \"\"\""},{"line_number":453,"context_line":"    orphaned_build_requests \u003d ("},{"line_number":454,"context_line":"        _get_build_requests_with_no_instance_uuid(context, count))"},{"line_number":455,"context_line":"    done \u003d 0"},{"line_number":456,"context_line":"    for orphan_buildreq in orphaned_build_requests:"},{"line_number":457,"context_line":"        result \u003d _destroy_in_db(context, orphan_buildreq.id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_deb9fc2f","line":454,"in_reply_to":"3a71b18c_3e29108a","updated":"2016-12-09 19:00:38.000000000","message":"Yeah my only concern as noted above is the CLI contract.","commit_id":"6f5d916b80acdd4059360c8e6768a160540285b4"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"535b06086f4ac951f5d469e6500696392273922a","unresolved":false,"context_lines":[{"line_number":451,"context_line":"        (total number of orphaned build requests, number deleted)"},{"line_number":452,"context_line":"    \"\"\""},{"line_number":453,"context_line":"    orphaned_build_requests \u003d ("},{"line_number":454,"context_line":"        _get_build_requests_with_no_instance_uuid(context, count))"},{"line_number":455,"context_line":"    done \u003d 0"},{"line_number":456,"context_line":"    for orphan_buildreq in orphaned_build_requests:"},{"line_number":457,"context_line":"        result \u003d _destroy_in_db(context, orphan_buildreq.id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_defc9c40","line":454,"in_reply_to":"3a71b18c_deb9fc2f","updated":"2016-12-09 19:22:03.000000000","message":"That\u0027s fair. I think documenting the exception would be a better way to go, but making the implementation conform to the contract as you\u0027ve done is potentially less confusing to admins.","commit_id":"6f5d916b80acdd4059360c8e6768a160540285b4"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a5ecec1c801e1322747bdbc9e427b2456b847f71","unresolved":false,"context_lines":[{"line_number":451,"context_line":"        (total number of orphaned build requests, number deleted)"},{"line_number":452,"context_line":"    \"\"\""},{"line_number":453,"context_line":"    orphaned_build_requests \u003d ("},{"line_number":454,"context_line":"        _get_build_requests_with_no_instance_uuid(context, count))"},{"line_number":455,"context_line":"    done \u003d 0"},{"line_number":456,"context_line":"    for orphan_buildreq in orphaned_build_requests:"},{"line_number":457,"context_line":"        result \u003d _destroy_in_db(context, orphan_buildreq.id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_fe2a388f","line":454,"in_reply_to":"3a71b18c_defc9c40","updated":"2016-12-09 19:58:54.000000000","message":"I think I lean toward honoring the CLI contract. I think it would be strange to see in the output that Total Needed and Completed are greater than max_count.","commit_id":"6f5d916b80acdd4059360c8e6768a160540285b4"}]}
