{"action":"opened","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/430","repository_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/430/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/430/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/430/events","html_url":"https://github.com/spring-cloud/spring-cloud-config/issues/430","id":162706479,"number":430,"title":"JGitEnvironmentRepository.shouldPull() isClean() check hides dirty local repo bug","user":{"login":"jeffnelson","id":15911380,"avatar_url":"https://avatars.githubusercontent.com/u/15911380?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffnelson","html_url":"https://github.com/jeffnelson","followers_url":"https://api.github.com/users/jeffnelson/followers","following_url":"https://api.github.com/users/jeffnelson/following{/other_user}","gists_url":"https://api.github.com/users/jeffnelson/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffnelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffnelson/subscriptions","organizations_url":"https://api.github.com/users/jeffnelson/orgs","repos_url":"https://api.github.com/users/jeffnelson/repos","events_url":"https://api.github.com/users/jeffnelson/events{/privacy}","received_events_url":"https://api.github.com/users/jeffnelson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-06-28T14:54:20Z","updated_at":"2016-06-28T14:54:20Z","closed_at":null,"body":"Running config server version 1.0.4.RELEASE, but it appears this applies to most (if not all) versions.\r\n\r\nWe've been dealing with an issue with config server returning environment data that does not reflect what is actually in git. We went through many theories on why or how config server was going 'stale'.\r\n\r\nWe finally figured out that one of our chef jobs was deleting files and folders on the servers with the same name as each microservice as part of a cleanup each time chef runs. This, of course, is a problem for config server because the files in its repo match the app name. Many files within the local git repo used by config server were getting deleted, which causes the repo to become 'dirty'. The current impl of the JGitEnvironmentRepository.shouldPull() method returns false whenever the local repo is not clean.\r\n\r\n```\r\n\tprivate boolean shouldPull(Git git, Ref ref) throws GitAPIException {\r\n\t\treturn git.status().call().isClean() && ref != null && git.getRepository()\r\n\t\t\t\t.getConfig().getString(\"remote\", \"origin\", \"url\") != null;\r\n\t}\r\n```\r\n\r\nIs there a good use case for this local repo to ever be dirty? Shouldn't config server just accept whatever comes from the remote (if there is one)? If there is a good use case for this that I am simply not aware of or not thinking of, feel free to close this issue.\r\n\r\nWe have changed our chef jobs to be less aggressive and more specific in their cleanup. We will also be looking at adding in an extra health check for config server to check for isClean.\r\n\r\nHopefully this helps someone down the road."}}
{"actor":{"display_login":"jeffnelson"}}