{"action":"created","issue":{"url":"https://api.github.com/repos/fastlane/pilot/issues/68","labels_url":"https://api.github.com/repos/fastlane/pilot/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/fastlane/pilot/issues/68/comments","events_url":"https://api.github.com/repos/fastlane/pilot/issues/68/events","html_url":"https://github.com/fastlane/pilot/pull/68","id":114256012,"number":68,"title":"Make wait_for_processing interval configurable","user":{"login":"rymir","id":2323918,"avatar_url":"https://avatars.githubusercontent.com/u/2323918?v=3","gravatar_id":"","url":"https://api.github.com/users/rymir","html_url":"https://github.com/rymir","followers_url":"https://api.github.com/users/rymir/followers","following_url":"https://api.github.com/users/rymir/following{/other_user}","gists_url":"https://api.github.com/users/rymir/gists{/gist_id}","starred_url":"https://api.github.com/users/rymir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rymir/subscriptions","organizations_url":"https://api.github.com/users/rymir/orgs","repos_url":"https://api.github.com/users/rymir/repos","events_url":"https://api.github.com/users/rymir/events{/privacy}","received_events_url":"https://api.github.com/users/rymir/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-30T11:55:24Z","updated_at":"2015-10-30T18:42:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fastlane/pilot/pulls/68","html_url":"https://github.com/fastlane/pilot/pull/68","diff_url":"https://github.com/fastlane/pilot/pull/68.diff","patch_url":"https://github.com/fastlane/pilot/pull/68.patch"},"body":"Running `pilot` on CI server, it takes about 5 mins in iTunes Connect for the build to appear in \"Processing\" state and about 15 mins for the build to be processed. That means ~10 network requests for the former (current sleep time 30 seconds) and more then 100 network requests for the latter (second current sleep 5 seconds only).\r\n\r\nNetwork requests sometimes fail or timeout (it happens), would be nice for pilot to retry instead of failing in case of a failed network request, but for now this makes the `wait_processing_interval` configurable so we can reduce the number of network requests and the probability of false positives."},"comment":{"url":"https://api.github.com/repos/fastlane/pilot/issues/comments/152613280","html_url":"https://github.com/fastlane/pilot/pull/68#issuecomment-152613280","issue_url":"https://api.github.com/repos/fastlane/pilot/issues/68","id":152613280,"user":{"login":"rymir","id":2323918,"avatar_url":"https://avatars.githubusercontent.com/u/2323918?v=3","gravatar_id":"","url":"https://api.github.com/users/rymir","html_url":"https://github.com/rymir","followers_url":"https://api.github.com/users/rymir/followers","following_url":"https://api.github.com/users/rymir/following{/other_user}","gists_url":"https://api.github.com/users/rymir/gists{/gist_id}","starred_url":"https://api.github.com/users/rymir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rymir/subscriptions","organizations_url":"https://api.github.com/users/rymir/orgs","repos_url":"https://api.github.com/users/rymir/repos","events_url":"https://api.github.com/users/rymir/events{/privacy}","received_events_url":"https://api.github.com/users/rymir/received_events","type":"User","site_admin":false},"created_at":"2015-10-30T18:42:16Z","updated_at":"2015-10-30T18:42:16Z","body":"I changed and amended the commit. @KrauseFx keep in mind that this pull request changes both the sleep intervals to the same config option `wait_processing_interval`, you good with that? \r\n\r\nIn any case, just for information, we ended up using a different approach on our `Fastfile`, cause our requirement was to be 99,99% sure iTunes Connect received our release build from the CI server and we cannot really rely on the `waiit_for_processing` feature cause sometimes iTunes Connect really takes ages and makes the build abort (max build time 2700s). Here is the approach we took:\r\n\r\n```Ruby\r\ndef push_release\r\n    pilot(\r\n        username: \"xxx@xxx.xxx\",\r\n        app_identifier: \"xxx.xxx.xxx\",\r\n        ipa: \"./xxx.ipa\",\r\n        skip_submission: true\r\n    )\r\n    wait_until_release_pushed\r\nend\r\n\r\ndef wait_until_release_pushed(retries = 10, wait_interval = 60)\r\n    require \"pilot\"\r\n    puts \"Checking release (#{$version_number}-b#{$build_number}) has been pushed:\"\r\n    begin\r\n        sleep wait_interval\r\n        puts \"Inspecting iTunes Connect builds...\"\r\n        app = Spaceship::Application.find $app_identifier\r\n        builds = app.all_processing_builds + app.builds\r\n        retries = retries - 1\r\n    end while retries > 0 and not is_release_pushed(builds)\r\nend\r\n\r\ndef is_release_pushed(builds)\r\n    builds.find { |b|\r\n        (b.build_version == $build_number) &&\r\n        (b.train_version == $version_number)\r\n    }\r\nend\r\n```\r\n\r\n"}}