{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla-releng/scriptworker/issues/32","repository_url":"https://api.github.com/repos/mozilla-releng/scriptworker","labels_url":"https://api.github.com/repos/mozilla-releng/scriptworker/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/mozilla-releng/scriptworker/issues/32/comments","events_url":"https://api.github.com/repos/mozilla-releng/scriptworker/issues/32/events","html_url":"https://github.com/mozilla-releng/scriptworker/pull/32","id":193041003,"number":32,"title":"Fix gpg","user":{"login":"escapewindow","id":826343,"avatar_url":"https://avatars.githubusercontent.com/u/826343?v=3","gravatar_id":"","url":"https://api.github.com/users/escapewindow","html_url":"https://github.com/escapewindow","followers_url":"https://api.github.com/users/escapewindow/followers","following_url":"https://api.github.com/users/escapewindow/following{/other_user}","gists_url":"https://api.github.com/users/escapewindow/gists{/gist_id}","starred_url":"https://api.github.com/users/escapewindow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/escapewindow/subscriptions","organizations_url":"https://api.github.com/users/escapewindow/orgs","repos_url":"https://api.github.com/users/escapewindow/repos","events_url":"https://api.github.com/users/escapewindow/events{/privacy}","received_events_url":"https://api.github.com/users/escapewindow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-02T06:03:52Z","updated_at":"2016-12-02T06:11:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mozilla-releng/scriptworker/pulls/32","html_url":"https://github.com/mozilla-releng/scriptworker/pull/32","diff_url":"https://github.com/mozilla-releng/scriptworker/pull/32.diff","patch_url":"https://github.com/mozilla-releng/scriptworker/pull/32.patch"},"body":"PR notes: we had some bustage in gpg homedir creation.  This PR tries to deal with the symptoms I saw:\r\n\r\n1. When the git repo was already up to date, I saw this stackdump:\r\n\r\n> 2016-11-30T17:58:45     INFO - Already up-to-date.\r\nException ignored in: <bound method BaseEventLoop.__del__ of <_UnixSelectorEventLoop running=False closed=True debug=False>>\r\nTraceback (most recent call last):\r\n  File \"/tools/python35/lib/python3.5/asyncio/base_events.py\", line 431, in __del__\r\n  File \"/tools/python35/lib/python3.5/asyncio/unix_events.py\", line 58, in close\r\n  File \"/tools/python35/lib/python3.5/asyncio/unix_events.py\", line 139, in remove_signal_handler\r\n  File \"/tools/python35/lib/python3.5/signal.py\", line 47, in signal\r\nTypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object\r\n\r\nThis isn't harmful, but it's confusing seeing this error when trying to debug.  I believe closing the event loop outside of the `if` block will remove this.\r\n\r\n2. Error about copying a nonexistent `trustdb.db` into `/builds/scriptworker/gpg`\r\n\r\nI believe this is because the cron job started a new `rebuild_gpg_homedirs` before scriptworker finished copying the contents of `gpg.tmp/` into `gpg/`.  I modified the lockfile logic to allow for 3 states: unlocked, locked (a process is creating the gpg homedirs in `gpg.tmp/`), and ready (a process has created the gpg homedirs in `gpg.tmp/`, and scriptworker needs to copy those into `gpg/`)\r\n\r\n3. I was already worried about re-running `create_initial_gpg_homedirs` via puppet.  It was weird having two entry points that did nearly the same thing (`rebuild_gpg_homedirs` rebuilds the homedirs but puts the worker homedirs in `/builds/scriptworker/gpg.tmp/`; `create_initial_gpg_homedirs` does rebuilds the homedirs and replaces `/builds/scriptworker/gpg/` with the contents).  I played with the idea of having *three* gpg homedir entry points, one to rebuild `~/.gnupg` for git commit signature verification which puppet could run on pubkey change, one for replacing `/builds/scriptworker/gpg/` for initial setup, and one for populating `/builds/scriptworker/gpg.tmp/` via cron.\r\n\r\nI finally settled on removing `create_initial_gpg_homedirs`.  If puppet runs `rebuild_gpg_homedirs`, that's one less thing to test, and one less thing that can stomp on things at runtime.  I was able to do this by moving the check for `/builds/scriptworker/gpg.tmp/` at the beginning of the loop, rather than at the end, so scriptworker would populate `/builds/scriptworker/gpg/` at first run if appropriate.\r\n\r\nI also decided I wanted to test a little less on production, so I added a `Dockerfile.gnupg` with a readme update.  It's possible to test `rebuild_gpg_homedirs` on that."},"comment":{"url":"https://api.github.com/repos/mozilla-releng/scriptworker/issues/comments/264381589","html_url":"https://github.com/mozilla-releng/scriptworker/pull/32#issuecomment-264381589","issue_url":"https://api.github.com/repos/mozilla-releng/scriptworker/issues/32","id":264381589,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars.githubusercontent.com/u/2354108?v=3","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2016-12-02T06:11:35Z","updated_at":"2016-12-02T06:11:35Z","body":"\n[![Coverage Status](https://coveralls.io/builds/9095799/badge)](https://coveralls.io/builds/9095799)\n\nCoverage remained the same at 100.0% when pulling **66504a5921c0e5ecef6e493eca27d0d5c1f49aca on escapewindow:fix-gpg** into **023a185db4061aa78ddea1802fa8e9d4a26a1d01 on mozilla-releng:master**.\n"}}
{"actor":{"display_login":"coveralls"}}