{"action":"opened","issue":{"url":"https://api.github.com/repos/nrwl/nx/issues/613","repository_url":"https://api.github.com/repos/nrwl/nx","labels_url":"https://api.github.com/repos/nrwl/nx/issues/613/labels{/name}","comments_url":"https://api.github.com/repos/nrwl/nx/issues/613/comments","events_url":"https://api.github.com/repos/nrwl/nx/issues/613/events","html_url":"https://github.com/nrwl/nx/issues/613","id":337757395,"node_id":"MDU6SXNzdWUzMzc3NTczOTU=","number":613,"title":"Affected script fails on nested Git Repository","user":{"login":"domkrel","id":18344035,"node_id":"MDQ6VXNlcjE4MzQ0MDM1","avatar_url":"https://avatars1.githubusercontent.com/u/18344035?v=4","gravatar_id":"","url":"https://api.github.com/users/domkrel","html_url":"https://github.com/domkrel","followers_url":"https://api.github.com/users/domkrel/followers","following_url":"https://api.github.com/users/domkrel/following{/other_user}","gists_url":"https://api.github.com/users/domkrel/gists{/gist_id}","starred_url":"https://api.github.com/users/domkrel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domkrel/subscriptions","organizations_url":"https://api.github.com/users/domkrel/orgs","repos_url":"https://api.github.com/users/domkrel/repos","events_url":"https://api.github.com/users/domkrel/events{/privacy}","received_events_url":"https://api.github.com/users/domkrel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-03T06:07:21Z","updated_at":"2018-07-03T06:07:21Z","closed_at":null,"author_association":"NONE","body":"**Problem:**\r\nAffected script does not calculate the affected projects correctly\r\n```\r\nnpm run affected:* -- --base=origin/master --head=HEAD\r\ne.g. npm run affected:dep-graph -- --base=origin/master --head=HEAD\r\n```\r\n\r\n**Situation:**\r\nMono Repository that contains more than only an angular project  \r\n> monorepo\r\n  └── backend\r\n  └── angular-project\r\n  └── more stuff\r\n\r\n**Problem located:**\r\ndirectlyTouchedProjects and implicitlyTouchedProjects (@nrwl/schematics/src/command-line/affected-apps.js) do a comparison of the filename and the root of the project.\r\n\r\n- The root of a project can be something like this:  apps/my-app\r\n- The expected file path is: apps/my-app/src/my-component.ts\r\n\r\nThe path of the touched files gets calculated by getFilesUsingBaseAndHead (shared.js) which gets a path with the root of the git repository.\r\n\r\n- The expected file path is: apps/my-app/src/my-component.ts\r\n- The given file path is: **angular-project**/apps/my-app/sry/my-componen.ts\r\n- The comparison does not work on a file that starts with anything else than the project root\r\n\r\n**Not working solution:**\r\nI changed the root of the project to: angular-project/apps/my-app\r\nThis  led to a not correct calculation of the dep-graph because the file array of the projects was empty."}}
{"actor":{"display_login":"domkrel"}}