{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleContainerTools/jib/pulls/comments/226402066","pull_request_review_id":166216866,"id":226402066,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNjQwMjA2Ng==","diff_hunk":"@@ -0,0 +1,75 @@\n+/*\n+ * Copyright 2018 Google LLC.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n+ * use this file except in compliance with the License. You may obtain a copy of\n+ * the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n+ * License for the specific language governing permissions and limitations under\n+ * the License.\n+ */\n+\n+package com.google.cloud.tools.jib.filesystem;\n+\n+import com.google.common.base.Preconditions;\n+import com.google.common.collect.ImmutableMap;\n+import com.google.common.collect.ImmutableSet;\n+import java.nio.file.attribute.PosixFilePermission;\n+import java.util.Map.Entry;\n+\n+/** Helpers for converting between file permission bits and set of {@link PosixFilePermission}. */\n+public class PermissionsHelper {\n+\n+  /** Maps from a {@link PosixFilePermission} to its corresponding file permission bit. */\n+  private static final ImmutableMap<PosixFilePermission, Integer> permissionMap =\n+      ImmutableMap.<PosixFilePermission, Integer>builder()\n+          .put(PosixFilePermission.OWNER_READ, 0400)\n+          .put(PosixFilePermission.OWNER_WRITE, 0200)\n+          .put(PosixFilePermission.OWNER_EXECUTE, 0100)\n+          .put(PosixFilePermission.GROUP_READ, 040)\n+          .put(PosixFilePermission.GROUP_WRITE, 020)\n+          .put(PosixFilePermission.GROUP_EXECUTE, 010)\n+          .put(PosixFilePermission.OTHERS_READ, 04)\n+          .put(PosixFilePermission.OTHERS_WRITE, 02)\n+          .put(PosixFilePermission.OTHERS_EXECUTE, 01)\n+          .build();\n+\n+  /**\n+   * Converts a set of {@link PosixFilePermission} to the equivalent file permission bits.\n+   *\n+   * @param permissions the set of {@link PosixFilePermission}\n+   * @return the equivalent file permission bits\n+   */\n+  public static int toPermissionBits(ImmutableSet<PosixFilePermission> permissions) {","path":"jib-core/src/main/java/com/google/cloud/tools/jib/filesystem/PermissionsHelper.java","position":48,"original_position":48,"commit_id":"4499e2b19a03ead39be29b9ba38779e47415fe54","original_commit_id":"4499e2b19a03ead39be29b9ba38779e47415fe54","user":{"login":"briandealwis","id":202851,"node_id":"MDQ6VXNlcjIwMjg1MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/202851?v=4","gravatar_id":"","url":"https://api.github.com/users/briandealwis","html_url":"https://github.com/briandealwis","followers_url":"https://api.github.com/users/briandealwis/followers","following_url":"https://api.github.com/users/briandealwis/following{/other_user}","gists_url":"https://api.github.com/users/briandealwis/gists{/gist_id}","starred_url":"https://api.github.com/users/briandealwis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briandealwis/subscriptions","organizations_url":"https://api.github.com/users/briandealwis/orgs","repos_url":"https://api.github.com/users/briandealwis/repos","events_url":"https://api.github.com/users/briandealwis/events{/privacy}","received_events_url":"https://api.github.com/users/briandealwis/received_events","type":"User","site_admin":false},"body":"This should take `Set`, not `ImmutableSet`.","created_at":"2018-10-18T17:45:22Z","updated_at":"2018-10-18T17:52:57Z","html_url":"https://github.com/GoogleContainerTools/jib/pull/1156#discussion_r226402066","pull_request_url":"https://api.github.com/repos/GoogleContainerTools/jib/pulls/1156","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/GoogleContainerTools/jib/pulls/comments/226402066"},"html":{"href":"https://github.com/GoogleContainerTools/jib/pull/1156#discussion_r226402066"},"pull_request":{"href":"https://api.github.com/repos/GoogleContainerTools/jib/pulls/1156"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleContainerTools/jib/pulls/1156","id":223377667,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzMzc3NjY3","html_url":"https://github.com/GoogleContainerTools/jib/pull/1156","diff_url":"https://github.com/GoogleContainerTools/jib/pull/1156.diff","patch_url":"https://github.com/GoogleContainerTools/jib/pull/1156.patch","issue_url":"https://api.github.com/repos/GoogleContainerTools/jib/issues/1156","number":1156,"state":"open","locked":false,"title":"Core changes for setting file permissions","user":{"login":"TadCordle","id":521881,"node_id":"MDQ6VXNlcjUyMTg4MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/521881?v=4","gravatar_id":"","url":"https://api.github.com/users/TadCordle","html_url":"https://github.com/TadCordle","followers_url":"https://api.github.com/users/TadCordle/followers","following_url":"https://api.github.com/users/TadCordle/following{/other_user}","gists_url":"https://api.github.com/users/TadCordle/gists{/gist_id}","starred_url":"https://api.github.com/users/TadCordle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TadCordle/subscriptions","organizations_url":"https://api.github.com/users/TadCordle/orgs","repos_url":"https://api.github.com/users/TadCordle/repos","events_url":"https://api.github.com/users/TadCordle/events{/privacy}","received_events_url":"https://api.github.com/users/TadCordle/received_events","type":"User","site_admin":false},"body":"Towards #794.\r\n\r\n~~Adds a `permissions` field to `LayerEntry`, which is just an integer that ranges from 000 to 777 octal. When `TarArchiveEntry`s are added for each layer in `ReproducibleLayerBuilder`, the permissions bits are masked out and replaced with this new `permissions` field. The permissions are set in `JavaLayerConfigurations` by passing in a `Map<AbsoluteUnixPath, Integer>` that maps from path on container to the desired file permissions.~~\r\n\r\nAllows setting permissions on a `LayerEntry` using a `Set<PosixFilePermission>`. Also adds a helper class `PermissionsHelper` to allow converting between `Set<PosixFilePermission>` and the octal `int` equivalent.","created_at":"2018-10-16T20:00:42Z","updated_at":"2018-10-18T17:52:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c1bf3e9186700f7869b3edb26be6e348eb58a084","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1016518109,"node_id":"MDU6TGFiZWwxMDE2NTE4MTA5","url":"https://api.github.com/repos/GoogleContainerTools/jib/labels/cla:%20yes","name":"cla: yes","color":"ededed","default":false},{"id":1091976026,"node_id":"MDU6TGFiZWwxMDkxOTc2MDI2","url":"https://api.github.com/repos/GoogleContainerTools/jib/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleContainerTools/jib/pulls/1156/commits","review_comments_url":"https://api.github.com/repos/GoogleContainerTools/jib/pulls/1156/comments","review_comment_url":"https://api.github.com/repos/GoogleContainerTools/jib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleContainerTools/jib/issues/1156/comments","statuses_url":"https://api.github.com/repos/GoogleContainerTools/jib/statuses/4499e2b19a03ead39be29b9ba38779e47415fe54","head":{"label":"GoogleContainerTools:i794-exec-permissions","ref":"i794-exec-permissions","sha":"4499e2b19a03ead39be29b9ba38779e47415fe54","user":{"login":"GoogleContainerTools","id":38444003,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4NDQ0MDAz","avatar_url":"https://avatars1.githubusercontent.com/u/38444003?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleContainerTools","html_url":"https://github.com/GoogleContainerTools","followers_url":"https://api.github.com/users/GoogleContainerTools/followers","following_url":"https://api.github.com/users/GoogleContainerTools/following{/other_user}","gists_url":"https://api.github.com/users/GoogleContainerTools/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleContainerTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleContainerTools/subscriptions","organizations_url":"https://api.github.com/users/GoogleContainerTools/orgs","repos_url":"https://api.github.com/users/GoogleContainerTools/repos","events_url":"https://api.github.com/users/GoogleContainerTools/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleContainerTools/received_events","type":"Organization","site_admin":false},"repo":{"id":118497841,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg0OTc4NDE=","name":"jib","full_name":"GoogleContainerTools/jib","private":false,"owner":{"login":"GoogleContainerTools","id":38444003,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4NDQ0MDAz","avatar_url":"https://avatars1.githubusercontent.com/u/38444003?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleContainerTools","html_url":"https://github.com/GoogleContainerTools","followers_url":"https://api.github.com/users/GoogleContainerTools/followers","following_url":"https://api.github.com/users/GoogleContainerTools/following{/other_user}","gists_url":"https://api.github.com/users/GoogleContainerTools/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleContainerTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleContainerTools/subscriptions","organizations_url":"https://api.github.com/users/GoogleContainerTools/orgs","repos_url":"https://api.github.com/users/GoogleContainerTools/repos","events_url":"https://api.github.com/users/GoogleContainerTools/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleContainerTools/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/GoogleContainerTools/jib","description":":sailboat: Build container images for your Java applications.","fork":false,"url":"https://api.github.com/repos/GoogleContainerTools/jib","forks_url":"https://api.github.com/repos/GoogleContainerTools/jib/forks","keys_url":"https://api.github.com/repos/GoogleContainerTools/jib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleContainerTools/jib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleContainerTools/jib/teams","hooks_url":"https://api.github.com/repos/GoogleContainerTools/jib/hooks","issue_events_url":"https://api.github.com/repos/GoogleContainerTools/jib/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleContainerTools/jib/events","assignees_url":"https://api.github.com/repos/GoogleContainerTools/jib/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleContainerTools/jib/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleContainerTools/jib/tags","blobs_url":"https://api.github.com/repos/GoogleContainerTools/jib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleContainerTools/jib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleContainerTools/jib/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleContainerTools/jib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleContainerTools/jib/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleContainerTools/jib/languages","stargazers_url":"https://api.github.com/repos/GoogleContainerTools/jib/stargazers","contributors_url":"https://api.github.com/repos/GoogleContainerTools/jib/contributors","subscribers_url":"https://api.github.com/repos/GoogleContainerTools/jib/subscribers","subscription_url":"https://api.github.com/repos/GoogleContainerTools/jib/subscription","commits_url":"https://api.github.com/repos/GoogleContainerTools/jib/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleContainerTools/jib/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleContainerTools/jib/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleContainerTools/jib/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleContainerTools/jib/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleContainerTools/jib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleContainerTools/jib/merges","archive_url":"https://api.github.com/repos/GoogleContainerTools/jib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleContainerTools/jib/downloads","issues_url":"https://api.github.com/repos/GoogleContainerTools/jib/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleContainerTools/jib/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleContainerTools/jib/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleContainerTools/jib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleContainerTools/jib/labels{/name}","releases_url":"https://api.github.com/repos/GoogleContainerTools/jib/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleContainerTools/jib/deployments","created_at":"2018-01-22T18:30:43Z","updated_at":"2018-10-18T15:58:42Z","pushed_at":"2018-10-18T17:21:34Z","git_url":"git://github.com/GoogleContainerTools/jib.git","ssh_url":"git@github.com:GoogleContainerTools/jib.git","clone_url":"https://github.com/GoogleContainerTools/jib.git","svn_url":"https://github.com/GoogleContainerTools/jib","homepage":"","size":5992,"stargazers_count":4722,"watchers_count":4722,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":345,"mirror_url":null,"archived":false,"open_issues_count":100,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":345,"open_issues":100,"watchers":4722,"default_branch":"master"}},"base":{"label":"GoogleContainerTools:master","ref":"master","sha":"695e8159352f9a6e2c76fa5bfa443f0458e8fbd5","user":{"login":"GoogleContainerTools","id":38444003,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4NDQ0MDAz","avatar_url":"https://avatars1.githubusercontent.com/u/38444003?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleContainerTools","html_url":"https://github.com/GoogleContainerTools","followers_url":"https://api.github.com/users/GoogleContainerTools/followers","following_url":"https://api.github.com/users/GoogleContainerTools/following{/other_user}","gists_url":"https://api.github.com/users/GoogleContainerTools/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleContainerTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleContainerTools/subscriptions","organizations_url":"https://api.github.com/users/GoogleContainerTools/orgs","repos_url":"https://api.github.com/users/GoogleContainerTools/repos","events_url":"https://api.github.com/users/GoogleContainerTools/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleContainerTools/received_events","type":"Organization","site_admin":false},"repo":{"id":118497841,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg0OTc4NDE=","name":"jib","full_name":"GoogleContainerTools/jib","private":false,"owner":{"login":"GoogleContainerTools","id":38444003,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4NDQ0MDAz","avatar_url":"https://avatars1.githubusercontent.com/u/38444003?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleContainerTools","html_url":"https://github.com/GoogleContainerTools","followers_url":"https://api.github.com/users/GoogleContainerTools/followers","following_url":"https://api.github.com/users/GoogleContainerTools/following{/other_user}","gists_url":"https://api.github.com/users/GoogleContainerTools/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleContainerTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleContainerTools/subscriptions","organizations_url":"https://api.github.com/users/GoogleContainerTools/orgs","repos_url":"https://api.github.com/users/GoogleContainerTools/repos","events_url":"https://api.github.com/users/GoogleContainerTools/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleContainerTools/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/GoogleContainerTools/jib","description":":sailboat: Build container images for your Java applications.","fork":false,"url":"https://api.github.com/repos/GoogleContainerTools/jib","forks_url":"https://api.github.com/repos/GoogleContainerTools/jib/forks","keys_url":"https://api.github.com/repos/GoogleContainerTools/jib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleContainerTools/jib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleContainerTools/jib/teams","hooks_url":"https://api.github.com/repos/GoogleContainerTools/jib/hooks","issue_events_url":"https://api.github.com/repos/GoogleContainerTools/jib/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleContainerTools/jib/events","assignees_url":"https://api.github.com/repos/GoogleContainerTools/jib/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleContainerTools/jib/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleContainerTools/jib/tags","blobs_url":"https://api.github.com/repos/GoogleContainerTools/jib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleContainerTools/jib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleContainerTools/jib/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleContainerTools/jib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleContainerTools/jib/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleContainerTools/jib/languages","stargazers_url":"https://api.github.com/repos/GoogleContainerTools/jib/stargazers","contributors_url":"https://api.github.com/repos/GoogleContainerTools/jib/contributors","subscribers_url":"https://api.github.com/repos/GoogleContainerTools/jib/subscribers","subscription_url":"https://api.github.com/repos/GoogleContainerTools/jib/subscription","commits_url":"https://api.github.com/repos/GoogleContainerTools/jib/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleContainerTools/jib/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleContainerTools/jib/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleContainerTools/jib/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleContainerTools/jib/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleContainerTools/jib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleContainerTools/jib/merges","archive_url":"https://api.github.com/repos/GoogleContainerTools/jib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleContainerTools/jib/downloads","issues_url":"https://api.github.com/repos/GoogleContainerTools/jib/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleContainerTools/jib/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleContainerTools/jib/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleContainerTools/jib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleContainerTools/jib/labels{/name}","releases_url":"https://api.github.com/repos/GoogleContainerTools/jib/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleContainerTools/jib/deployments","created_at":"2018-01-22T18:30:43Z","updated_at":"2018-10-18T15:58:42Z","pushed_at":"2018-10-18T17:21:34Z","git_url":"git://github.com/GoogleContainerTools/jib.git","ssh_url":"git@github.com:GoogleContainerTools/jib.git","clone_url":"https://github.com/GoogleContainerTools/jib.git","svn_url":"https://github.com/GoogleContainerTools/jib","homepage":"","size":5992,"stargazers_count":4722,"watchers_count":4722,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":345,"mirror_url":null,"archived":false,"open_issues_count":100,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":345,"open_issues":100,"watchers":4722,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleContainerTools/jib/pulls/1156"},"html":{"href":"https://github.com/GoogleContainerTools/jib/pull/1156"},"issue":{"href":"https://api.github.com/repos/GoogleContainerTools/jib/issues/1156"},"comments":{"href":"https://api.github.com/repos/GoogleContainerTools/jib/issues/1156/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleContainerTools/jib/pulls/1156/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleContainerTools/jib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleContainerTools/jib/pulls/1156/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleContainerTools/jib/statuses/4499e2b19a03ead39be29b9ba38779e47415fe54"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"briandealwis"}}