)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":18002,"name":"John Fulton","email":"fulton@redhat.com","username":"fultonj"},"change_message_id":"c956d16f352e29d1f77de1d5b117e49278dfa280","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Giulio Fidente \u003cgfidente@redhat.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2020-08-26 17:07:20 +0200"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Make check_hieradata fail on empty values of ceph::profile::params::osds"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Previously the check would stop the deployment if the hieradata was set"},{"line_number":10,"context_line":"even if valued to empty hash or string. This patch changes the check"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9f560f44_7a93d14f","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":72},"updated":"2020-08-26 15:30:11.000000000","message":"Please add a \"not\" to the above. \n\nI.e. \"Make check_hieradata not fail on empty values of ceph::profile::params::osds\"\n\nSince AFAICT this code will make it so that the deployment doesn\u0027t fail if someone sets \"ceph::profile::params::osds: {}\", which is good (that\u0027s what we want). We just need the commit message to say it.","commit_id":"acb4bfd162ba42dfb5b7e1ab89b4bc195ecc49b3"},{"author":{"_account_id":18002,"name":"John Fulton","email":"fulton@redhat.com","username":"fultonj"},"change_message_id":"c956d16f352e29d1f77de1d5b117e49278dfa280","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Previously the check would stop the deployment if the hieradata was set"},{"line_number":10,"context_line":"even if valued to empty hash or string. This patch changes the check"},{"line_number":11,"context_line":"so that it will pass if the hieradata is found but set to empty values."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Closes-Bug: 1893066"},{"line_number":14,"context_line":"Change-Id: I183731c81fe5ea40f32f82c48f7053eae6eaed1e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9f560f44_3abe79ad","line":12,"updated":"2020-08-26 15:30:11.000000000","message":"Please add a note on why this is going directly into queens. I know why, because this workflow isn\u0027t run in newer versions (technically it\u0027s run in rocky though) but we should say so in the commit message.","commit_id":"acb4bfd162ba42dfb5b7e1ab89b4bc195ecc49b3"}],"workbooks/ceph-ansible.yaml":[{"author":{"_account_id":6796,"name":"Giulio Fidente","email":"gfidente@redhat.com","username":"gfidente"},"change_message_id":"24fc95e62e0e7f14ac8ef0b431ceeb954bd11a76","unresolved":false,"context_lines":[{"line_number":34,"context_line":"      collect_puppet_hieradata:"},{"line_number":35,"context_line":"        on-success: check_hieradata"},{"line_number":36,"context_line":"        publish:"},{"line_number":37,"context_line":"          hieradata: \u003c% env().get(\u0027role_merged_configs\u0027, {}).values().where($ !\u003d null).where($.get(\u0027ceph::profile::params::osds\u0027)).first({}).get(\u0027ceph::profile::params::osds\u0027, {}) %\u003e"},{"line_number":38,"context_line":"      check_hieradata:"},{"line_number":39,"context_line":"        on-success:"},{"line_number":40,"context_line":"        - set_blacklisted_ips: \u003c% not bool($.hieradata) %\u003e"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"9f560f44_fac1a181","line":37,"updated":"2020-08-26 15:15:31.000000000","message":"fwiw this is the test input data I tried this with:\n\n`\nrole_merged_configs:\n  ceph:\n    ceph::profile::params::osds: {}\n    nested:\n      dict: ciao\n  compute:\n    key: val\n`","commit_id":"acb4bfd162ba42dfb5b7e1ab89b4bc195ecc49b3"},{"author":{"_account_id":18002,"name":"John Fulton","email":"fulton@redhat.com","username":"fultonj"},"change_message_id":"9d1d8c2569e48815d67d1fdbb015978ff9e9a429","unresolved":false,"context_lines":[{"line_number":34,"context_line":"      collect_puppet_hieradata:"},{"line_number":35,"context_line":"        on-success: check_hieradata"},{"line_number":36,"context_line":"        publish:"},{"line_number":37,"context_line":"          hieradata: \u003c% env().get(\u0027role_merged_configs\u0027, {}).values().where($ !\u003d null).where($.get(\u0027ceph::profile::params::osds\u0027)).first({}).get(\u0027ceph::profile::params::osds\u0027, {}) %\u003e"},{"line_number":38,"context_line":"      check_hieradata:"},{"line_number":39,"context_line":"        on-success:"},{"line_number":40,"context_line":"        - set_blacklisted_ips: \u003c% not bool($.hieradata) %\u003e"},{"line_number":41,"context_line":"        - fail(msg\u003d\u003c% \u0027Ceph deployment stopped, puppet-ceph hieradata found for ceph::profile::params::osds. Convert it to ceph-ansible variables. {0}\u0027.format($.hieradata) %\u003e): \u003c% bool($.hieradata) %\u003e"},{"line_number":42,"context_line":"      set_blacklisted_ips:"},{"line_number":43,"context_line":"        publish:"},{"line_number":44,"context_line":"          blacklisted_ips: \u003c% env().get(\u0027blacklisted_ip_addresses\u0027, []) %\u003e"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"9f560f44_0566baed","line":41,"range":{"start_line":37,"start_character":0,"end_line":41,"end_character":200},"updated":"2020-08-26 15:46:43.000000000","message":"As per our IRC chat...\n\n[11:43] @\u003cgfidente\u003e fultonj yeah so previously we\u0027d return the key even when it was set to empty string\n[11:43] @\u003cgfidente\u003e now we don\u0027t so the bool(hierdata) will actually return false \n[11:44]  \u003cfultonj\u003e and because it now returns true instead of false we won\u0027t fail the deployment over it\n[11:44]  \u003cfultonj\u003e nice\n\nI can see the change as per the following:\n\n`\n[fultonj@runcible ~]$ cat data-file.json \n{\n   \"role_merged_configs\": {\n      \"ceph\": {\n         \"ceph::profile::params::osds\": {},\n         \"nested\": {\n            \"dict\": \"ciao\"\n         }\n      },\n      \"compute\": {\n         \"key\": \"val\"\n      }\n   }\n}\n[fultonj@runcible ~]$ yaql\nYet Another Query Language - command-line query tool\nVersion 1.1.3\nCopyright (c) 2013-2017 Mirantis, Inc\n\nNo data loaded into context \nType \u0027@load data-file.json\u0027 to load data\n\nyaql\u003e @load data-file.json\nData from file data-file.json loaded into context\nyaql\u003e $.get(\u0027role_merged_configs\u0027, {})\n{\n    \"ceph\": {\n        \"ceph::profile::params::osds\": {},\n        \"nested\": {\n            \"dict\": \"ciao\"\n        }\n    },\n    \"compute\": {\n        \"key\": \"val\"\n    }\n}\nyaql\u003e $.get(\u0027role_merged_configs\u0027, {}).values().select($.keys()).flatten().select(regex(\u0027^ceph::profile::params::osds$\u0027).search($)).where($ !\u003d null).toSet()\n[\n    \"ceph::profile::params::osds\"\n]\nyaql\u003e $.get(\u0027role_merged_configs\u0027, {}).values().where($ !\u003d null).where($.get(\u0027ceph::profile::params::osds\u0027)).first({}).get(\u0027ceph::profile::params::osds\u0027, {})\n{}\nyaql\u003e bool($.get(\u0027role_merged_configs\u0027, {}).values().where($ !\u003d null).where($.get(\u0027ceph::profile::params::osds\u0027)).first({}).get(\u0027ceph::profile::params::osds\u0027, {}))\nfalse\nyaql\u003e bool($.get(\u0027role_merged_configs\u0027, {}).values().select($.keys()).flatten().select(regex(\u0027^ceph::profile::params::osds$\u0027).search($)).where($ !\u003d null).toSet())\ntrue\nyaql\u003e\n`","commit_id":"84755aaba8449ec4c8d109219fc37907af82c062"}]}
