{"action":"closed","issue":{"url":"https://api.github.com/repos/ros-infrastructure/ros_buildfarm/issues/301","repository_url":"https://api.github.com/repos/ros-infrastructure/ros_buildfarm","labels_url":"https://api.github.com/repos/ros-infrastructure/ros_buildfarm/issues/301/labels{/name}","comments_url":"https://api.github.com/repos/ros-infrastructure/ros_buildfarm/issues/301/comments","events_url":"https://api.github.com/repos/ros-infrastructure/ros_buildfarm/issues/301/events","html_url":"https://github.com/ros-infrastructure/ros_buildfarm/issues/301","id":156828156,"number":301,"title":"get_wrapper_scripts is not robust to being run on an installed version of ros_buildfarm","user":{"login":"tfoote","id":447804,"avatar_url":"https://avatars.githubusercontent.com/u/447804?v=3","gravatar_id":"","url":"https://api.github.com/users/tfoote","html_url":"https://github.com/tfoote","followers_url":"https://api.github.com/users/tfoote/followers","following_url":"https://api.github.com/users/tfoote/following{/other_user}","gists_url":"https://api.github.com/users/tfoote/gists{/gist_id}","starred_url":"https://api.github.com/users/tfoote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfoote/subscriptions","organizations_url":"https://api.github.com/users/tfoote/orgs","repos_url":"https://api.github.com/users/tfoote/repos","events_url":"https://api.github.com/users/tfoote/events{/privacy}","received_events_url":"https://api.github.com/users/tfoote/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ros-infrastructure/ros_buildfarm/labels/in%20review","name":"in review","color":"ededed"}],"state":"closed","locked":false,"assignee":{"login":"dirk-thomas","id":1335366,"avatar_url":"https://avatars.githubusercontent.com/u/1335366?v=3","gravatar_id":"","url":"https://api.github.com/users/dirk-thomas","html_url":"https://github.com/dirk-thomas","followers_url":"https://api.github.com/users/dirk-thomas/followers","following_url":"https://api.github.com/users/dirk-thomas/following{/other_user}","gists_url":"https://api.github.com/users/dirk-thomas/gists{/gist_id}","starred_url":"https://api.github.com/users/dirk-thomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dirk-thomas/subscriptions","organizations_url":"https://api.github.com/users/dirk-thomas/orgs","repos_url":"https://api.github.com/users/dirk-thomas/repos","events_url":"https://api.github.com/users/dirk-thomas/events{/privacy}","received_events_url":"https://api.github.com/users/dirk-thomas/received_events","type":"User","site_admin":false},"assignees":[{"login":"dirk-thomas","id":1335366,"avatar_url":"https://avatars.githubusercontent.com/u/1335366?v=3","gravatar_id":"","url":"https://api.github.com/users/dirk-thomas","html_url":"https://github.com/dirk-thomas","followers_url":"https://api.github.com/users/dirk-thomas/followers","following_url":"https://api.github.com/users/dirk-thomas/following{/other_user}","gists_url":"https://api.github.com/users/dirk-thomas/gists{/gist_id}","starred_url":"https://api.github.com/users/dirk-thomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dirk-thomas/subscriptions","organizations_url":"https://api.github.com/users/dirk-thomas/orgs","repos_url":"https://api.github.com/users/dirk-thomas/repos","events_url":"https://api.github.com/users/dirk-thomas/events{/privacy}","received_events_url":"https://api.github.com/users/dirk-thomas/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-05-25T19:14:13Z","updated_at":"2016-08-10T16:04:36Z","closed_at":"2016-08-10T16:04:36Z","body":"I used a version of ros_buildfarm installed in a virtual env to reconfigure the job and it caused a regression of the doc independent jobs. \r\n\r\nThe method is here: https://github.com/ros-infrastructure/ros_buildfarm/blob/master/ros_buildfarm/templates/__init__.py#L149\r\n\r\nThe delta in the config is here: http://build.ros.org:8080/job/doc_independent-packages/jobConfigHistory/showDiffFiles?timestamp1=2016-04-20_11-47-03&timestamp2=2016-05-23_16-23-03\r\n\r\nIt replaced\r\n```\r\necho \"#!/usr/bin/env python3\\n\\nimport subprocess\\nimport sys\\nfrom time import sleep\\n\\n\\ndef main(argv=sys.argv[1:]):\\n    max_tries = 10\\n    known_error_strings = [\\n        'Connection timed out',\\n    ]\\n\\n    command = argv[0]\\n    if command == 'clone':\\n        rc, _, _ = call_git_repeatedly(\\n            argv, known_error_strings, max_tries)\\n        return rc\\n    else:\\n        assert \\\"Command '%s' not implemented\\\" % command\\n\\n\\ndef call_git_repeatedly(argv, known_error_strings, max_tries):\\n    command = argv[0]\\n    for i in range(1, max_tries + 1):\\n        if i > 1:\\n            sleep_time = 5 + 2 * i\\n            print(\\\"Reinvoke 'git %s' (%d/%d) after sleeping %s seconds\\\" %\\n                  (command, i, max_tries, sleep_time))\\n            sleep(sleep_time)\\n        rc, known_error_conditions = call_git(argv, known_error_strings)\\n        if rc == 0 or not known_error_conditions:\\n            break\\n        print('')\\n        print('Invocation failed due to the following known error conditions: '\\n              ', '.join(known_error_conditions))\\n        print('')\\n        # retry in case of failure with known error condition\\n    return rc, known_error_conditions, i\\n\\n\\ndef call_git(argv, known_error_strings):\\n    known_error_conditions = []\\n\\n    cmd = ['git'] + argv\\n    print(\\\"Invoking '%s'\\\" % ' '.join(cmd))\\n    proc = subprocess.Popen(\\n        cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)\\n    while True:\\n        line = proc.stdout.readline()\\n        if not line:\\n            break\\n        line = line.decode()\\n        sys.stdout.write(line)\\n        for known_error_string in known_error_strings:\\n            if known_error_string in line:\\n                if known_error_string not in known_error_conditions:\\n                    known_error_conditions.append(known_error_string)\\n    proc.wait()\\n    rc = proc.returncode\\n    return rc, known_error_conditions\\n\\n\\nif __name__ == '__main__':\\n    sys.exit(main())\" > wrapper_scripts/git.py\r\n```\r\n\r\nwith \r\n\r\n```\r\necho \"#!/home/tfoote/work/dbf/deploy_venv/bin/python\\n# EASY-INSTALL-SCRIPT: 'ros-buildfarm===1.1.1-master','git.py'\\n__requires__ = 'ros-buildfarm===1.1.1-master'\\n__import__('pkg_resources').run_script('ros-buildfarm===1.1.1-master', 'git.py')\" > wrapper_scripts/git.py\r\n```\r\n\r\nThese wrapper scripts should probably be stored using pkg_resources instead of being in the scripts directory.  "}}
{"actor":{"display_login":"dirk-thomas"}}