{"action":"closed","number":665,"pull_request":{"url":"https://api.github.com/repos/kodeklubben/oppgaver/pulls/665","id":193795320,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNzk1MzIw","html_url":"https://github.com/kodeklubben/oppgaver/pull/665","diff_url":"https://github.com/kodeklubben/oppgaver/pull/665.diff","patch_url":"https://github.com/kodeklubben/oppgaver/pull/665.patch","issue_url":"https://api.github.com/repos/kodeklubben/oppgaver/issues/665","number":665,"state":"closed","locked":false,"title":"Legg til \"level\" i data.yml","user":{"login":"NorwegianKiwi","id":8851134,"node_id":"MDQ6VXNlcjg4NTExMzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/8851134?v=4","gravatar_id":"","url":"https://api.github.com/users/NorwegianKiwi","html_url":"https://github.com/NorwegianKiwi","followers_url":"https://api.github.com/users/NorwegianKiwi/followers","following_url":"https://api.github.com/users/NorwegianKiwi/following{/other_user}","gists_url":"https://api.github.com/users/NorwegianKiwi/gists{/gist_id}","starred_url":"https://api.github.com/users/NorwegianKiwi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NorwegianKiwi/subscriptions","organizations_url":"https://api.github.com/users/NorwegianKiwi/orgs","repos_url":"https://api.github.com/users/NorwegianKiwi/repos","events_url":"https://api.github.com/users/NorwegianKiwi/events{/privacy}","received_events_url":"https://api.github.com/users/NorwegianKiwi/received_events","type":"User","site_admin":false},"body":"Denne PR'en kopierer \"level\" fra frontmatter på lesson til \"data.yml\"-filen. Dette fordi det er samme level på en oppgave uansett hvilken oversettelse den har.\r\n\r\nEttersom de gamle oppgavesidene trenger at level er i frontmatter på oppgavene, så har ikke level blitt fjernet derfra (det kan evt gjøres senere når de gamle sidene fases ut).\r\n\r\n\r\nBare for referanse, her er scriptet som var brukt:\r\n```\r\nconst glob = require('glob');\r\nconst fs = require('fs');\r\nconst path = require('path');\r\nconst yamlfront = require('yaml-front-matter');\r\nconst yaml = require('yamljs');\r\n\r\nlet countModified = 0;\r\nlet countCreated = 0;\r\nconst mdfiles = glob.sync('src/**/*.md');\r\nconsole.log('Creating data.yml files');\r\nfor (const f of mdfiles) {\r\n  const contents = fs.readFileSync(f, 'utf8');\r\n  const front = yamlfront.loadFront(contents);\r\n    const {__content, level, ...rest} = front;\r\n  if (level) {\r\n    const dataFilename = path.join(path.dirname(f),'data.yml');\r\n    let data = `level: ${level}\\n`;\r\n    if (fs.existsSync(dataFilename)) {\r\n      const previousData = fs.readFileSync(dataFilename, 'utf8');\r\n      if (!previousData.startsWith('level')) {\r\n        data = data + previousData;\r\n        ++countModified;\r\n      } else {\r\n        data = previousData;\r\n      }\r\n    } else {\r\n      ++countCreated;\r\n    }\r\n    fs.writeFileSync(dataFilename, data, {mode: 0o644});\r\n  }\r\n}\r\nconsole.log('Created', countCreated, 'data.yml files');\r\nconsole.log('Modified', countModified, 'data.yml files');\r\n```\r\nMerk at scriptet ble kjørt med node (versjon 9), og at pakkene glob, yaml-front-matter og yamljs ble installert med yarn.","created_at":"2018-06-09T20:38:44Z","updated_at":"2018-06-09T21:27:44Z","closed_at":"2018-06-09T21:27:44Z","merged_at":"2018-06-09T21:27:44Z","merge_commit_sha":"82c51e88bf5575e5c5c89d6a30cb9861b4cdc0fd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kodeklubben/oppgaver/pulls/665/commits","review_comments_url":"https://api.github.com/repos/kodeklubben/oppgaver/pulls/665/comments","review_comment_url":"https://api.github.com/repos/kodeklubben/oppgaver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kodeklubben/oppgaver/issues/665/comments","statuses_url":"https://api.github.com/repos/kodeklubben/oppgaver/statuses/f234a9cb8025330a3885dc7b36e37ade03a3e6df","head":{"label":"NorwegianKiwi:kopiere_level_til_data_yml","ref":"kopiere_level_til_data_yml","sha":"f234a9cb8025330a3885dc7b36e37ade03a3e6df","user":{"login":"NorwegianKiwi","id":8851134,"node_id":"MDQ6VXNlcjg4NTExMzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/8851134?v=4","gravatar_id":"","url":"https://api.github.com/users/NorwegianKiwi","html_url":"https://github.com/NorwegianKiwi","followers_url":"https://api.github.com/users/NorwegianKiwi/followers","following_url":"https://api.github.com/users/NorwegianKiwi/following{/other_user}","gists_url":"https://api.github.com/users/NorwegianKiwi/gists{/gist_id}","starred_url":"https://api.github.com/users/NorwegianKiwi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NorwegianKiwi/subscriptions","organizations_url":"https://api.github.com/users/NorwegianKiwi/orgs","repos_url":"https://api.github.com/users/NorwegianKiwi/repos","events_url":"https://api.github.com/users/NorwegianKiwi/events{/privacy}","received_events_url":"https://api.github.com/users/NorwegianKiwi/received_events","type":"User","site_admin":false},"repo":{"id":46670710,"node_id":"MDEwOlJlcG9zaXRvcnk0NjY3MDcxMA==","name":"oppgaver","full_name":"NorwegianKiwi/oppgaver","owner":{"login":"NorwegianKiwi","id":8851134,"node_id":"MDQ6VXNlcjg4NTExMzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/8851134?v=4","gravatar_id":"","url":"https://api.github.com/users/NorwegianKiwi","html_url":"https://github.com/NorwegianKiwi","followers_url":"https://api.github.com/users/NorwegianKiwi/followers","following_url":"https://api.github.com/users/NorwegianKiwi/following{/other_user}","gists_url":"https://api.github.com/users/NorwegianKiwi/gists{/gist_id}","starred_url":"https://api.github.com/users/NorwegianKiwi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NorwegianKiwi/subscriptions","organizations_url":"https://api.github.com/users/NorwegianKiwi/orgs","repos_url":"https://api.github.com/users/NorwegianKiwi/repos","events_url":"https://api.github.com/users/NorwegianKiwi/events{/privacy}","received_events_url":"https://api.github.com/users/NorwegianKiwi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NorwegianKiwi/oppgaver","description":"Oppgavesett for forskjellige programmeringsspråk og kurs","fork":true,"url":"https://api.github.com/repos/NorwegianKiwi/oppgaver","forks_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/forks","keys_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/teams","hooks_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/hooks","issue_events_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/issues/events{/number}","events_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/events","assignees_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/assignees{/user}","branches_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/branches{/branch}","tags_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/tags","blobs_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/git/refs{/sha}","trees_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/statuses/{sha}","languages_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/languages","stargazers_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/stargazers","contributors_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/contributors","subscribers_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/subscribers","subscription_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/subscription","commits_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/commits{/sha}","git_commits_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/git/commits{/sha}","comments_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/comments{/number}","issue_comment_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/issues/comments{/number}","contents_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/contents/{+path}","compare_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/merges","archive_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/downloads","issues_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/issues{/number}","pulls_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/pulls{/number}","milestones_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/milestones{/number}","notifications_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/labels{/name}","releases_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/releases{/id}","deployments_url":"https://api.github.com/repos/NorwegianKiwi/oppgaver/deployments","created_at":"2015-11-22T17:12:28Z","updated_at":"2018-06-09T20:56:22Z","pushed_at":"2018-06-09T21:22:56Z","git_url":"git://github.com/NorwegianKiwi/oppgaver.git","ssh_url":"git@github.com:NorwegianKiwi/oppgaver.git","clone_url":"https://github.com/NorwegianKiwi/oppgaver.git","svn_url":"https://github.com/NorwegianKiwi/oppgaver","homepage":"http://kodeklubben.github.io","size":112452,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kodeklubben:master","ref":"master","sha":"45733ba8b2eaab67a71716c5aaf86f21238d4f3c","user":{"login":"kodeklubben","id":4325933,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMjU5MzM=","avatar_url":"https://avatars1.githubusercontent.com/u/4325933?v=4","gravatar_id":"","url":"https://api.github.com/users/kodeklubben","html_url":"https://github.com/kodeklubben","followers_url":"https://api.github.com/users/kodeklubben/followers","following_url":"https://api.github.com/users/kodeklubben/following{/other_user}","gists_url":"https://api.github.com/users/kodeklubben/gists{/gist_id}","starred_url":"https://api.github.com/users/kodeklubben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kodeklubben/subscriptions","organizations_url":"https://api.github.com/users/kodeklubben/orgs","repos_url":"https://api.github.com/users/kodeklubben/repos","events_url":"https://api.github.com/users/kodeklubben/events{/privacy}","received_events_url":"https://api.github.com/users/kodeklubben/received_events","type":"Organization","site_admin":false},"repo":{"id":17453180,"node_id":"MDEwOlJlcG9zaXRvcnkxNzQ1MzE4MA==","name":"oppgaver","full_name":"kodeklubben/oppgaver","owner":{"login":"kodeklubben","id":4325933,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMjU5MzM=","avatar_url":"https://avatars1.githubusercontent.com/u/4325933?v=4","gravatar_id":"","url":"https://api.github.com/users/kodeklubben","html_url":"https://github.com/kodeklubben","followers_url":"https://api.github.com/users/kodeklubben/followers","following_url":"https://api.github.com/users/kodeklubben/following{/other_user}","gists_url":"https://api.github.com/users/kodeklubben/gists{/gist_id}","starred_url":"https://api.github.com/users/kodeklubben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kodeklubben/subscriptions","organizations_url":"https://api.github.com/users/kodeklubben/orgs","repos_url":"https://api.github.com/users/kodeklubben/repos","events_url":"https://api.github.com/users/kodeklubben/events{/privacy}","received_events_url":"https://api.github.com/users/kodeklubben/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kodeklubben/oppgaver","description":"Oppgavesett for programmering","fork":false,"url":"https://api.github.com/repos/kodeklubben/oppgaver","forks_url":"https://api.github.com/repos/kodeklubben/oppgaver/forks","keys_url":"https://api.github.com/repos/kodeklubben/oppgaver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kodeklubben/oppgaver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kodeklubben/oppgaver/teams","hooks_url":"https://api.github.com/repos/kodeklubben/oppgaver/hooks","issue_events_url":"https://api.github.com/repos/kodeklubben/oppgaver/issues/events{/number}","events_url":"https://api.github.com/repos/kodeklubben/oppgaver/events","assignees_url":"https://api.github.com/repos/kodeklubben/oppgaver/assignees{/user}","branches_url":"https://api.github.com/repos/kodeklubben/oppgaver/branches{/branch}","tags_url":"https://api.github.com/repos/kodeklubben/oppgaver/tags","blobs_url":"https://api.github.com/repos/kodeklubben/oppgaver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kodeklubben/oppgaver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kodeklubben/oppgaver/git/refs{/sha}","trees_url":"https://api.github.com/repos/kodeklubben/oppgaver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kodeklubben/oppgaver/statuses/{sha}","languages_url":"https://api.github.com/repos/kodeklubben/oppgaver/languages","stargazers_url":"https://api.github.com/repos/kodeklubben/oppgaver/stargazers","contributors_url":"https://api.github.com/repos/kodeklubben/oppgaver/contributors","subscribers_url":"https://api.github.com/repos/kodeklubben/oppgaver/subscribers","subscription_url":"https://api.github.com/repos/kodeklubben/oppgaver/subscription","commits_url":"https://api.github.com/repos/kodeklubben/oppgaver/commits{/sha}","git_commits_url":"https://api.github.com/repos/kodeklubben/oppgaver/git/commits{/sha}","comments_url":"https://api.github.com/repos/kodeklubben/oppgaver/comments{/number}","issue_comment_url":"https://api.github.com/repos/kodeklubben/oppgaver/issues/comments{/number}","contents_url":"https://api.github.com/repos/kodeklubben/oppgaver/contents/{+path}","compare_url":"https://api.github.com/repos/kodeklubben/oppgaver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kodeklubben/oppgaver/merges","archive_url":"https://api.github.com/repos/kodeklubben/oppgaver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kodeklubben/oppgaver/downloads","issues_url":"https://api.github.com/repos/kodeklubben/oppgaver/issues{/number}","pulls_url":"https://api.github.com/repos/kodeklubben/oppgaver/pulls{/number}","milestones_url":"https://api.github.com/repos/kodeklubben/oppgaver/milestones{/number}","notifications_url":"https://api.github.com/repos/kodeklubben/oppgaver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kodeklubben/oppgaver/labels{/name}","releases_url":"https://api.github.com/repos/kodeklubben/oppgaver/releases{/id}","deployments_url":"https://api.github.com/repos/kodeklubben/oppgaver/deployments","created_at":"2014-03-05T19:59:03Z","updated_at":"2018-06-09T21:19:57Z","pushed_at":"2018-06-09T21:27:43Z","git_url":"git://github.com/kodeklubben/oppgaver.git","ssh_url":"git@github.com:kodeklubben/oppgaver.git","clone_url":"https://github.com/kodeklubben/oppgaver.git","svn_url":"https://github.com/kodeklubben/oppgaver","homepage":"http://oppgaver.kidsakoder.no","size":113582,"stargazers_count":25,"watchers_count":25,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":79,"mirror_url":null,"archived":false,"open_issues_count":36,"license":null,"forks":79,"open_issues":36,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kodeklubben/oppgaver/pulls/665"},"html":{"href":"https://github.com/kodeklubben/oppgaver/pull/665"},"issue":{"href":"https://api.github.com/repos/kodeklubben/oppgaver/issues/665"},"comments":{"href":"https://api.github.com/repos/kodeklubben/oppgaver/issues/665/comments"},"review_comments":{"href":"https://api.github.com/repos/kodeklubben/oppgaver/pulls/665/comments"},"review_comment":{"href":"https://api.github.com/repos/kodeklubben/oppgaver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kodeklubben/oppgaver/pulls/665/commits"},"statuses":{"href":"https://api.github.com/repos/kodeklubben/oppgaver/statuses/f234a9cb8025330a3885dc7b36e37ade03a3e6df"}},"author_association":"COLLABORATOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"tjesi","id":5648743,"node_id":"MDQ6VXNlcjU2NDg3NDM=","avatar_url":"https://avatars3.githubusercontent.com/u/5648743?v=4","gravatar_id":"","url":"https://api.github.com/users/tjesi","html_url":"https://github.com/tjesi","followers_url":"https://api.github.com/users/tjesi/followers","following_url":"https://api.github.com/users/tjesi/following{/other_user}","gists_url":"https://api.github.com/users/tjesi/gists{/gist_id}","starred_url":"https://api.github.com/users/tjesi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjesi/subscriptions","organizations_url":"https://api.github.com/users/tjesi/orgs","repos_url":"https://api.github.com/users/tjesi/repos","events_url":"https://api.github.com/users/tjesi/events{/privacy}","received_events_url":"https://api.github.com/users/tjesi/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":4,"additions":235,"deletions":6,"changed_files":229}}
{"actor":{"display_login":"tjesi"}}