{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-gomatic/pulls/comments/158377972","pull_request_review_id":85181944,"id":158377972,"diff_hunk":"@@ -0,0 +1,47 @@\n+\"\"\"\n+Common gomatic Jobs patterns for marketing.\n+\n+Responsibilities:\n+    Job patterns should ...\n+        * return the created job (or a dict of jobs, if there are more than one).\n+        * expect ArtifactLocations as input.\n+            * It's the responsibility of the stage/pipeline to ensure that the\n+              supplied artifacts don't refer to a job in the same stage.\n+        * use constants for job names.\n+        * not specify environment variables (leave that to tasks).\n+        * only be used for common groupings of tasks that need to be parameterized\n+          (task patterns can be used directly from stage patterns or pipeline patterns).\n+        * ``ensure`` the scm materials needed for any non-pattern task to function.\n+\"\"\"\n+from gomatic import BuildArtifact\n+\n+from edxpipelines import constants\n+from edxpipelines.patterns import tasks\n+\n+\n+def generate_job_fetch_tag_name(stage, drupal_env):\n+    \"\"\"\n+    Creates a job that fetches the tag name from a Drupal environment.\n+\n+    Arguments:\n+        stage: The stage to which the job is being added.\n+        drupal_env: The name of the environment from which the tag name should\n+            be fetched.\n+\n+    Returns:\n+        The new job.\n+\n+    \"\"\"\n+    fetch_tag_job = stage.ensure_job(constants.FETCH_TAG_JOB_NAME)\n+    tasks.generate_package_install(fetch_tag_job, 'tubular')\n+    tasks.generate_target_directory(fetch_tag_job)\n+    path_name = '../target/{env}_tag_name.txt'\n+    tasks.generate_fetch_tag(fetch_tag_job, drupal_env, path_name)\n+\n+    fetch_tag_job.ensure_artifacts(\n+        set([BuildArtifact('target/{tag_name}.txt'.format(\n+            tag_name=constants.ACQUIA_ENV_TAG_NAME.format(drupal_env=drupal_env)\n+        ))])","path":"edxpipelines/patterns/marketing_jobs.py","position":44,"original_position":44,"commit_id":"7b2327deb530b0f9985131969baf47c22d281bc7","original_commit_id":"b9cf636ebf23f32dd1cdf4d6c483be8a686974c1","user":{"login":"robrap","id":14576445,"avatar_url":"https://avatars2.githubusercontent.com/u/14576445?v=4","gravatar_id":"","url":"https://api.github.com/users/robrap","html_url":"https://github.com/robrap","followers_url":"https://api.github.com/users/robrap/followers","following_url":"https://api.github.com/users/robrap/following{/other_user}","gists_url":"https://api.github.com/users/robrap/gists{/gist_id}","starred_url":"https://api.github.com/users/robrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robrap/subscriptions","organizations_url":"https://api.github.com/users/robrap/orgs","repos_url":"https://api.github.com/users/robrap/repos","events_url":"https://api.github.com/users/robrap/events{/privacy}","received_events_url":"https://api.github.com/users/robrap/received_events","type":"User","site_admin":false},"body":"Ok.","created_at":"2017-12-21T21:04:09Z","updated_at":"2017-12-21T21:20:56Z","html_url":"https://github.com/edx/edx-gomatic/pull/376#discussion_r158377972","pull_request_url":"https://api.github.com/repos/edx/edx-gomatic/pulls/376","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-gomatic/pulls/comments/158377972"},"html":{"href":"https://github.com/edx/edx-gomatic/pull/376#discussion_r158377972"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-gomatic/pulls/376"}},"in_reply_to_id":158365894},"pull_request":{"url":"https://api.github.com/repos/edx/edx-gomatic/pulls/376","id":159707009,"html_url":"https://github.com/edx/edx-gomatic/pull/376","diff_url":"https://github.com/edx/edx-gomatic/pull/376.diff","patch_url":"https://github.com/edx/edx-gomatic/pull/376.patch","issue_url":"https://api.github.com/repos/edx/edx-gomatic/issues/376","number":376,"state":"open","locked":false,"title":"LEARNER-3718: Refactor marketing pipelines.","user":{"login":"robrap","id":14576445,"avatar_url":"https://avatars2.githubusercontent.com/u/14576445?v=4","gravatar_id":"","url":"https://api.github.com/users/robrap","html_url":"https://github.com/robrap","followers_url":"https://api.github.com/users/robrap/followers","following_url":"https://api.github.com/users/robrap/following{/other_user}","gists_url":"https://api.github.com/users/robrap/gists{/gist_id}","starred_url":"https://api.github.com/users/robrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robrap/subscriptions","organizations_url":"https://api.github.com/users/robrap/orgs","repos_url":"https://api.github.com/users/robrap/repos","events_url":"https://api.github.com/users/robrap/events{/privacy}","received_events_url":"https://api.github.com/users/robrap/received_events","type":"User","site_admin":false},"body":"This is a draft of refactoring the marketing pipeline code.\r\n\r\nI'll post my own questions soon when I am available.  Some of those are in TODO comments that I added as I went.","created_at":"2017-12-21T17:10:08Z","updated_at":"2017-12-21T21:20:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"48a1ba692eaae75d02b66336c6e85dd3f8a71147","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Dillon-Dumesnil","id":12799718,"avatar_url":"https://avatars1.githubusercontent.com/u/12799718?v=4","gravatar_id":"","url":"https://api.github.com/users/Dillon-Dumesnil","html_url":"https://github.com/Dillon-Dumesnil","followers_url":"https://api.github.com/users/Dillon-Dumesnil/followers","following_url":"https://api.github.com/users/Dillon-Dumesnil/following{/other_user}","gists_url":"https://api.github.com/users/Dillon-Dumesnil/gists{/gist_id}","starred_url":"https://api.github.com/users/Dillon-Dumesnil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dillon-Dumesnil/subscriptions","organizations_url":"https://api.github.com/users/Dillon-Dumesnil/orgs","repos_url":"https://api.github.com/users/Dillon-Dumesnil/repos","events_url":"https://api.github.com/users/Dillon-Dumesnil/events{/privacy}","received_events_url":"https://api.github.com/users/Dillon-Dumesnil/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-gomatic/pulls/376/commits","review_comments_url":"https://api.github.com/repos/edx/edx-gomatic/pulls/376/comments","review_comment_url":"https://api.github.com/repos/edx/edx-gomatic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-gomatic/issues/376/comments","statuses_url":"https://api.github.com/repos/edx/edx-gomatic/statuses/7b2327deb530b0f9985131969baf47c22d281bc7","head":{"label":"edx:robrap/refactor-mktg","ref":"robrap/refactor-mktg","sha":"7b2327deb530b0f9985131969baf47c22d281bc7","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars3.githubusercontent.com/u/3179841?v=4","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":61151389,"name":"edx-gomatic","full_name":"edx/edx-gomatic","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars3.githubusercontent.com/u/3179841?v=4","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-gomatic","description":"Collection of gomatic scripts used at edx","fork":false,"url":"https://api.github.com/repos/edx/edx-gomatic","forks_url":"https://api.github.com/repos/edx/edx-gomatic/forks","keys_url":"https://api.github.com/repos/edx/edx-gomatic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-gomatic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-gomatic/teams","hooks_url":"https://api.github.com/repos/edx/edx-gomatic/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-gomatic/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-gomatic/events","assignees_url":"https://api.github.com/repos/edx/edx-gomatic/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-gomatic/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-gomatic/tags","blobs_url":"https://api.github.com/repos/edx/edx-gomatic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-gomatic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-gomatic/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-gomatic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-gomatic/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-gomatic/languages","stargazers_url":"https://api.github.com/repos/edx/edx-gomatic/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-gomatic/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-gomatic/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-gomatic/subscription","commits_url":"https://api.github.com/repos/edx/edx-gomatic/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-gomatic/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-gomatic/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-gomatic/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-gomatic/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-gomatic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-gomatic/merges","archive_url":"https://api.github.com/repos/edx/edx-gomatic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-gomatic/downloads","issues_url":"https://api.github.com/repos/edx/edx-gomatic/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-gomatic/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-gomatic/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-gomatic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-gomatic/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-gomatic/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-gomatic/deployments","created_at":"2016-06-14T19:50:32Z","updated_at":"2016-10-24T18:18:59Z","pushed_at":"2017-12-21T20:42:18Z","git_url":"git://github.com/edx/edx-gomatic.git","ssh_url":"git@github.com:edx/edx-gomatic.git","clone_url":"https://github.com/edx/edx-gomatic.git","svn_url":"https://github.com/edx/edx-gomatic","homepage":null,"size":1212,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":9,"license":null,"forks":5,"open_issues":9,"watchers":2,"default_branch":"master"}},"base":{"label":"edx:ddumesnil/LEARNER-621","ref":"ddumesnil/LEARNER-621","sha":"d3cd4f5f957ceaf521e715e3b5180701cfced391","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars3.githubusercontent.com/u/3179841?v=4","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":61151389,"name":"edx-gomatic","full_name":"edx/edx-gomatic","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars3.githubusercontent.com/u/3179841?v=4","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-gomatic","description":"Collection of gomatic scripts used at edx","fork":false,"url":"https://api.github.com/repos/edx/edx-gomatic","forks_url":"https://api.github.com/repos/edx/edx-gomatic/forks","keys_url":"https://api.github.com/repos/edx/edx-gomatic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-gomatic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-gomatic/teams","hooks_url":"https://api.github.com/repos/edx/edx-gomatic/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-gomatic/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-gomatic/events","assignees_url":"https://api.github.com/repos/edx/edx-gomatic/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-gomatic/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-gomatic/tags","blobs_url":"https://api.github.com/repos/edx/edx-gomatic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-gomatic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-gomatic/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-gomatic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-gomatic/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-gomatic/languages","stargazers_url":"https://api.github.com/repos/edx/edx-gomatic/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-gomatic/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-gomatic/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-gomatic/subscription","commits_url":"https://api.github.com/repos/edx/edx-gomatic/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-gomatic/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-gomatic/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-gomatic/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-gomatic/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-gomatic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-gomatic/merges","archive_url":"https://api.github.com/repos/edx/edx-gomatic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-gomatic/downloads","issues_url":"https://api.github.com/repos/edx/edx-gomatic/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-gomatic/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-gomatic/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-gomatic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-gomatic/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-gomatic/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-gomatic/deployments","created_at":"2016-06-14T19:50:32Z","updated_at":"2016-10-24T18:18:59Z","pushed_at":"2017-12-21T20:42:18Z","git_url":"git://github.com/edx/edx-gomatic.git","ssh_url":"git@github.com:edx/edx-gomatic.git","clone_url":"https://github.com/edx/edx-gomatic.git","svn_url":"https://github.com/edx/edx-gomatic","homepage":null,"size":1212,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":9,"license":null,"forks":5,"open_issues":9,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-gomatic/pulls/376"},"html":{"href":"https://github.com/edx/edx-gomatic/pull/376"},"issue":{"href":"https://api.github.com/repos/edx/edx-gomatic/issues/376"},"comments":{"href":"https://api.github.com/repos/edx/edx-gomatic/issues/376/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-gomatic/pulls/376/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-gomatic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-gomatic/pulls/376/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-gomatic/statuses/7b2327deb530b0f9985131969baf47c22d281bc7"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"robrap"}}