bitbucket-api

Bitbucket API authentication with Python's HTTPBasicAuthHandler

戏子无情 提交于 2020-01-04 04:54:31
问题 I'm trying to get the list of issues on a private repository using bitbucket's API. I have confirmed that HTTP Basic authentication works with hurl, but I am unable to authenticate in Python. Adapting the code from this tutorial, I have written the following script. import cookielib import urllib2 class API(): api_url = 'http://api.bitbucket.org/1.0/' def __init__(self, username, password): self._opener = self._create_opener(username, password) def _create_opener(self, username, password): cj

Bitbucket API 2 - create repository in a team project

限于喜欢 提交于 2020-01-01 05:34:05
问题 I have a team on my bitbucket account, myteam , which contains a project named mainproject . Whenever I want to create a repository inside I only need to execute this command line: $ curl -X POST -v -u myaccount:passwd "https://api.bitbucket.org/2.0/repositories/myteam/repo1" -d '{"scm": "git", "is_private": "true", "fork_policy": "no_public_forks"}' This works. However the issue arises when I create a second project, named secondproject . How am I supposed to tell the API to which project

bitbucket api PostRepositoryHook is not invoked on pull request merged

天涯浪子 提交于 2019-12-23 04:52:07
问题 I am using PostRepositoryHook to develop plugin to listen for all the pushes made by developer. During testing I realized that it does work when I test it using command line to run git push command. However it doesn't work when I do PR and merge my PR. Following are code details. // LoggingPostRepositoryHook.java import com.atlassian.bitbucket.hook.repository.PostRepositoryHook; import com.atlassian.bitbucket.hook.repository.PostRepositoryHookContext; import com.atlassian.bitbucket.hook

How do I post a pull request comment using BitBucket REST api 2.0?

夙愿已清 提交于 2019-12-22 03:19:21
问题 Using REST API 1.0, I can do the following POST /api/1.0/repositories/{owner}/{repo}/pullrequests/1/comments What is the equivalent of this in 2.0? 2.0 documentation for pullrequests resource states "Finally, you can use this resource to manage the comments on a pull request as well." I don't see a POST for comments similar to 1.0 companion; nor does PUT do anything about comments. Is posting comments on a PR supported in 2.0? 回答1: Unfortunately pull request comments are currently read-only

How to change committed User name in bitbucket?

雨燕双飞 提交于 2019-12-21 20:50:19
问题 How to change commit username in bitbucket account ? To change in git I have used this command git filter-branch -f --env-filter " GIT_AUTHOR_NAME='newUser' GIT_AUTHOR_EMAIL='newuser@email.com' " HEAD It only change username in local machine but not in my bitbucket account. How to change committed username in bitbucket ? 回答1: Like (almost) everything else with Git, this command only modifies your local repository. Just like when you commit or add a tag, you will have to push to BitBucket in

Bitbucket pull request builder plugin keeps triggering same commit build

折月煮酒 提交于 2019-12-21 11:57:23
问题 I need to integrate Bitbucket with Jenkins. So that whenever a PR is opened it will trigger a build in Jenkins. Then commit status of the last commit in the PR will be updated as failed or success and this commit wont trigger the build again. (This works beautiful with Github but seems to be a nightmare for me with Bitbucket) So far I did: Installed Bitbucket pull request builder plugin. Set everything up like its described in https://github.com/jenkinsci/bitbucket-pullrequest-builder-plugin

In Bitbucket API, how can I get a list of ALL licensed users?

北慕城南 提交于 2019-12-13 18:15:34
问题 I've looked at the Bitbucket API docs and this post BitBucket get list of all contributors. The second link asks about users belonging to a repo, but in my case I just want a list of ALL licensed users. Is there really NO way to do this or did I miss it in the docs? 回答1: Execute something like this: curl -s --user USER:PASS --request GET https://BITBUCKET-SERVER/rest/api/1.0/admin/users?limit=1000 | jq --raw-output '.values[] | .name + " => " + .displayName' And you'll get the "username =>

sending issue to bitbucket using oauth via bitbucket api

耗尽温柔 提交于 2019-12-13 17:58:14
问题 i have read this related question; Request OAuth token from BitBucket in that question above , it uses curl . but there must be a way to do it with gentlero-api because it has php class in it about oauth. $bb_user = 'myuser_name'; $bb_pass = 'mypasss'; $account_name = 'account_name'; $repo_slug = 'repo_name'; $issue = new issues(); $issue->setCredentials( new Basic($bb_user, $bb_pass) ); // iwanna do something like. but how?? // $issue->setCredentials( new Oauth($key, $secret) ); $issue-

calling function names with strings python

ⅰ亾dé卋堺 提交于 2019-12-12 04:07:07
问题 I would like to be able to pass a call of either get , post , delete , etc, into my requests function. So instead of having all these different functions for each RESTFULness, I'd like to have a func like: I have: class BitbucketAPIHoss(object): API_URL_1 = 'https://api.bitbucket.org/1.0/' API_URL_2 = 'https://api.bitbucket.org/2.0/' HEADERS = {'Content-Type': 'application/json'} def __init__(self, username='codyc54321', password='trump_4_dictator_of_milky_way'): self.username = username self

Bitbucket API bad request while trying to merge

你说的曾经没有我的故事 提交于 2019-12-12 02:06:38
问题 This is my code: $url = "https://bitbucket.org/api/2.0/repositories/***/***/pullrequests/35/merge"; $curl1 = curl_init(); curl_setopt($curl1, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ); curl_setopt($curl1, CURLOPT_USERPWD, "***:***"); curl_setopt($curl1, CURLOPT_HEADER, true); curl_setopt($curl1, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); curl_setopt($curl1, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl1, CURLOPT_URL, $url); curl_setopt($curl1, CURLOPT_RETURNTRANSFER, true);