Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is Bitbucket cloud working or what did I missed out? #763

Open
barrault01 opened this issue Mar 23, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@barrault01
Copy link

commented Mar 23, 2017

Report

What did you do?

I run bundle exec danger on CI (bitrise).
With the envirronment variables (DANGER_BITBUCKETCLOUD_USERNAME, DANGER_BITBUCKETCLOUD_PASSWORD) setted.

What did you expect to happen?

It should run Danger.

What happened instead?

This is the outpout from the CI:

Could not set up API to Code Review site for Danger

For your BitbucketCloud repo, you need to expose: DANGER_BITBUCKETCLOUD_USERNAME, DANGER_BITBUCKETCLOUD_PASSWORD

Found these keys in your ENV: BITRISE_CERTIFICATE_URL, BITRISE_BUILD_STATUS, BITRISE_CERTIFICATE_PASSPHRASE, BITRISE_OSX_STACK_REV_ID, SHELL, BITRISE_GIT_BRANCH, TMPDIR, BITRISE_BUILD_API_TOKEN, Apple_PubSub_Socket_Render, BITRISE_APP_TITLE, SSH_RSA_PRIVATE_KEY, BITRISE_BUILD_URL, BITRISE_BRIDGE_WORKDIR, BITRISE_GIT_MESSAGE, BITRISE_DEPLOY_DIR, BITRISE_KEYCHAIN, BITRISE_LIBRARY_DIR, BITRISE_SOURCE_DIR, DANGER_BITBUCKETCLOUD_PASSWORD, LC_ALL, GIT_CLONE_COMMIT_COMMITER_NAME, DOTPROFILE_LOADED, script_file_path, BITRISE_IO, USER, BITRISEIO_GIT_BRANCH_DEST, HOMEBREW_NO_ANALYTICS, ENVMAN_ENVSTORE_PATH, BITRISE_CACHE_DIR, SSH_AUTH_SOCK, HOMEBREW_NO_AUTO_UPDATE, GIT_CLONE_COMMIT_MESSAGE_SUBJECT, BITRISE_TOOLS_FOLDER_PATH, BITRISE_SYM_ROOT, MATCH_KEYCHAIN_PASSWORD, BITRISE_PULL_REQUEST, BITRISE_CACHE_API_URL, BITRISE_STEP_DIR, BITRISE_APP_SLUG, PATH, GIT_REPOSITORY_URL, BITRISE_GIT_COMMIT, _, BITRISE_TRIGGERED_WORKFLOW_TITLE, FASTLANE_WORK_DIR, PWD, PR, LANG, runner_bin, BITRISE_FOLDER_PATH, BITRISE_STEP_FORMATTED_OUTPUT_FILE_PATH, XPC_FLAGS, content, BITRISE_PROFILE_DIR, BITRISE_STEP_DATA_FOLDER_PATH, DANGER_BITBUCKETCLOUD_USERNAME, GIT_CLONE_COMMIT_HASH, FASTLANE_LANE, BITRISE_KEYCHAIN_PASSWORD, XPC_SERVICE_NAME, STEPLIB_BUILD_STATUS, SHLVL, HOME, PULL_REQUEST_ID, LANGUAGE, GIT_CLONE_COMMIT_AUTHOR_NAME, GIT_CLONE_COMMIT_COMMITER_EMAIL, CI, LOGLEVEL, GIT_CLONE_COMMIT_AUTHOR_EMAIL, DOTBASHPROFILE_LOADED, LOGNAME, BITRISEIO_PULL_REQUEST_REPOSITORY_URL, BITRISE_APP_URL, BITRISE_BUILD_NUMBER, GIT_CLONE_COMMIT_MESSAGE_BODY, BITRISE_OBJ_ROOT, GOPATH, BITRISE_BUILD_TRIGGER_TIMESTAMP, BITRISE_PROVISION_URL, is_debug, working_dir, DOT_BITRISE_PROFILE_LOADED, BITRISE_TRIGGERED_WORKFLOW_ID, BITRISE_TOOLS_CMD_BRIDGE_PATH, DOTBASHRC_LOADED, BITRISE_BUILD_SLUG, __CF_USER_TEXT_ENCODING, BUNDLER_ORIG_PATH, BUNDLE_BIN_PATH, BUNDLE_GEMFILE, BUNDLER_VERSION, RUBYOPT, RUBYLIB, GEM_PATH, GEM_HOME, MANPATH.

Failing the build, Danger cannot run without API access.
You can see more information at http://danger.systems/guides/getting_started.htm

Your Environment

bitrise with bitbucket.org

@barrault01 barrault01 changed the title Is Bitbucket cloud working? Is Bitbucket cloud working or what did I missed out? Mar 23, 2017

@orta

This comment has been minimized.

Copy link
Member

commented Mar 23, 2017

Hrm, I wonder if this is due to

You will also want to ensure that ghprbPullId is added into the environment with the Pull Request id so that Danger can use your Bitbucket Server’s API. As of right now, only Jenkins is supported for Bitbucket Server, we’re open to improvements there, for sure.

Looks like it currently only supports Jenkins, I bet you could fix this though. It currently only looks for ghprbPullId, but you could make it use PULL_REQUEST_ID instead ( judging on this: https://github.com/danger/danger/pull/555/files#diff-7425abf529f6e3186c448c53d09cc771R10 )

@orta

This comment has been minimized.

Copy link
Member

commented Mar 23, 2017

Or you could try moving that ENV var in the CI script, trying something like ghprbPullId=${PULL_REQUEST_ID} bundle exec danger at a guess

@barrault01

This comment has been minimized.

Copy link
Author

commented Mar 23, 2017

I run : bundle exec danger pr https://bitbucket.org/antoinebarrault/project-ios/pull-requests/1 locally and I get :

bundler: failed to load command: danger (/Users/antoinebarrault/.rbenv/versions/2.3.1/bin/danger)
Octokit::NotFound: GET https://api.github.com/repos/antoinebarrault/project-ios/pulls/1: 404 - Not Found // See: https://developer.github.com/v3

@orta

This comment has been minimized.

Copy link
Member

commented Mar 23, 2017

danger pr only works on github I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.