)]}'
{"tools/update-rs-db.py":[{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"c89845ead5e91321701f772f6502b1e1110b0326","unresolved":false,"context_lines":[{"line_number":130,"context_line":""},{"line_number":131,"context_line":"def main():"},{"line_number":132,"context_line":"    # connect to the internal refstack db"},{"line_number":133,"context_line":"    db \u003d pymysql.connect(\"localhost\", \"\u003cuser\u003e\", \"\u003cpassword\u003e\", \"refstack\")"},{"line_number":134,"context_line":"    cursor \u003d db.cursor()"},{"line_number":135,"context_line":"    # connect to the spreadsheet"},{"line_number":136,"context_line":"    parser \u003d argparse.ArgumentParser("}],"source_content_type":"text/x-python","patch_set":3,"id":"7ffa3b31_69944045","line":133,"range":{"start_line":133,"start_character":4,"end_line":133,"end_character":73},"updated":"2017-04-14 21:12:44.000000000","message":"Doing direct database queries will likely be problematic, as we don\u0027t have access to the refstack.openstack.org database credentials, and not sure if we can get them.\nHow about just getting the test IDs from the refstack links listed in the spreadsheet, and just do the API post requests on those test ID endpoints with no regard for the products? As I understand, there really aren\u0027t that many products officially registered on RefStack right now.","commit_id":"3a3caa989e200980d41b9cd07401e36baa721a8c"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"9bf822162e9f4ab6e91fdf94bef9f578d030390e","unresolved":false,"context_lines":[{"line_number":130,"context_line":""},{"line_number":131,"context_line":"def main():"},{"line_number":132,"context_line":"    # connect to the internal refstack db"},{"line_number":133,"context_line":"    db \u003d pymysql.connect(\"localhost\", \"\u003cuser\u003e\", \"\u003cpassword\u003e\", \"refstack\")"},{"line_number":134,"context_line":"    cursor \u003d db.cursor()"},{"line_number":135,"context_line":"    # connect to the spreadsheet"},{"line_number":136,"context_line":"    parser \u003d argparse.ArgumentParser("}],"source_content_type":"text/x-python","patch_set":3,"id":"7ffa3b31_5a7928fa","line":133,"range":{"start_line":133,"start_character":4,"end_line":133,"end_character":73},"in_reply_to":"7ffa3b31_69944045","updated":"2017-04-17 17:49:20.000000000","message":"Totally agree with Paul that there should not be direct access to the DB.  All DB access should be via RefStack APIs.","commit_id":"3a3caa989e200980d41b9cd07401e36baa721a8c"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"c89845ead5e91321701f772f6502b1e1110b0326","unresolved":false,"context_lines":[{"line_number":136,"context_line":"    parser \u003d argparse.ArgumentParser("},{"line_number":137,"context_line":"        \"Update the internal RefStack db using a csv file\")"},{"line_number":138,"context_line":"    parser.add_argument(\u0027--file\u0027, \"-f\", metavar\u003d\u0027f\u0027, type\u003dstr,"},{"line_number":139,"context_line":"                        action\u003d\"store\", dest\u003d\"filename\", default\u003d\"toadd.csv\")"},{"line_number":140,"context_line":"    result \u003d parser.parse_args()"},{"line_number":141,"context_line":"    if result.filename is None or not result.filename:"},{"line_number":142,"context_line":"        infile \u003d \"toadd.csv\""}],"source_content_type":"text/x-python","patch_set":3,"id":"7ffa3b31_49cce488","line":139,"updated":"2017-04-14 21:12:44.000000000","message":"Can we parameterize the RefStack base API URL here so this script can be used on the endpoints that aren\u0027t the official https://refstsack.openstack.org/api/v1 endpoint?","commit_id":"3a3caa989e200980d41b9cd07401e36baa721a8c"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"9bf822162e9f4ab6e91fdf94bef9f578d030390e","unresolved":false,"context_lines":[{"line_number":136,"context_line":"    parser \u003d argparse.ArgumentParser("},{"line_number":137,"context_line":"        \"Update the internal RefStack db using a csv file\")"},{"line_number":138,"context_line":"    parser.add_argument(\u0027--file\u0027, \"-f\", metavar\u003d\u0027f\u0027, type\u003dstr,"},{"line_number":139,"context_line":"                        action\u003d\"store\", dest\u003d\"filename\", default\u003d\"toadd.csv\")"},{"line_number":140,"context_line":"    result \u003d parser.parse_args()"},{"line_number":141,"context_line":"    if result.filename is None or not result.filename:"},{"line_number":142,"context_line":"        infile \u003d \"toadd.csv\""}],"source_content_type":"text/x-python","patch_set":3,"id":"7ffa3b31_1ab84074","line":139,"in_reply_to":"7ffa3b31_49cce488","updated":"2017-04-17 17:49:20.000000000","message":"Parameterized the RefStack base API URL is essential to allow the script to be run with a RefStack API server other than the official one. Without this, I am not sure how testing would be possible.","commit_id":"3a3caa989e200980d41b9cd07401e36baa721a8c"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"838d058ccdf3beec94d3e5d7eff0e10e04ea8610","unresolved":false,"context_lines":[{"line_number":8,"context_line":"import argparse"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"def process_flags(result):"},{"line_number":12,"context_line":"    if result.filename is None or not result.filename:"},{"line_number":13,"context_line":"        infile \u003d \"toadd.csv\""},{"line_number":14,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_80bae1bd","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":17},"updated":"2017-05-02 07:01:12.000000000","message":"Probably don\u0027t need this method as argparse can handle most of this processing in the add_argument method call. Just have to add the server/endpoint default. Though I think it may be better to not have a default and make it a required field.","commit_id":"979ea2bfb22c8d82737a08ac06baa0c5c9012b84"},{"author":{"_account_id":24728,"name":"megan guiney","email":"meganmguiney@gmail.com","username":"mguiney"},"change_message_id":"d09b67960d2fbdae6dc5406abe7c6caa0e96b617","unresolved":false,"context_lines":[{"line_number":8,"context_line":"import argparse"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"def process_flags(result):"},{"line_number":12,"context_line":"    if result.filename is None or not result.filename:"},{"line_number":13,"context_line":"        infile \u003d \"toadd.csv\""},{"line_number":14,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_f574b300","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":17},"in_reply_to":"5ff73747_80bae1bd","updated":"2017-05-02 18:51:02.000000000","message":"Done","commit_id":"979ea2bfb22c8d82737a08ac06baa0c5c9012b84"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"838d058ccdf3beec94d3e5d7eff0e10e04ea8610","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    try:"},{"line_number":58,"context_line":"        if \" \" in link:"},{"line_number":59,"context_line":"            return False"},{"line_number":60,"context_line":"        response \u003d urllib.request.urlopen(link)"},{"line_number":61,"context_line":"        if response.geturl() \u003d\u003d link:"},{"line_number":62,"context_line":"            return True"},{"line_number":63,"context_line":"    except urllib.error.HTTPError as err:"},{"line_number":64,"context_line":"        return False"},{"line_number":65,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_e3852fae","line":62,"range":{"start_line":60,"start_character":8,"end_line":62,"end_character":23},"updated":"2017-05-02 07:01:12.000000000","message":"Perhaps stick with the requests library here and do:\nresp \u003d requests.get(link, headers\u003d{\u0027Authorization\u0027: \u0027Bearer \u0027 + token})\n\nThen return True if resp.status_code \u003d 200","commit_id":"979ea2bfb22c8d82737a08ac06baa0c5c9012b84"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"838d058ccdf3beec94d3e5d7eff0e10e04ea8610","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"def updateResult(apiLink, testId, server, target, guideline):"},{"line_number":68,"context_line":"    resp \u003d requests.post(apiLink + \u0027/meta/shared\u0027, data\u003d\u0027true\u0027)"},{"line_number":69,"context_line":"    resp \u003d requests.post(apiLink + \u0027/meta/guideline\u0027, data\u003dguideline)"},{"line_number":70,"context_line":"    resp \u003d requests.post(apiLink + \u0027/meta/target\u0027, data\u003dtarget)"},{"line_number":71,"context_line":"    print(\"test result updated. Verifying.\\n\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_83f2eb6e","line":68,"range":{"start_line":68,"start_character":4,"end_line":68,"end_character":63},"updated":"2017-05-02 07:01:12.000000000","message":"Every request to the server will need the token in the headers. This can be easily done like:\n\nrequests.post(apiLink + \u0027/meta/shared\u0027, headers\u003d{\u0027Authorization\u0027: \u0027Bearer \u0027 + token}, data\u003d\u0027true\u0027)","commit_id":"979ea2bfb22c8d82737a08ac06baa0c5c9012b84"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"838d058ccdf3beec94d3e5d7eff0e10e04ea8610","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        \"Update the internal RefStack db using a csv file\")"},{"line_number":78,"context_line":"    parser.add_argument(\"--file\", \"-f\", metavar\u003d\u0027f\u0027, type\u003dstr,"},{"line_number":79,"context_line":"                        action\u003d\"store\", dest\u003d\"filename\", default\u003d\"toadd.csv\")"},{"line_number":80,"context_line":"    parser.add_argument(\"--server\", \"-s\", metavar\u003d\u0027s\u0027,"},{"line_number":81,"context_line":"                        type\u003dstr, action\u003d\"store\", dest\u003d\"server\")"},{"line_number":82,"context_line":"    parser.add_argument(\"--token\", \"-t\", metavar\u003d\"t\", type\u003dstr,"},{"line_number":83,"context_line":"                        action\u003d\"store\", dest\u003d\"token\", required\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_4c33f562","line":80,"range":{"start_line":80,"start_character":25,"end_line":80,"end_character":33},"updated":"2017-05-02 07:01:12.000000000","message":"Let\u0027s have this be something like --endpoint instead where we pass in the base URL of the API (e.g. --endpoint\u003dhttp://myrefstack.com/v1)\n\nWe don\u0027t want to assume that the user is using https or has \u0027/api/\u0027 in the endpoint URL.\n\nSo, then when constructing the full endpoint, you\u0027d use:\n\napiLink \u003d os.path.join(endpoint, \u0027results\u0027, testId)\n\nUsing os.path.join is better for forming paths from multiple components.","commit_id":"979ea2bfb22c8d82737a08ac06baa0c5c9012b84"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"838d058ccdf3beec94d3e5d7eff0e10e04ea8610","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    infile, server, token \u003d process_flags(result)"},{"line_number":86,"context_line":"    with open(infile) as f:"},{"line_number":87,"context_line":"        try:"},{"line_number":88,"context_line":"            authcmd \u003d \" curl -k --header \\\"Authorization: Bearer \\\"\" + \\"},{"line_number":89,"context_line":"                token + \"\\\"\\\" \" + server + \"/v1/profile\""},{"line_number":90,"context_line":"            authcmd \u003d authcmd.split()"},{"line_number":91,"context_line":"            response \u003d subprocess.Popen("},{"line_number":92,"context_line":"                authcmd, stdout\u003dsubprocess.PIPE, stderr\u003dsubprocess.PIPE)"},{"line_number":93,"context_line":"            result \u003d str(response.communicate())"},{"line_number":94,"context_line":"            if \"Found\" not in result or \"404\" in result:"},{"line_number":95,"context_line":"                print(\"Authentication Failure. Exiting.\")"},{"line_number":96,"context_line":"                sys.exit()"},{"line_number":97,"context_line":"        except Exception as err:"},{"line_number":98,"context_line":"            print(\"cannot authenticate to RefStack API: \" + str(err))"},{"line_number":99,"context_line":"            sys.exit()"},{"line_number":100,"context_line":"        time.sleep(2)"},{"line_number":101,"context_line":"        print(\"\\n\")"},{"line_number":102,"context_line":"        for line in f:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_23de773d","line":99,"range":{"start_line":88,"start_character":12,"end_line":99,"end_character":22},"updated":"2017-05-02 07:01:12.000000000","message":"Don\u0027t need this, as this is just sending a get request to the profile endpoint.","commit_id":"979ea2bfb22c8d82737a08ac06baa0c5c9012b84"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"838d058ccdf3beec94d3e5d7eff0e10e04ea8610","unresolved":false,"context_lines":[{"line_number":108,"context_line":"            else:"},{"line_number":109,"context_line":"                apiLink \u003d convertLink(server, testId)"},{"line_number":110,"context_line":"                if linkChk(apiLink):"},{"line_number":111,"context_line":"                    print(\"link is valid. Updating.\")"},{"line_number":112,"context_line":"                    updateResult(apiLink, testId, server, target, guideline)"},{"line_number":113,"context_line":"                else:"},{"line_number":114,"context_line":"                    print(\"the test result \" + testId +"}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_03801bf4","line":111,"range":{"start_line":111,"start_character":20,"end_line":111,"end_character":25},"updated":"2017-05-02 07:01:12.000000000","message":"Should also print the testID here,","commit_id":"979ea2bfb22c8d82737a08ac06baa0c5c9012b84"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"2bf3343b2bad6d3d0fd2c64caea7e3b82b79b6f3","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/python"},{"line_number":2,"context_line":"import time"},{"line_number":3,"context_line":"import sys"},{"line_number":4,"context_line":"import subprocess"},{"line_number":5,"context_line":"import requests"},{"line_number":6,"context_line":"import argparse"},{"line_number":7,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_0e0149b0","line":4,"range":{"start_line":2,"start_character":0,"end_line":4,"end_character":17},"updated":"2017-05-02 20:22:09.000000000","message":"These can be removed as they are no longer being used.","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"2bf3343b2bad6d3d0fd2c64caea7e3b82b79b6f3","unresolved":false,"context_lines":[{"line_number":3,"context_line":"import sys"},{"line_number":4,"context_line":"import subprocess"},{"line_number":5,"context_line":"import requests"},{"line_number":6,"context_line":"import argparse"},{"line_number":7,"context_line":""},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"def getData(entry):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_6eed6d8a","line":6,"updated":"2017-05-02 20:22:09.000000000","message":"import os here as well.","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"e6e99e3191ea3668f5350e1c392c253782c419d1","unresolved":false,"context_lines":[{"line_number":14,"context_line":"        refstackLink \u003d None"},{"line_number":15,"context_line":"        testId \u003d None"},{"line_number":16,"context_line":"    if entry[4] is not \"\" and entry[4] is not \" \":"},{"line_number":17,"context_line":"        guideline \u003d entry[4]"},{"line_number":18,"context_line":"    else:"},{"line_number":19,"context_line":"        guideline \u003d None"},{"line_number":20,"context_line":"    if entry[5] is not \"\" and entry[5] is not \" \":"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_be65c3e3","line":17,"range":{"start_line":17,"start_character":8,"end_line":17,"end_character":28},"updated":"2017-05-03 18:19:27.000000000","message":"Should have some validity check to make sure that the guideline is one of the following:\n\n2015.03, 2015.04, 2015.05, 2015.07, 2016.01, 2016.08, 2017.01","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"e6e99e3191ea3668f5350e1c392c253782c419d1","unresolved":false,"context_lines":[{"line_number":18,"context_line":"    else:"},{"line_number":19,"context_line":"        guideline \u003d None"},{"line_number":20,"context_line":"    if entry[5] is not \"\" and entry[5] is not \" \":"},{"line_number":21,"context_line":"        target \u003d entry[5]"},{"line_number":22,"context_line":"    else:"},{"line_number":23,"context_line":"        target \u003d None"},{"line_number":24,"context_line":"    return testId, guideline, target"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_5e36bfb6","line":21,"range":{"start_line":21,"start_character":8,"end_line":21,"end_character":25},"updated":"2017-05-03 18:19:27.000000000","message":"target to be updated should be one of the following\n\nplatform, compute, object\n\n@megan: what are the values in column 5 of the csv?  You may need some mapping routine so that the correct values will be used to update the meta table.","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"e6e99e3191ea3668f5350e1c392c253782c419d1","unresolved":false,"context_lines":[{"line_number":32,"context_line":"        if \" \" in link:"},{"line_number":33,"context_line":"            return False"},{"line_number":34,"context_line":"        response \u003d requests.get("},{"line_number":35,"context_line":"            link, headers\u003d{\u0027Authorization\u0027: \u0027Bearer\u0027 + token})"},{"line_number":36,"context_line":"        if response.status_code is 200:"},{"line_number":37,"context_line":"            return True"},{"line_number":38,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_831750ee","line":35,"range":{"start_line":35,"start_character":45,"end_line":35,"end_character":52},"updated":"2017-05-03 18:19:27.000000000","message":"\u0027Bearer\u0027 --\u003e \u0027Bearer \u0027 (add a trailing space), otherwise the request would return with 400 error code.","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"2bf3343b2bad6d3d0fd2c64caea7e3b82b79b6f3","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            return True"},{"line_number":38,"context_line":"        else:"},{"line_number":39,"context_line":"            return False"},{"line_number":40,"context_line":"    except request.exceptions as err:"},{"line_number":41,"context_line":"        print(err)"},{"line_number":42,"context_line":"        return False"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_6eb9ede7","line":40,"range":{"start_line":40,"start_character":11,"end_line":40,"end_character":18},"updated":"2017-05-02 20:22:09.000000000","message":"requests","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"2bf3343b2bad6d3d0fd2c64caea7e3b82b79b6f3","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        return False"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"def updateResult(apiLink, testId, server, target, guideline, token):"},{"line_number":46,"context_line":"    resp \u003d requests.post(apiLink + \u0027/meta/shared\u0027, headers\u003d{"},{"line_number":47,"context_line":"                         \u0027Authorization\u0027: \u0027Bearer\u0027 + token}, data\u003d\u0027true\u0027)"},{"line_number":48,"context_line":"    resp \u003d requests.post(apiLink + \u0027/meta/guideline\u0027, headers\u003d{"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_cec5a10c","line":45,"range":{"start_line":45,"start_character":26,"end_line":45,"end_character":40},"updated":"2017-05-02 20:22:09.000000000","message":"Can remove these.","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"2bf3343b2bad6d3d0fd2c64caea7e3b82b79b6f3","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"def updateResult(apiLink, testId, server, target, guideline, token):"},{"line_number":46,"context_line":"    resp \u003d requests.post(apiLink + \u0027/meta/shared\u0027, headers\u003d{"},{"line_number":47,"context_line":"                         \u0027Authorization\u0027: \u0027Bearer\u0027 + token}, data\u003d\u0027true\u0027)"},{"line_number":48,"context_line":"    resp \u003d requests.post(apiLink + \u0027/meta/guideline\u0027, headers\u003d{"},{"line_number":49,"context_line":"                         \u0027Authorization\u0027: \u0027Bearer\u0027 + token}, data\u003dguideline)"},{"line_number":50,"context_line":"    resp \u003d requests.post(apiLink + \u0027/meta/target\u0027, headers\u003d{"},{"line_number":51,"context_line":"                         \u0027Authorization\u0027: \u0027Bearer\u0027 + token}, data\u003dtarget)"},{"line_number":52,"context_line":"    print(\"test result updated. Verifying.\\n\")"},{"line_number":53,"context_line":"    resp \u003d requests.put(apiLink, headers\u003d{"},{"line_number":54,"context_line":"                        \u0027Authorization\u0027: \u0027Bearer\u0027 + token}, data\u003d{\u0027verification_status\u0027: 1})"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_4ea19195","line":51,"range":{"start_line":46,"start_character":4,"end_line":51,"end_character":73},"updated":"2017-05-02 20:22:09.000000000","message":"Should probably check if the response status_code is 201 after each post to ensure that the change occurred. Else return False to denote a failed update.","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"2bf3343b2bad6d3d0fd2c64caea7e3b82b79b6f3","unresolved":false,"context_lines":[{"line_number":49,"context_line":"                         \u0027Authorization\u0027: \u0027Bearer\u0027 + token}, data\u003dguideline)"},{"line_number":50,"context_line":"    resp \u003d requests.post(apiLink + \u0027/meta/target\u0027, headers\u003d{"},{"line_number":51,"context_line":"                         \u0027Authorization\u0027: \u0027Bearer\u0027 + token}, data\u003dtarget)"},{"line_number":52,"context_line":"    print(\"test result updated. Verifying.\\n\")"},{"line_number":53,"context_line":"    resp \u003d requests.put(apiLink, headers\u003d{"},{"line_number":54,"context_line":"                        \u0027Authorization\u0027: \u0027Bearer\u0027 + token}, data\u003d{\u0027verification_status\u0027: 1})"},{"line_number":55,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_ce048181","line":52,"range":{"start_line":52,"start_character":42,"end_line":52,"end_character":44},"updated":"2017-05-02 20:22:09.000000000","message":"Don\u0027t think we need an additional newline in the print statements since print automatically prints one.","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"2bf3343b2bad6d3d0fd2c64caea7e3b82b79b6f3","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    resp \u003d requests.post(apiLink + \u0027/meta/target\u0027, headers\u003d{"},{"line_number":51,"context_line":"                         \u0027Authorization\u0027: \u0027Bearer\u0027 + token}, data\u003dtarget)"},{"line_number":52,"context_line":"    print(\"test result updated. Verifying.\\n\")"},{"line_number":53,"context_line":"    resp \u003d requests.put(apiLink, headers\u003d{"},{"line_number":54,"context_line":"                        \u0027Authorization\u0027: \u0027Bearer\u0027 + token}, data\u003d{\u0027verification_status\u0027: 1})"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_8eb0b9df","line":53,"range":{"start_line":53,"start_character":4,"end_line":53,"end_character":8},"updated":"2017-05-02 20:22:09.000000000","message":"Same here. Check that resp.status_code is 201, then return True.","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"e6e99e3191ea3668f5350e1c392c253782c419d1","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    parser.add_argument("},{"line_number":63,"context_line":"        \"--endpoint\", \"-e\", metavar\u003d\u0027s\u0027, type\u003dstr, action\u003d\"store\","},{"line_number":64,"context_line":"                        required\u003dTrue, help\u003d\"the base URL of the endpoint. ex: http://examplerefstack.com/v1\")"},{"line_number":65,"context_line":"    parser.add_argument(\"--token\", \"-t\", metavar\u003d\"t\", type\u003dstr,"},{"line_number":66,"context_line":"                        action\u003d\"store\", required\u003dTrue, help\u003d\"API auth token\")"},{"line_number":67,"context_line":"    result \u003d parser.parse_args()"},{"line_number":68,"context_line":"    infile \u003d result.file"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_e3f734d4","line":65,"range":{"start_line":65,"start_character":25,"end_line":65,"end_character":32},"updated":"2017-05-03 18:19:27.000000000","message":"The way this script is written, the jwt token is created somewhere else and then passes into the script.  Is there concern that the token could expire before all the jobs are done in the script?","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"4062564f4f3ed8389d7bcbdd4c12c1f0cafd831c","unresolved":false,"context_lines":[{"line_number":77,"context_line":"                print("},{"line_number":78,"context_line":"                    \"Cannot update \u0026 verify test result due to missing data.\\n\")"},{"line_number":79,"context_line":"            else:"},{"line_number":80,"context_line":"                apiLink \u003d os.join(endpoint, \u0027/results/\u0027 + testId)"},{"line_number":81,"context_line":"                if linkChk(apiLink, token):"},{"line_number":82,"context_line":"                    print("},{"line_number":83,"context_line":"                        \"Result link is valid. Updating the result with the ID \" + testId + \"\\n\")"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_856e54c7","line":80,"range":{"start_line":80,"start_character":44,"end_line":80,"end_character":55},"updated":"2017-05-03 16:43:34.000000000","message":"\u0027/results/\u0027 --\u003e \u0027results\u0027","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"4062564f4f3ed8389d7bcbdd4c12c1f0cafd831c","unresolved":false,"context_lines":[{"line_number":77,"context_line":"                print("},{"line_number":78,"context_line":"                    \"Cannot update \u0026 verify test result due to missing data.\\n\")"},{"line_number":79,"context_line":"            else:"},{"line_number":80,"context_line":"                apiLink \u003d os.join(endpoint, \u0027/results/\u0027 + testId)"},{"line_number":81,"context_line":"                if linkChk(apiLink, token):"},{"line_number":82,"context_line":"                    print("},{"line_number":83,"context_line":"                        \"Result link is valid. Updating the result with the ID \" + testId + \"\\n\")"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_855534fd","line":80,"range":{"start_line":80,"start_character":26,"end_line":80,"end_character":33},"updated":"2017-05-03 16:43:34.000000000","message":"os.join should be os.path.join","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"2bf3343b2bad6d3d0fd2c64caea7e3b82b79b6f3","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                if linkChk(apiLink, token):"},{"line_number":82,"context_line":"                    print("},{"line_number":83,"context_line":"                        \"Result link is valid. Updating the result with the ID \" + testId + \"\\n\")"},{"line_number":84,"context_line":"                    updateResult("},{"line_number":85,"context_line":"                        apiLink, testId, server, target, guideline, token)"},{"line_number":86,"context_line":"                else:"},{"line_number":87,"context_line":"                    print(\"the test result \" + testId +"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_2e23e507","line":84,"range":{"start_line":84,"start_character":20,"end_line":84,"end_character":32},"updated":"2017-05-02 20:22:09.000000000","message":"With the above checks in updateResult, now if this returns false, print a message saying it failed to update/verify the testId.","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"2bf3343b2bad6d3d0fd2c64caea7e3b82b79b6f3","unresolved":false,"context_lines":[{"line_number":82,"context_line":"                    print("},{"line_number":83,"context_line":"                        \"Result link is valid. Updating the result with the ID \" + testId + \"\\n\")"},{"line_number":84,"context_line":"                    updateResult("},{"line_number":85,"context_line":"                        apiLink, testId, server, target, guideline, token)"},{"line_number":86,"context_line":"                else:"},{"line_number":87,"context_line":"                    print(\"the test result \" + testId +"},{"line_number":88,"context_line":"                          \" cannot be verified due to a broken result link.\\n\")"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_2ed645c5","line":85,"range":{"start_line":85,"start_character":33,"end_line":85,"end_character":47},"updated":"2017-05-02 20:22:09.000000000","message":"Can remove these.","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"f1f0429f9fd87330c9360cc36e31c1ba2ff0a2a2","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    response \u003d requests.post(apiLink + \u0027/meta/shared\u0027, headers\u003d{"},{"line_number":49,"context_line":"                         \u0027Authorization\u0027: \u0027Bearer \u0027 + token}, data\u003d\u0027true\u0027)"},{"line_number":50,"context_line":"    if response.status_code is not 201:"},{"line_number":51,"context_line":"        return False"},{"line_number":52,"context_line":"    response \u003d requests.post(apiLink + \u0027/meta/guideline\u0027, headers\u003d{"},{"line_number":53,"context_line":"                         \u0027Authorization\u0027: \u0027Bearer \u0027 + token}, data\u003dguideline)"},{"line_number":54,"context_line":"    if response.status_code is not 201:"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f044301_f48d95d3","line":51,"updated":"2017-05-05 23:50:20.000000000","message":"Not sure if Chris\u0027s spreadsheet has guidelines listed with or without the .json extension, but the refstack-ui assumes that the guideline has the json extension. So let\u0027s add a simple check before the guideline post request to see if we need to append \".json\"\n\n    if \u0027json\u0027 not in guideline:\n        guideline +\u003d \u0027.json\u0027","commit_id":"093896da6d94d3853a1557374b42257c56c1183c"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"f1f0429f9fd87330c9360cc36e31c1ba2ff0a2a2","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    print(\"test result updated. Verifying.\")"},{"line_number":61,"context_line":"    response \u003d requests.put(apiLink, headers\u003d{"},{"line_number":62,"context_line":"                        \u0027Authorization\u0027: \u0027Bearer \u0027 + token},"},{"line_number":63,"context_line":"                        data\u003d{\u0027verification_status\u0027: 1})"},{"line_number":64,"context_line":"    if reponse.status_code is not 201:"},{"line_number":65,"context_line":"        return False"},{"line_number":66,"context_line":"    return True"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f044301_7473c5b2","line":63,"range":{"start_line":63,"start_character":24,"end_line":63,"end_character":56},"updated":"2017-05-05 23:50:20.000000000","message":"Change data to json so it is json\u003d{\u0027verification_status\u0027: 1} since we are passing in a dict.","commit_id":"093896da6d94d3853a1557374b42257c56c1183c"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"f1f0429f9fd87330c9360cc36e31c1ba2ff0a2a2","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    response \u003d requests.put(apiLink, headers\u003d{"},{"line_number":62,"context_line":"                        \u0027Authorization\u0027: \u0027Bearer \u0027 + token},"},{"line_number":63,"context_line":"                        data\u003d{\u0027verification_status\u0027: 1})"},{"line_number":64,"context_line":"    if reponse.status_code is not 201:"},{"line_number":65,"context_line":"        return False"},{"line_number":66,"context_line":"    return True"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f044301_f1724749","line":64,"range":{"start_line":64,"start_character":7,"end_line":64,"end_character":14},"updated":"2017-05-05 23:50:20.000000000","message":"Typo: response","commit_id":"093896da6d94d3853a1557374b42257c56c1183c"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"f1f0429f9fd87330c9360cc36e31c1ba2ff0a2a2","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            entry \u003d line.split(\",\")"},{"line_number":89,"context_line":"            testId, guideline, target \u003d getData(entry)"},{"line_number":90,"context_line":"            if testId is None or guideline is None or target is None:"},{"line_number":91,"context_line":"                print("},{"line_number":92,"context_line":"                    \"Cannot update \u0026 verify test result due to missing data.\")"},{"line_number":93,"context_line":"            else:"},{"line_number":94,"context_line":"                apiLink \u003d os.join(endpoint, \u0027results\u0027 + testId)"},{"line_number":95,"context_line":"                if linkChk(apiLink, token):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f044301_d405f9c3","line":92,"range":{"start_line":91,"start_character":16,"end_line":92,"end_character":78},"updated":"2017-05-05 23:50:20.000000000","message":"In the for loop, let\u0027s keep track of the current line number and print that out here to ease with debugging.\n\nprint(\"Cannot update \u0026 verify test result due \"\n      \"to missing data. (Line %d of csv)\" % count)","commit_id":"093896da6d94d3853a1557374b42257c56c1183c"},{"author":{"_account_id":10526,"name":"Catherine Diep","email":"cdiep@us.ibm.com","username":"cdiep"},"change_message_id":"2bda84bed1ef66a7a90297a5abea9ba755ec881e","unresolved":false,"context_lines":[{"line_number":91,"context_line":"                print("},{"line_number":92,"context_line":"                    \"Cannot update \u0026 verify test result due to missing data.\")"},{"line_number":93,"context_line":"            else:"},{"line_number":94,"context_line":"                apiLink \u003d os.join(endpoint, \u0027results\u0027 + testId)"},{"line_number":95,"context_line":"                if linkChk(apiLink, token):"},{"line_number":96,"context_line":"                    print("},{"line_number":97,"context_line":"                        \"Result link is valid. Updating result with ID \" +"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f044301_de2e3a42","line":94,"range":{"start_line":94,"start_character":26,"end_line":94,"end_character":33},"updated":"2017-05-05 20:44:53.000000000","message":"This gives the following error:\nAttributeError: \u0027module\u0027 object has no attribute \u0027join\u0027\n\nIt should be os.path.join. Please also replace \u0027+\u0027 with \u0027,\u0027.  The link should look like:\n\napiLink \u003d os.path.join(endpoint, \u0027results\u0027, testId)","commit_id":"093896da6d94d3853a1557374b42257c56c1183c"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"a97be3e507add13d642eecfa3507144a861b38b3","unresolved":false,"context_lines":[{"line_number":4,"context_line":"import os"},{"line_number":5,"context_line":""},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"def getData(entry):"},{"line_number":8,"context_line":"    guidelines \u003d [\"2015.03\", \"2015.04\", \"2015.05\", \"2015.07\", \"2016.01\","},{"line_number":9,"context_line":"                  \"2016.08\", \"2017.01\"]"},{"line_number":10,"context_line":"    components \u003d [\"platform\", \"compute\", \"object\"]"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f044301_42322f12","line":7,"updated":"2017-05-08 19:11:04.000000000","message":"Lets add a check in this function for if the entry is missing the minimum number of columns or is just an empty line in the csv. (Just ran into this issue where I had an empty line and got an index error below)\n\nif len(entry) \u003c 10:\n    return None, None, None","commit_id":"08cc5efbb4c7bc2a9fc872d84b8c72c6eae09a92"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"a97be3e507add13d642eecfa3507144a861b38b3","unresolved":false,"context_lines":[{"line_number":23,"context_line":"    else:"},{"line_number":24,"context_line":"        target \u003d None"},{"line_number":25,"context_line":"    return testId, guideline, target"},{"line_number":26,"context_line":"    print(guideline)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"def linkChk(link, token):"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f044301_c2563f5d","line":26,"range":{"start_line":26,"start_character":4,"end_line":26,"end_character":20},"updated":"2017-05-08 19:11:04.000000000","message":"Let\u0027s remove this print statement.","commit_id":"08cc5efbb4c7bc2a9fc872d84b8c72c6eae09a92"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"a97be3e507add13d642eecfa3507144a861b38b3","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"def linkChk(link, token):"},{"line_number":30,"context_line":"    print(\"checking result with a test ID of: \" + link.split(\"/\")[-1])"},{"line_number":31,"context_line":"    if link is None or not link:"},{"line_number":32,"context_line":"        return False"},{"line_number":33,"context_line":"    try:"},{"line_number":34,"context_line":"        if \" \" in link:"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f044301_9593cfa3","line":31,"range":{"start_line":31,"start_character":4,"end_line":31,"end_character":31},"updated":"2017-05-08 19:11:04.000000000","message":"Can just do\n\"if not link:\"\n\nsince that will cover the check for if it is None as well.","commit_id":"08cc5efbb4c7bc2a9fc872d84b8c72c6eae09a92"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"a97be3e507add13d642eecfa3507144a861b38b3","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    with open(infile) as f:"},{"line_number":88,"context_line":"        for line in f:"},{"line_number":89,"context_line":"            linect \u003d linect + 1"},{"line_number":90,"context_line":"            entry \u003d []"},{"line_number":91,"context_line":"            entry \u003d line.split(\",\")"},{"line_number":92,"context_line":"            testId, guideline, target \u003d getData(entry)"},{"line_number":93,"context_line":"            if testId is None or guideline is None or target is None:"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f044301_1509ffdb","line":90,"range":{"start_line":90,"start_character":12,"end_line":90,"end_character":22},"updated":"2017-05-08 19:11:04.000000000","message":"Can remove this line.","commit_id":"08cc5efbb4c7bc2a9fc872d84b8c72c6eae09a92"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"a97be3e507add13d642eecfa3507144a861b38b3","unresolved":false,"context_lines":[{"line_number":92,"context_line":"            testId, guideline, target \u003d getData(entry)"},{"line_number":93,"context_line":"            if testId is None or guideline is None or target is None:"},{"line_number":94,"context_line":"                print("},{"line_number":95,"context_line":"                    \"entry found at line \" + linect + \" cannot be updated \" +"},{"line_number":96,"context_line":"                    \"and verified: entry incomplete.\")"},{"line_number":97,"context_line":"            else:"},{"line_number":98,"context_line":"                apiLink \u003d os.path.join(endpoint, \u0027results\u0027, testId)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f044301_829397fa","line":95,"range":{"start_line":95,"start_character":45,"end_line":95,"end_character":51},"updated":"2017-05-08 19:11:04.000000000","message":"Need to convert this int into a str so it can printed. Can just do str(linect).","commit_id":"08cc5efbb4c7bc2a9fc872d84b8c72c6eae09a92"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"a97be3e507add13d642eecfa3507144a861b38b3","unresolved":false,"context_lines":[{"line_number":103,"context_line":"                    success \u003d updateResult(apiLink, target, guideline, token)"},{"line_number":104,"context_line":"                    if not success:"},{"line_number":105,"context_line":"                        print(\"update of the results with the ID \" + testId +"},{"line_number":106,"context_line":"                              \" failed. please update alter your \" +"},{"line_number":107,"context_line":"                              \"spreadsheet and try again\")"},{"line_number":108,"context_line":"                else:"},{"line_number":109,"context_line":"                    print(\"the test result \" + testId +"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f044301_22504332","line":106,"range":{"start_line":106,"start_character":47,"end_line":106,"end_character":59},"updated":"2017-05-08 19:11:04.000000000","message":"update/alter","commit_id":"08cc5efbb4c7bc2a9fc872d84b8c72c6eae09a92"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"543268f8328c7f969d710fa04e30e185e9ddab9e","unresolved":false,"context_lines":[{"line_number":21,"context_line":"    else:"},{"line_number":22,"context_line":"        guideline \u003d None"},{"line_number":23,"context_line":"    if entry[5] is not \"\" and entry[5] is not \" \"and entry[5] in components:"},{"line_number":24,"context_line":"        target \u003d entry[5].tolower()"},{"line_number":25,"context_line":"        if target is \"storage\":"},{"line_number":26,"context_line":"            target \u003d \"object\""},{"line_number":27,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f044301_65918747","line":24,"range":{"start_line":24,"start_character":26,"end_line":24,"end_character":33},"updated":"2017-05-11 01:25:13.000000000","message":"Python uses .lower()","commit_id":"f1a9020a71939fcc36d5786c8b2ca5974407e7cb"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"543268f8328c7f969d710fa04e30e185e9ddab9e","unresolved":false,"context_lines":[{"line_number":22,"context_line":"        guideline \u003d None"},{"line_number":23,"context_line":"    if entry[5] is not \"\" and entry[5] is not \" \"and entry[5] in components:"},{"line_number":24,"context_line":"        target \u003d entry[5].tolower()"},{"line_number":25,"context_line":"        if target is \"storage\":"},{"line_number":26,"context_line":"            target \u003d \"object\""},{"line_number":27,"context_line":"    else:"},{"line_number":28,"context_line":"        target \u003d None"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f044301_45968b41","line":25,"range":{"start_line":25,"start_character":18,"end_line":25,"end_character":20},"updated":"2017-05-11 01:25:13.000000000","message":"For string value equality, use \u003d\u003d instead of is.","commit_id":"f1a9020a71939fcc36d5786c8b2ca5974407e7cb"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"d46b61caed96f3f45f68837225e6b12c45b6c338","unresolved":false,"context_lines":[{"line_number":10,"context_line":"    components \u003d [\"Platform\", \"Compute\", \"Storage\"]"},{"line_number":11,"context_line":"    if len(entry) \u003c 10:"},{"line_number":12,"context_line":"        return None, None, None"},{"line_number":13,"context_line":"    if entry[9] !\u003d \"\" and entry[9] !\u003d \" \""},{"line_number":14,"context_line":"        refstackLink \u003d entry[9]"},{"line_number":15,"context_line":"        testId \u003d refstackLink.split(\"/\")[-1]"},{"line_number":16,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f044301_edf9eec7","line":13,"range":{"start_line":13,"start_character":38,"end_line":13,"end_character":41},"updated":"2017-05-11 18:31:27.000000000","message":": after this.","commit_id":"114f622858011c4e899bc315953ffcc569209c59"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"d46b61caed96f3f45f68837225e6b12c45b6c338","unresolved":false,"context_lines":[{"line_number":38,"context_line":"            return False"},{"line_number":39,"context_line":"        response \u003d requests.get("},{"line_number":40,"context_line":"            link, headers\u003d{\u0027Authorization\u0027: \u0027Bearer \u0027 + token})"},{"line_number":41,"context_line":"        if response.status_code !\u003d 200:"},{"line_number":42,"context_line":"            return True"},{"line_number":43,"context_line":"        else:"},{"line_number":44,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f044301_8dfcaab5","line":41,"range":{"start_line":41,"start_character":32,"end_line":41,"end_character":34},"updated":"2017-05-11 18:31:27.000000000","message":"Should be \u003d\u003d","commit_id":"114f622858011c4e899bc315953ffcc569209c59"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"dd2a2b8e310a7b083f504483f06f20f166cd7f29","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        if response.status_code \u003d\u003d 200:"},{"line_number":43,"context_line":"            return json.loads(response.text)"},{"line_number":44,"context_line":"        else:"},{"line_number":45,"context_line":"            print(\"Link check response_status_code\u003d\" + response.status_code)"},{"line_number":46,"context_line":"            return False"},{"line_number":47,"context_line":"    except requests.exceptions as err:"},{"line_number":48,"context_line":"        print(err)"}],"source_content_type":"text/x-python","patch_set":12,"id":"ff0f0b1f_eb91209b","line":45,"range":{"start_line":45,"start_character":55,"end_line":45,"end_character":75},"updated":"2017-05-19 18:45:52.000000000","message":"Anytime you print the response.status_code, make sure you wrap it in str() or use the alternative string formatting like:\n\nprint(\"Link check response_status_code\u003d%d\" % response.status_code)","commit_id":"54553375decaa024c753f569a34521a3c83dcf13"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"dd2a2b8e310a7b083f504483f06f20f166cd7f29","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                        print("},{"line_number":116,"context_line":"                            \"Result link is valid. Updating result with ID \" +"},{"line_number":117,"context_line":"                            testId)"},{"line_number":118,"context_line":"                    success \u003d updateResult(apiLink, target, guideline, token)"},{"line_number":119,"context_line":"                    if not success:"},{"line_number":120,"context_line":"                        print(\"update of the results with the ID \" + testId +"},{"line_number":121,"context_line":"                              \" failed. please recheck your \" +"},{"line_number":122,"context_line":"                              \"spreadsheet and try again\")"},{"line_number":123,"context_line":"                else:"},{"line_number":124,"context_line":"                    print(\"the test result \" + testId +"},{"line_number":125,"context_line":"                          \" cannot be verified due to a broken result link.\")"}],"source_content_type":"text/x-python","patch_set":12,"id":"ff0f0b1f_4b2b6c2f","line":122,"range":{"start_line":118,"start_character":20,"end_line":122,"end_character":58},"updated":"2017-05-19 18:45:52.000000000","message":"Move these into the above else statement. So just down a layer.","commit_id":"54553375decaa024c753f569a34521a3c83dcf13"}],"tools/update-rs-db.rst":[{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"2bf3343b2bad6d3d0fd2c64caea7e3b82b79b6f3","unresolved":false,"context_lines":[{"line_number":5,"context_line":"This document contains some details that are neccessary to know to be"},{"line_number":6,"context_line":"successful in the usage of the script update-rs-db.py."},{"line_number":7,"context_line":""},{"line_number":8,"context_line":"The script beins by checking to see if your local refstack database"},{"line_number":9,"context_line":"contains any of the products documented in a csv. The"},{"line_number":10,"context_line":"columns in this spreadsheet are, in this order:"},{"line_number":11,"context_line":" - Company Name"},{"line_number":12,"context_line":" - Product Name"}],"source_content_type":"text/x-rst","patch_set":6,"id":"5ff73747_11be0eff","line":9,"range":{"start_line":8,"start_character":0,"end_line":9,"end_character":48},"updated":"2017-05-02 20:22:09.000000000","message":"Since we don\u0027t use products in the script anymore, this sentence can be removed. Then can have some intro sentence like \"This script updates RefStack tests as verified given a specific spreadsheet.\"","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"2bf3343b2bad6d3d0fd2c64caea7e3b82b79b6f3","unresolved":false,"context_lines":[{"line_number":31,"context_line":"The data is pulled from a csv file. The default csv name is toadd.csv,"},{"line_number":32,"context_line":"but using the -f flag, we can use csv of a different filename."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"The refstack database that we are pushing updates to is set, by default,"},{"line_number":35,"context_line":"to be the official refstack.org database. Because this is not a viable"},{"line_number":36,"context_line":"option for most use cases of this script, there is a -s flag which"},{"line_number":37,"context_line":"allows us to specify the server that we will be pushing updates to."},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"Because of recent changes that disallow the anonymous upload of results,"},{"line_number":40,"context_line":"we must now create and use an auth token to use the refstack API. This"}],"source_content_type":"text/x-rst","patch_set":6,"id":"5ff73747_b1507a0c","line":37,"range":{"start_line":34,"start_character":0,"end_line":37,"end_character":67},"updated":"2017-05-02 20:22:09.000000000","message":"Change this sentence to reflect the usage of --endpoint/-e as a required field for specifying which refstack API endpoint we will be using to update the DB.","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"2bf3343b2bad6d3d0fd2c64caea7e3b82b79b6f3","unresolved":false,"context_lines":[{"line_number":36,"context_line":"option for most use cases of this script, there is a -s flag which"},{"line_number":37,"context_line":"allows us to specify the server that we will be pushing updates to."},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"Because of recent changes that disallow the anonymous upload of results,"},{"line_number":40,"context_line":"we must now create and use an auth token to use the refstack API. This"},{"line_number":41,"context_line":"token can be generated by entering the command \"jwt --key\u003d\"$( cat \u003cpath"},{"line_number":42,"context_line":"to private key\u003e )\" --alg\u003dRS256 user_openid\u003d\u003copenstackid\u003e exp\u003d+100500\""},{"line_number":43,"context_line":"This generates a json web token, which we must link using the \"-t\" or"}],"source_content_type":"text/x-rst","patch_set":6,"id":"5ff73747_516816b9","line":40,"range":{"start_line":39,"start_character":0,"end_line":40,"end_character":64},"updated":"2017-05-02 20:22:09.000000000","message":"Should rather be \"Because editing arbitrary test results requires administrative privileges, an auth token must be used with the RefStack API.\"","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"2bf3343b2bad6d3d0fd2c64caea7e3b82b79b6f3","unresolved":false,"context_lines":[{"line_number":44,"context_line":"\"--token\" flag. Because we cannot auth without this token, the token"},{"line_number":45,"context_line":"is a required flag."},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"Once the script authenticates to the RefStack Api, it then goes through"},{"line_number":48,"context_line":"each line of the CSV, grabbing the refstack link, the guideline, and the"},{"line_number":49,"context_line":"component. It also uses the refstack result to get a test result Id."},{"line_number":50,"context_line":""}],"source_content_type":"text/x-rst","patch_set":6,"id":"5ff73747_d182e652","line":47,"range":{"start_line":47,"start_character":0,"end_line":47,"end_character":63},"updated":"2017-05-02 20:22:09.000000000","message":"Should rather be \"The script will go ...\" through each line of the CSV, grabbing...\n\nsince there is no specific authenticate step.","commit_id":"1c940e4e953582769ce52bd9f97aca44757e3617"},{"author":{"_account_id":9626,"name":"Paul Van Eck","email":"pvaneck@us.ibm.com","username":"pvaneck"},"change_message_id":"f1f0429f9fd87330c9360cc36e31c1ba2ff0a2a2","unresolved":false,"context_lines":[{"line_number":4,"context_line":""},{"line_number":5,"context_line":"This document contains some details that are neccessary to know to be"},{"line_number":6,"context_line":"successful in the usage of the script update-rs-db.py."},{"line_number":7,"context_line":""},{"line_number":8,"context_line":"This script updates RefStack tests as verified given a specific"},{"line_number":9,"context_line":"spreadsheet. The columns in this spreadsheet are, in this order:"},{"line_number":10,"context_line":" - Company Name"}],"source_content_type":"text/x-rst","patch_set":7,"id":"3f044301_142fe1a1","line":7,"updated":"2017-05-05 23:50:20.000000000","message":"Let\u0027s add an example usage line here.\n\nExample Usage:\n\n``./update-rs-db.py --file /tmp/mylist.csv --endpoint http://myrefstack.com:8000/v1 --token \u003cmy-token\u003e``","commit_id":"093896da6d94d3853a1557374b42257c56c1183c"}]}
