{"action":"created","issue":{"url":"https://api.github.com/repos/ComplianceAsCode/content/issues/3827","repository_url":"https://api.github.com/repos/ComplianceAsCode/content","labels_url":"https://api.github.com/repos/ComplianceAsCode/content/issues/3827/labels{/name}","comments_url":"https://api.github.com/repos/ComplianceAsCode/content/issues/3827/comments","events_url":"https://api.github.com/repos/ComplianceAsCode/content/issues/3827/events","html_url":"https://github.com/ComplianceAsCode/content/pull/3827","id":414174707,"node_id":"MDExOlB1bGxSZXF1ZXN0MjU1OTQ0NTAw","number":3827,"title":"Produce resolved Ansible snippets early in the build process.","user":{"login":"matejak","id":2823847,"node_id":"MDQ6VXNlcjI4MjM4NDc=","avatar_url":"https://avatars2.githubusercontent.com/u/2823847?v=4","gravatar_id":"","url":"https://api.github.com/users/matejak","html_url":"https://github.com/matejak","followers_url":"https://api.github.com/users/matejak/followers","following_url":"https://api.github.com/users/matejak/following{/other_user}","gists_url":"https://api.github.com/users/matejak/gists{/gist_id}","starred_url":"https://api.github.com/users/matejak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matejak/subscriptions","organizations_url":"https://api.github.com/users/matejak/orgs","repos_url":"https://api.github.com/users/matejak/repos","events_url":"https://api.github.com/users/matejak/events{/privacy}","received_events_url":"https://api.github.com/users/matejak/received_events","type":"User","site_admin":false},"labels":[{"id":1224046533,"node_id":"MDU6TGFiZWwxMjI0MDQ2NTMz","url":"https://api.github.com/repos/ComplianceAsCode/content/labels/Python","name":"Python","color":"9bf442","default":false}],"state":"open","locked":false,"assignee":{"login":"jan-cerny","id":9050916,"node_id":"MDQ6VXNlcjkwNTA5MTY=","avatar_url":"https://avatars3.githubusercontent.com/u/9050916?v=4","gravatar_id":"","url":"https://api.github.com/users/jan-cerny","html_url":"https://github.com/jan-cerny","followers_url":"https://api.github.com/users/jan-cerny/followers","following_url":"https://api.github.com/users/jan-cerny/following{/other_user}","gists_url":"https://api.github.com/users/jan-cerny/gists{/gist_id}","starred_url":"https://api.github.com/users/jan-cerny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jan-cerny/subscriptions","organizations_url":"https://api.github.com/users/jan-cerny/orgs","repos_url":"https://api.github.com/users/jan-cerny/repos","events_url":"https://api.github.com/users/jan-cerny/events{/privacy}","received_events_url":"https://api.github.com/users/jan-cerny/received_events","type":"User","site_admin":false},"assignees":[{"login":"jan-cerny","id":9050916,"node_id":"MDQ6VXNlcjkwNTA5MTY=","avatar_url":"https://avatars3.githubusercontent.com/u/9050916?v=4","gravatar_id":"","url":"https://api.github.com/users/jan-cerny","html_url":"https://github.com/jan-cerny","followers_url":"https://api.github.com/users/jan-cerny/followers","following_url":"https://api.github.com/users/jan-cerny/following{/other_user}","gists_url":"https://api.github.com/users/jan-cerny/gists{/gist_id}","starred_url":"https://api.github.com/users/jan-cerny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jan-cerny/subscriptions","organizations_url":"https://api.github.com/users/jan-cerny/orgs","repos_url":"https://api.github.com/users/jan-cerny/repos","events_url":"https://api.github.com/users/jan-cerny/events{/privacy}","received_events_url":"https://api.github.com/users/jan-cerny/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/ComplianceAsCode/content/milestones/41","html_url":"https://github.com/ComplianceAsCode/content/milestone/41","labels_url":"https://api.github.com/repos/ComplianceAsCode/content/milestones/41/labels","id":4066500,"node_id":"MDk6TWlsZXN0b25lNDA2NjUwMA==","number":41,"title":"0.1.44","description":"","creator":{"login":"yuumasato","id":7460169,"node_id":"MDQ6VXNlcjc0NjAxNjk=","avatar_url":"https://avatars0.githubusercontent.com/u/7460169?v=4","gravatar_id":"","url":"https://api.github.com/users/yuumasato","html_url":"https://github.com/yuumasato","followers_url":"https://api.github.com/users/yuumasato/followers","following_url":"https://api.github.com/users/yuumasato/following{/other_user}","gists_url":"https://api.github.com/users/yuumasato/gists{/gist_id}","starred_url":"https://api.github.com/users/yuumasato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuumasato/subscriptions","organizations_url":"https://api.github.com/users/yuumasato/orgs","repos_url":"https://api.github.com/users/yuumasato/repos","events_url":"https://api.github.com/users/yuumasato/events{/privacy}","received_events_url":"https://api.github.com/users/yuumasato/received_events","type":"User","site_admin":false},"open_issues":34,"closed_issues":9,"state":"open","created_at":"2019-02-18T15:10:40Z","updated_at":"2019-02-26T16:01:22Z","due_on":"2019-04-18T07:00:00Z","closed_at":null},"comments":1,"created_at":"2019-02-25T15:55:18Z","updated_at":"2019-02-26T22:51:37Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/ComplianceAsCode/content/pulls/3827","html_url":"https://github.com/ComplianceAsCode/content/pull/3827","diff_url":"https://github.com/ComplianceAsCode/content/pull/3827.diff","patch_url":"https://github.com/ComplianceAsCode/content/pull/3827.patch"},"body":"This PR changes the Ansible remediations generation process. It aims to make build more transparent and reusable by exposing almost-ready remediations as individual files in the build directory. Next, it gets rid of `@ANSIBLE_TAGS@` and other placeholders and slightly reduces the amount of XSLT transforms performed during the build.\r\n\r\nPast state:\r\n* Ansible remediations were aggregated to the huge `fixes-ansible.xml` file as templates - they have contained those `@ANSIBLE_TAGS@` and other placeholders, they weren't valid YAML snippets.\r\n* Later in the build process, an XSLT transform expanded those snippets to valid Ansible/YAML.\r\n\r\nNew state:\r\n* The `@ANSIBLE_TAGS@` and some (not all) other placeholders were removed, as they are not meant to be used.\r\n* Individual snippets are exported to `build/<product>/fixes/ansible/<rule-id>.yml` in form of valid YAML files, with `tags` and `when` populated correctly.\r\n\r\nRegressions:\r\nAt this stage, no regressions are expected. As `pyyaml` is used in part of the processing, the indentation, quotation and interpretation of boolean values changed, so it is not trivial to compare new and old remediations. I have used profile roles with leading whitespace trimmed, which allows for quite nice comparison.\r\n\r\nHow it has been done:\r\n* The remediation build has been slightly refactored by introducing classes - now e.g. Bash and Ansible remediations are quite different, and method override is a convenient way how to introduce additional steps to remediation build.\r\n* The `AnsibleRemediation` class in `ssg.ansible` reads the remediation stub, looks up the resolved rule in the build directory, and adds metadata to the remediation.\r\n* This happens during the remediation collection phase, i.e. before embedding remediations in huge XML files.\r\n* Some XSLT is still performed later in the build, but the scope of it is now very limited.\r\n\r\nThe ugly:\r\nThere is now an `AnsibleRemediation` class in `ssg.ansible` and `ssg.build_remediations`. Although there is no code duplication, those two classes should be merged.\r\nSee also #3830."},"comment":{"url":"https://api.github.com/repos/ComplianceAsCode/content/issues/comments/467648078","html_url":"https://github.com/ComplianceAsCode/content/pull/3827#issuecomment-467648078","issue_url":"https://api.github.com/repos/ComplianceAsCode/content/issues/3827","id":467648078,"node_id":"MDEyOklzc3VlQ29tbWVudDQ2NzY0ODA3OA==","user":{"login":"scrutinizer-notifier","id":6398257,"node_id":"MDQ6VXNlcjYzOTgyNTc=","avatar_url":"https://avatars3.githubusercontent.com/u/6398257?v=4","gravatar_id":"","url":"https://api.github.com/users/scrutinizer-notifier","html_url":"https://github.com/scrutinizer-notifier","followers_url":"https://api.github.com/users/scrutinizer-notifier/followers","following_url":"https://api.github.com/users/scrutinizer-notifier/following{/other_user}","gists_url":"https://api.github.com/users/scrutinizer-notifier/gists{/gist_id}","starred_url":"https://api.github.com/users/scrutinizer-notifier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrutinizer-notifier/subscriptions","organizations_url":"https://api.github.com/users/scrutinizer-notifier/orgs","repos_url":"https://api.github.com/users/scrutinizer-notifier/repos","events_url":"https://api.github.com/users/scrutinizer-notifier/events{/privacy}","received_events_url":"https://api.github.com/users/scrutinizer-notifier/received_events","type":"User","site_admin":false},"created_at":"2019-02-26T22:51:37Z","updated_at":"2019-02-26T22:51:37Z","author_association":"NONE","body":"The [inspection](https://scrutinizer-ci.com/g/ComplianceAsCode/content/inspections/36e97a7c-0fc7-49a2-bbdb-0a9be8c6a71b) completed: **1 new issues, 25 updated code elements**"}}
{"actor":{"display_login":"scrutinizer-notifier"}}