)]}'
{"sb-filter-bugs-by-priority.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"6eff3595d88c062d1d2a0bf968cc7e9777023b24","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    for project in r.json():"},{"line_number":44,"context_line":"        if (project_name \u003d\u003d project[\"name\"].split(\"/\")[1]):"},{"line_number":45,"context_line":"            return project[\"id\"]"},{"line_number":46,"context_line":"    print(\"%s: no matching project\" % project_name)"},{"line_number":47,"context_line":"    sys.exit(1)"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_ac22cfb7","line":46,"updated":"2018-01-17 16:54:57.000000000","message":"How about throwing an exception instead of printing to stdout and calling sys.exit()?","commit_id":"7f6879bdbaf36d7614c4b52be44e0abd70082659"},{"author":{"_account_id":21798,"name":"Bernard Cafarelli","email":"bcafarel@redhat.com","username":"bcafarel"},"change_message_id":"85de1e2220ff367472f632970af97c2a7cdc3379","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    for project in r.json():"},{"line_number":44,"context_line":"        if (project_name \u003d\u003d project[\"name\"].split(\"/\")[1]):"},{"line_number":45,"context_line":"            return project[\"id\"]"},{"line_number":46,"context_line":"    print(\"%s: no matching project\" % project_name)"},{"line_number":47,"context_line":"    sys.exit(1)"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_8aac779f","line":46,"in_reply_to":"7f96bb07_ac22cfb7","updated":"2018-01-18 11:03:29.000000000","message":"Ack, I will update (probably to throw a ValueError one?)","commit_id":"7f6879bdbaf36d7614c4b52be44e0abd70082659"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"6eff3595d88c062d1d2a0bf968cc7e9777023b24","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        for task in r.json():"},{"line_number":62,"context_line":"            if (task[\"project_id\"] \u003d\u003d project_id and"},{"line_number":63,"context_line":"               task[\"priority\"] !\u003d priority):"},{"line_number":64,"context_line":"                result.append(STORY_PREFIX + story_id)"},{"line_number":65,"context_line":"                break"},{"line_number":66,"context_line":"    return result"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_2c379f01","line":64,"updated":"2018-01-17 16:54:57.000000000","message":"If you make this function a generator instead of returning a list then the command can start producing output as soon as the first result is yielded instead of waiting to query all of the inputs.","commit_id":"7f6879bdbaf36d7614c4b52be44e0abd70082659"},{"author":{"_account_id":21798,"name":"Bernard Cafarelli","email":"bcafarel@redhat.com","username":"bcafarel"},"change_message_id":"85de1e2220ff367472f632970af97c2a7cdc3379","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        for task in r.json():"},{"line_number":62,"context_line":"            if (task[\"project_id\"] \u003d\u003d project_id and"},{"line_number":63,"context_line":"               task[\"priority\"] !\u003d priority):"},{"line_number":64,"context_line":"                result.append(STORY_PREFIX + story_id)"},{"line_number":65,"context_line":"                break"},{"line_number":66,"context_line":"    return result"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_ea9c1b6b","line":64,"in_reply_to":"7f96bb07_2c379f01","updated":"2018-01-18 11:03:29.000000000","message":"Will look into it","commit_id":"7f6879bdbaf36d7614c4b52be44e0abd70082659"}],"sb-filter-stories-by-priority.py":[{"author":{"_account_id":6088,"name":"Emmet Hikory","email":"persia@shipstone.jp","username":"persia"},"change_message_id":"df85d1262cc3926eee74c6418e8323911efa224d","unresolved":false,"context_lines":[{"line_number":13,"context_line":"# under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"\"\"\""},{"line_number":16,"context_line":"This StoryBoard tool is used to filter out stories of specified priority."},{"line_number":17,"context_line":"\"\"\""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import argparse"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f96bb07_9bbe00d3","line":16,"range":{"start_line":16,"start_character":0,"end_line":16,"end_character":73},"updated":"2018-01-18 17:56:15.000000000","message":"I would recommend against relying on \"priority\" to mean anything.  This field has been deprecated, and is no longer present in the UI.  http://lists.openstack.org/pipermail/openstack-infra/2016-October/004791.html has some of the details introducing the new model : precisely how this tool would adopt it depends on the nature of worklists that users might have defined.","commit_id":"59cf27b91f747cf3fbceeb345e0b4a7ce9d5ffba"},{"author":{"_account_id":16960,"name":"Adam Coldrick","email":"adam.coldrick@codethink.co.uk","username":"SotK"},"change_message_id":"2fca8ee149990a3fcfd94d8de77a30f08382ccf6","unresolved":false,"context_lines":[{"line_number":13,"context_line":"# under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"\"\"\""},{"line_number":16,"context_line":"This StoryBoard tool is used to filter out stories of specified priority."},{"line_number":17,"context_line":"\"\"\""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import argparse"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f96bb07_98304358","line":16,"range":{"start_line":16,"start_character":0,"end_line":16,"end_character":73},"in_reply_to":"7f96bb07_9bbe00d3","updated":"2018-01-18 19:30:12.000000000","message":"I\u0027ll also add that global priority is likely to disappear from the API at some point in the future, since it was only meant as a placeholder until we implemented the worklist-based model.","commit_id":"59cf27b91f747cf3fbceeb345e0b4a7ce9d5ffba"}],"sb-filter-stories-by-tag.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"6eff3595d88c062d1d2a0bf968cc7e9777023b24","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        r \u003d requests.get(SB_URL + \"stories/%s\""},{"line_number":40,"context_line":"                         % story_id)"},{"line_number":41,"context_line":"        if tag not in r.json()[\"tags\"]:"},{"line_number":42,"context_line":"                result.append(STORY_PREFIX + story_id)"},{"line_number":43,"context_line":"    return result"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_8c103359","line":42,"updated":"2018-01-17 16:54:57.000000000","message":"This function could also be a generator and yield individual items instead of returning a list.","commit_id":"7f6879bdbaf36d7614c4b52be44e0abd70082659"},{"author":{"_account_id":21798,"name":"Bernard Cafarelli","email":"bcafarel@redhat.com","username":"bcafarel"},"change_message_id":"85de1e2220ff367472f632970af97c2a7cdc3379","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        r \u003d requests.get(SB_URL + \"stories/%s\""},{"line_number":40,"context_line":"                         % story_id)"},{"line_number":41,"context_line":"        if tag not in r.json()[\"tags\"]:"},{"line_number":42,"context_line":"                result.append(STORY_PREFIX + story_id)"},{"line_number":43,"context_line":"    return result"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_8a855709","line":42,"in_reply_to":"7f96bb07_8c103359","updated":"2018-01-18 11:03:29.000000000","message":"Indeed, and this will make both scripts behave the same way","commit_id":"7f6879bdbaf36d7614c4b52be44e0abd70082659"},{"author":{"_account_id":16960,"name":"Adam Coldrick","email":"adam.coldrick@codethink.co.uk","username":"SotK"},"change_message_id":"2fca8ee149990a3fcfd94d8de77a30f08382ccf6","unresolved":false,"context_lines":[{"line_number":41,"context_line":"def _filter_stories(sb, bugs_only, tag, story_ids):"},{"line_number":42,"context_line":"    for story_id in story_ids:"},{"line_number":43,"context_line":"        story \u003d sb.stories.get(story_id)"},{"line_number":44,"context_line":"        if bugs_only and not story.is_bug:"},{"line_number":45,"context_line":"            next"},{"line_number":46,"context_line":"        if tag not in story.tags:"},{"line_number":47,"context_line":"                yield STORY_PREFIX + story_id"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f96bb07_186af318","line":44,"range":{"start_line":44,"start_character":35,"end_line":44,"end_character":41},"updated":"2018-01-18 19:30:12.000000000","message":"I\u0027d also recommend against using this to determine if a story is a bug or not. It is not exposed in the UI, and likely will never be (and may well be officially deprecated and removed from the API at some point in favour of using tags to describe stories as bugs if needed, which is what we currently recommend).","commit_id":"59cf27b91f747cf3fbceeb345e0b4a7ce9d5ffba"}],"sb-tag.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"6eff3595d88c062d1d2a0bf968cc7e9777023b24","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    r \u003d requests.put(\"https://storyboard.openstack.org/api/v1/tags/%s\" %"},{"line_number":42,"context_line":"                     story_id, data\u003ddata, headers\u003dheaders)"},{"line_number":43,"context_line":"    if r.status_code \u003d\u003d requests.codes.unauthorized:"},{"line_number":44,"context_line":"        print(\"Authorization failure, incorrect token?\")"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def main():"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_4c06ab22","line":44,"updated":"2018-01-17 16:54:57.000000000","message":"Should this throw an exception?\n\nIs there any reason not to be using the python-storyboardclient package for calling the API?","commit_id":"7f6879bdbaf36d7614c4b52be44e0abd70082659"},{"author":{"_account_id":21798,"name":"Bernard Cafarelli","email":"bcafarel@redhat.com","username":"bcafarel"},"change_message_id":"85de1e2220ff367472f632970af97c2a7cdc3379","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    r \u003d requests.put(\"https://storyboard.openstack.org/api/v1/tags/%s\" %"},{"line_number":42,"context_line":"                     story_id, data\u003ddata, headers\u003dheaders)"},{"line_number":43,"context_line":"    if r.status_code \u003d\u003d requests.codes.unauthorized:"},{"line_number":44,"context_line":"        print(\"Authorization failure, incorrect token?\")"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def main():"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_ea4dfbc3","line":44,"in_reply_to":"7f96bb07_4c06ab22","updated":"2018-01-18 11:03:29.000000000","message":"Yes, probably better to halt treatment once the token is rejected\n\nFor python-storyboardclient, it was mostly to keep dependencies down and ease of use (no releases/pypi package, manual install needed as it will not be listed in requirements). But I can easily update to use it","commit_id":"7f6879bdbaf36d7614c4b52be44e0abd70082659"}]}
