{"action":"created","issue":{"url":"https://api.github.com/repos/jenkins-x/jx/issues/2586","repository_url":"https://api.github.com/repos/jenkins-x/jx","labels_url":"https://api.github.com/repos/jenkins-x/jx/issues/2586/labels{/name}","comments_url":"https://api.github.com/repos/jenkins-x/jx/issues/2586/comments","events_url":"https://api.github.com/repos/jenkins-x/jx/issues/2586/events","html_url":"https://github.com/jenkins-x/jx/issues/2586","id":394996136,"node_id":"MDU6SXNzdWUzOTQ5OTYxMzY=","number":2586,"title":"jx import process fails on differing artifactid and app name","user":{"login":"jecafarelli","id":38661227,"node_id":"MDQ6VXNlcjM4NjYxMjI3","avatar_url":"https://avatars0.githubusercontent.com/u/38661227?v=4","gravatar_id":"","url":"https://api.github.com/users/jecafarelli","html_url":"https://github.com/jecafarelli","followers_url":"https://api.github.com/users/jecafarelli/followers","following_url":"https://api.github.com/users/jecafarelli/following{/other_user}","gists_url":"https://api.github.com/users/jecafarelli/gists{/gist_id}","starred_url":"https://api.github.com/users/jecafarelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jecafarelli/subscriptions","organizations_url":"https://api.github.com/users/jecafarelli/orgs","repos_url":"https://api.github.com/users/jecafarelli/repos","events_url":"https://api.github.com/users/jecafarelli/events{/privacy}","received_events_url":"https://api.github.com/users/jecafarelli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-31T15:33:31Z","updated_at":"2019-01-04T12:17:59Z","closed_at":null,"author_association":"NONE","body":"### Summary \r\nFound 2 bugs I am combining together on this one issue. Once triaged, they can be split up if its easier.\r\n\r\nbug 1. if there are any changes to the git repo when it gets to [this section of the code](https://github.com/jenkins-x/jx/blob/master/pkg/jx/cmd/import.go#L1291), it will try to commit code only in the chart folder. If there are no modifications to this directory, the import process will fail with error below:\r\n\r\n```\r\nerror: failed to run 'git commit -m fix:(chart) fix up the probe path' command in directory '/home/jenkins/workspace/import/git_repo', output: '# On branch jx-import-process-52\r\n# Your branch is ahead of 'origin/jx-import-process-52' by 3 commits.\r\n#   (use \"git push\" to publish your local commits)\r\n#\r\n# Changes not staged for commit:\r\n#   (use \"git add <file>...\" to update what will be committed)\r\n#   (use \"git checkout -- <file>...\" to discard changes in working directory)\r\n#\r\n#\tmodified:   .dockerignore\r\n#\r\nno changes added to commit (use \"git add\" and/or \"git commit -a\")': exit status 1\r\n```\r\n\r\nbug 2. I found the bug above, because the import process was not properly fixing the probe path in the values.yaml of the chart. When manually running [this command](https://github.com/jenkins-x/jx/blob/master/pkg/jx/cmd/import.go#L1277), I found below output:\r\n\r\n```bash-4.2$ ~/.jx/maven/bin/mvn io.jenkins.updatebot:updatebot-maven-plugin:RELEASE:chart\r\n[INFO] Scanning for projects...\r\n[INFO] \r\n...\r\n[WARNING] The values.yaml file: /home/jenkins/workspace/import/git_repo/charts/${ARTIFACT_ID}/values.yaml does not exist\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] BUILD SUCCESS\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] Total time: 3.625 s\r\n[INFO] Finished at: 2018-12-31T15:11:55Z\r\n[INFO] ------------------------------------------------------------------------\r\n```\r\n\r\nIt turned out that our artifact id in our pom.yaml did not match the APP name that was generated (guessing from the git repo name?), making the probe path not be updated, and silently failing. Should be some sort of validation that the artifact id matches the app name, or have this java command use the env var over artifact id so that it does not just silently fail when this situation happens\r\n\r\n### Steps to reproduce the behavior\r\n1. create a java repo to import. \r\n2. create a file with a .dockerignore that has Dockerfile and some other lines in it\r\n3. create a pom.xml that has an artifact Id that does not match with the APP NAME pulled from repo im guessing?\r\n4. do a jx import using the maven build pack.\r\n### Jx version\r\n\r\n```\r\nThe output of `jx version` is:\r\nbash-4.2$ jx version\r\nNAME               VERSION\r\njx                 1.3.688\r\njenkins x platform 0.0.3125\r\nKubernetes cluster v1.10.11\r\nkubectl            v1.10.3\r\nhelm client        v2.9.1+g20adb27\r\nhelm server        v2.12.0+gd325d2a\r\ngit                git version 1.8.3.1\r\nOperating System   CentOS Linux release 7.6.1810 (Core) \r\n```\r\n\r\n### Kubernetes cluster\r\n\r\nWhat kind of Kubernetes cluster are you using & how did you create it?\r\nAWS kubernetes cluster using kops\r\n### Operating system / Environment\r\n\r\n### Expected behavior\r\njx import should fail if artifactid doesnt match generated chart path name, or fix it, or use the generated path name and not artifactid.\r\n\r\njx import should be able to tell if there are changes to the git repo directory; check it its changes in the chart directory and skip commit if there are no changes.\r\n### Actual behavior\r\n\r\njx import silently fails to update probe path because it cant find the directory to the chart that matches the artifactid.\r\n\r\njx import checked for changes in git directory, then tries adding the chart directory and fails if there are no changes in that directory\r\n"},"comment":{"url":"https://api.github.com/repos/jenkins-x/jx/issues/comments/451429144","html_url":"https://github.com/jenkins-x/jx/issues/2586#issuecomment-451429144","issue_url":"https://api.github.com/repos/jenkins-x/jx/issues/2586","id":451429144,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTQyOTE0NA==","user":{"login":"jstrachan","id":30140,"node_id":"MDQ6VXNlcjMwMTQw","avatar_url":"https://avatars1.githubusercontent.com/u/30140?v=4","gravatar_id":"","url":"https://api.github.com/users/jstrachan","html_url":"https://github.com/jstrachan","followers_url":"https://api.github.com/users/jstrachan/followers","following_url":"https://api.github.com/users/jstrachan/following{/other_user}","gists_url":"https://api.github.com/users/jstrachan/gists{/gist_id}","starred_url":"https://api.github.com/users/jstrachan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jstrachan/subscriptions","organizations_url":"https://api.github.com/users/jstrachan/orgs","repos_url":"https://api.github.com/users/jstrachan/repos","events_url":"https://api.github.com/users/jstrachan/events{/privacy}","received_events_url":"https://api.github.com/users/jstrachan/received_events","type":"User","site_admin":false},"created_at":"2019-01-04T12:17:59Z","updated_at":"2019-01-04T12:17:59Z","author_association":"MEMBER","body":"@jecafarelli fancy submitting a Pull Request by any chance? :) "}}
{"actor":{"display_login":"jstrachan"}}