)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":27336,"name":"XiaojueGuan","email":"xiaojueguan@gmail.com","username":"XiaojueGuan"},"change_message_id":"80dce3739e5fa14dadfbadcbe4caaef3cee99951","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add support for custom validations"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch introduces support for running custom validations by changing the"},{"line_number":10,"context_line":"behavior of the validations actions ListValidationsAction, ListGroupsAction"},{"line_number":11,"context_line":"and RunValidationAction."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"3f79a3b5_17ad8430","line":9,"range":{"start_line":9,"start_character":73,"end_line":9,"end_character":76},"updated":"2018-08-09 00:51:16.000000000","message":"may you standardized your code arrangement and make on line short than 79 chars","commit_id":"62b5f99c899c61492f5c7aeb5fa06bf27aa55d59"}],"tripleo_common/utils/swift.py":[{"author":{"_account_id":28223,"name":"Cedric Jeanneret","display_name":"cjeanner (Tengu)","email":"cjeanner@redhat.com","username":"cjeanner"},"change_message_id":"6ba14bd3b58fef304bdb8576d8a910d9b323769a","unresolved":false,"context_lines":[{"line_number":72,"context_line":"                obj[\u0027last_modified\u0027]).strftime(\u0027%s\u0027))"},{"line_number":73,"context_line":"            last_mod_disk \u003d int(os.path.getmtime(path))"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"            if last_mod_swift \u003e last_mod_disk:"},{"line_number":76,"context_line":"                is_newer \u003d True"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        # write file if `overwrite_only_newer` is not set,"},{"line_number":79,"context_line":"        # or if file does not exist at destination,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_be69ebf8","line":76,"range":{"start_line":75,"start_character":1,"end_line":76,"end_character":31},"updated":"2018-07-03 12:16:24.000000000","message":"can be rewritten as is_newer \u003d (last_mod_swift \u003e last_mod_disk)","commit_id":"6b1bcc81083fa924ab732ba51f82b1012f912382"}],"tripleo_common/utils/validations.py":[{"author":{"_account_id":17888,"name":"Florian Fuchs","email":"f@florianfuchs.com","username":"flfuchs"},"change_message_id":"0eb4648b265e87f433b5bca613983c26a90f49f7","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"def download_validation(swift, plan, validation):"},{"line_number":109,"context_line":"    \"\"\"Downloads a validation from Swift to /tmp and returns the path\"\"\""},{"line_number":110,"context_line":"    filename \u003d \u0027{}.yaml\u0027.format(validation)"},{"line_number":111,"context_line":"    swift_path \u003d os.path.join(constants.CUSTOM_VALIDATIONS_FOLDER, filename)"},{"line_number":112,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_8d441049","line":109,"updated":"2018-06-07 15:52:00.000000000","message":"This downloads only the validation playbook file. But if the playbook uses custom modules/plugins/etc., the validation run will break -- unless I\u0027m missing something and the other validation files have already been loaded into the /tmp dir before...?","commit_id":"9fb5dd8cc7ccff452886a80d68b9e088cf579f0d"},{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"458c0cbba2766a0c3970c9ba25ed419b85402024","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"def download_validation(swift, plan, validation):"},{"line_number":109,"context_line":"    \"\"\"Downloads a validation from Swift to /tmp and returns the path\"\"\""},{"line_number":110,"context_line":"    filename \u003d \u0027{}.yaml\u0027.format(validation)"},{"line_number":111,"context_line":"    swift_path \u003d os.path.join(constants.CUSTOM_VALIDATIONS_FOLDER, filename)"},{"line_number":112,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_a13c1ec8","line":109,"in_reply_to":"5f7c97a3_4e5fb740","updated":"2018-06-12 14:22:02.000000000","message":"Done","commit_id":"9fb5dd8cc7ccff452886a80d68b9e088cf579f0d"},{"author":{"_account_id":17888,"name":"Florian Fuchs","email":"f@florianfuchs.com","username":"flfuchs"},"change_message_id":"6ff1d3b50f8cf016e6d7930b7ec02e302b2276c2","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"def download_validation(swift, plan, validation):"},{"line_number":109,"context_line":"    \"\"\"Downloads a validation from Swift to /tmp and returns the path\"\"\""},{"line_number":110,"context_line":"    filename \u003d \u0027{}.yaml\u0027.format(validation)"},{"line_number":111,"context_line":"    swift_path \u003d os.path.join(constants.CUSTOM_VALIDATIONS_FOLDER, filename)"},{"line_number":112,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_4e5fb740","line":109,"in_reply_to":"5f7c97a3_857ff215","updated":"2018-06-08 16:35:02.000000000","message":"Swift API responses for containers contain info on the last modification time for each of its objects.\n\nSo before we download the whole container we could:\n\na) Make a container request to Swift to get the list of objects.\nb) Check if there already is a tmp-directory containing the validations for a certain plan.\nc) Use the last-modified info from the container request to compare that to the timestamps in the existing directory (if there is one).\n\nIf we find that the latest timestamp on disk is newer than the latest one in the container request we skip the object download.\n\nDoes that make sense?","commit_id":"9fb5dd8cc7ccff452886a80d68b9e088cf579f0d"},{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"89ecf84fca474eaf280618df091103259529ceef","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"def download_validation(swift, plan, validation):"},{"line_number":109,"context_line":"    \"\"\"Downloads a validation from Swift to /tmp and returns the path\"\"\""},{"line_number":110,"context_line":"    filename \u003d \u0027{}.yaml\u0027.format(validation)"},{"line_number":111,"context_line":"    swift_path \u003d os.path.join(constants.CUSTOM_VALIDATIONS_FOLDER, filename)"},{"line_number":112,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_857ff215","line":109,"in_reply_to":"5f7c97a3_8d441049","updated":"2018-06-08 14:00:00.000000000","message":"New version now downloads the whole container on each validation run, which works but is not very efficient. Ideas how to improve this are welcome.","commit_id":"9fb5dd8cc7ccff452886a80d68b9e088cf579f0d"},{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"0c7a1c8977181f369d564746c92e7d0ec3cce3d1","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"def load_validations(groups\u003dNone):"},{"line_number":46,"context_line":"    \u0027\u0027\u0027Loads all validations.\u0027\u0027\u0027"},{"line_number":47,"context_line":"    paths \u003d glob.glob(\u0027{}/*.yaml\u0027.format(constants.DEFAULT_VALIDATIONS_PATH))"},{"line_number":48,"context_line":"    results \u003d []"},{"line_number":49,"context_line":"    for validation_path in sorted(paths):"},{"line_number":50,"context_line":"        with open(validation_path) as f:"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_15333064","side":"PARENT","line":47,"updated":"2018-06-19 22:04:04.000000000","message":"It would still be useful to keep being able to load validations from the local disk as an option.  Can we not remove that? Also it wouldn\u0027t be backwards compatible to just drop it.  I\u0027m thinking the standalone method of deployment won\u0027t have swift/mistral so if we wanted to leverage validations we cannot.","commit_id":"7ed48476c2abb06aee42d89e384aae376832102b"},{"author":{"_account_id":13039,"name":"Martin André","email":"m.andre@redhat.com","username":"mandre"},"change_message_id":"8e5734072e45414944051cc5e18701c733205f9d","unresolved":false,"context_lines":[{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    # Get default validations"},{"line_number":98,"context_line":"    container \u003d constants.VALIDATIONS_CONTAINER_NAME"},{"line_number":99,"context_line":"    objects \u003d swift.get_container(container)[1]"},{"line_number":100,"context_line":"    results \u003d _get_validations_from_swift(swift, container, objects, groups,"},{"line_number":101,"context_line":"                                          results, skip_existing\u003dTrue)"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_a0dd5371","line":99,"updated":"2018-08-09 12:57:30.000000000","message":"You should make it more robust against missing swift containers. As we\u0027ve seen, it\u0027s possible the validations were never uploaded to swift, or that the container was later removed.","commit_id":"ed77c00bc53ee3d4d9e18ddcf55a14d5b6ac7882"},{"author":{"_account_id":28223,"name":"Cedric Jeanneret","display_name":"cjeanner (Tengu)","email":"cjeanner@redhat.com","username":"cjeanner"},"change_message_id":"9e335a494d11330277d77a4ab29ea72949608ad6","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        LOG.exception(\"Failed to get validation metadata.\")"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"def _get_validations_from_swift(swift, container, objects, groups, results,"},{"line_number":47,"context_line":"                                skip_existing\u003dFalse):"},{"line_number":48,"context_line":"    existing_ids \u003d [validation[\u0027id\u0027] for validation in results]"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_0f028f0c","line":46,"updated":"2018-08-29 05:27:37.000000000","message":"Hm so this locks out any possibility to NOT use swift/mistral right? Maybe not that great, seeing the validation framework spec.\nAnyway, we can come to that later, once the spec is OK.","commit_id":"8f88e7877835f7baa981e978f0d8f665fb6264c5"}]}
