bitbucket-rest-api / bitbucket Goto Github PK
View Code? Open in Web Editor NEWBitBucket API gem - bitbucket_rest_api
License: MIT License
BitBucket API gem - bitbucket_rest_api
License: MIT License
Using 0.1.7:
r = cl.repos.pull_request.all("zck", "2048.el")
r.values[1].each do |pr|
p pr.author.username
p pr.links.self.href
# This does not cause the error
# p pr["links"].self.href
end
Error is:
/Users/sshaw/.rvm/gems/ruby-2.2.3/gems/bitbucket_rest_api-0.1.7/lib/bitbucket_rest_api/result.rb:64:in `links': uninitialized constant BitBucket::PageLinks (NameError)
from bb.rb:32:in `block in <main>'
from bb.rb:30:in `each'
from bb.rb:30:in `<main>'
Calling pr["links"].self.href
does not cause the error.
Hi vongrippen:
Is there an users/user Endpoint implementation class?
https://confluence.atlassian.com/display/BITBUCKET/user+Endpoint
https://confluence.atlassian.com/display/BITBUCKET/users+Endpoint
BR.
When attempting to create a webhook via the gem, e.g.
client.repos.webhooks.create('repo_owner', 'repo_name', description: "Test Webhook", url: 'http://www.example.com/callbacks/bitbucket', active: false, events: ['repo:push'])
results in
BitBucket::Error::Unauthorized: #<struct Faraday::Env method=:post, body="", url=#<URI::HTTPS https://api.bitbucket.org/2.0/repositories/testributor/katana/hooks>, request=#<Faraday::RequestOptions oauth=true>, request_headers={"User-Agent"=>"BitBucket Ruby Gem 0.1.7", "Content-Type"=>"application/x-www-form-urlencoded", "Authorization"=>"OAuth oauth_consumer_key=\"7CjsrYVQ9SCdTioSU3v\", oauth_nonce=\"bafb5f3924d2f606c4ed3beaaf2b1f29\", oauth_signature=\"Mdm%2BjIqfceg%2BdZ1l887nad%2BcmyY%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1459954879\", oauth_token=\"4XqGMTY2UnyFnhcudm\", oauth_version=\"1.0\""}, ssl=#<Faraday::SSLOptions (empty)>, parallel_manager=nil, params=nil, response=#<Faraday::Response:0x007fdbf0376878 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:post @body="" @url=#<URI::HTTPS https://api.bitbucket.org/2.0/repositories/testributor/katana/hooks> @request=#<Faraday::RequestOptions oauth=true> @request_headers={"User-Agent"=>"BitBucket Ruby Gem 0.1.7", "Content-Type"=>"application/x-www-form-urlencoded", "Authorization"=>"OAuth oauth_consumer_key=\"7CjsrYVQ9SCdTioSU3v\", oauth_nonce=\"bafb5f3924d2f606c4ed3beaaf2b1f29\", oauth_signature=\"Mdm%2BjIqfceg%2BdZ1l887nad%2BcmyY%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1459954879\", oauth_token=\"4XqGMTY2UnyFnhcudm\", oauth_version=\"1.0\""} @ssl=#<Faraday::SSLOptions (empty)> @response=#<Faraday::Response:0x007fdbf0376878 ...> @response_headers={"server"=>"nginx/1.6.2", "vary"=>"Cookie", "www-authenticate"=>"Basic realm=\"Bitbucket.org HTTP\"", "content-type"=>"text/html; charset=utf-8", "strict-transport-security"=>"max-age=31536000", "date"=>"Wed, 06 Apr 2016 15:01:20 GMT", "x-served-by"=>"app-113", "x-static-version"=>"195aa3f25c29", "etag"=>"\"d41d8cd98f00b204e9800998ecf8427e\"", "x-render-time"=>"0.0133571624756", "connection"=>"close", "x-version"=>"195aa3f25c29", "x-request-count"=>"378", "x-frame-options"=>"SAMEORIGIN", "content-length"=>"0"} @status=401>>, response_headers={"server"=>"nginx/1.6.2", "vary"=>"Cookie", "www-authenticate"=>"Basic realm=\"Bitbucket.org HTTP\"", "content-type"=>"text/html; charset=utf-8", "strict-transport-security"=>"max-age=31536000", "date"=>"Wed, 06 Apr 2016 15:01:20 GMT", "x-served-by"=>"app-113", "x-static-version"=>"195aa3f25c29", "etag"=>"\"d41d8cd98f00b204e9800998ecf8427e\"", "x-render-time"=>"0.0133571624756", "connection"=>"close", "x-version"=>"195aa3f25c29", "x-request-count"=>"378", "x-frame-options"=>"SAMEORIGIN", "content-length"=>"0"}, status=401>
Now, the response code is misleading. Bitbucket's API shouldn't return 401, as there's no problem with the authorization. I retried other calls with the same keys and they work just fine.
The problem is the "Content-Type"=>"application/x-www-form-urlencoded"
. This should be application/json
. If one attempts to replicate the same call via Postman or curl
, the results are consistent. With the gem's incorrect method a 401 is returned, but with the correct method, 201 (Created) is returned.
It also seems that this 0e53c0e does not fix the problem.
Hi, I'm trying to connect to my BitBucket repos:
bb = BitBucket.new do |config|
config.oauth_token = ''
config.oauth_secret = ''
config.client_id = '*********'
config.client_secret = '**************************'
config.adapter = :net_http
end
I've generated consumer key:secret pair, but how I can get oauth token:secret pair?
Without them I am not able to connect to API :(
Hey,
Forgive my ignorance, but for the lack of a better idea, I need some help with debugging this oAuth problem - which I'm sure your sick of by now ๐
I've successfully gotten a token/secret by using https://github.com/sishen/omniauth-bitbucket.
I'm trying to access the BitBucket API like so:
omniauth = request.env['omniauth.auth']
token = omniauth['credentials']['token']
secret = omniauth['credentials']['secret']
bitbucket = BitBucket.new(oauth_secret: secret, oauth_token: token)
But I'm getting a BitBucket::Error::Unauthorized
on every call. Do I have to include my consumer key/secret or something? Am I storing the wrong thing from the bitbucket omniauth auth_hash perhaps?
Keith
I have scoured the documentation and examples and am unable to find any way of deleting a repository?
Could you please add an example of this somewhere
I use Bitbucket.repos.list to show all repos, (many repos are same name)
But i want to show only list repos name "example".
I found method get but don't know use,
Tell me, Please.
I cant download repos and recieve message " bad URI(is not URI?): /api/1.0/repositories/#User:0x000000045aff10/demo_1 "
I think this gem version api 1.0, so cant download
Please, help me.
def index
@repositories = set_bitbucket(current_user).repos
@repos = @repositories.get(current_user,"demo_1")
end
def set_bitbucket(user)
bitbucket = BitBucket.new do |config|
config.oauth_token = user.oauth_token
config.oauth_secret = user.oauth_secret
config.client_id = Settings.BITBUCKET_CLIENT_ID
config.client_secret = Settings.BITBUCKET_CLIENT_SECRET
config.adapter = :net_http
end
end
how to download repos?
this is my code, but cant download repos
in controller :
`def set_bitbucket(user)
bitbucket = BitBucket.new do |config|
config.oauth_token = user.oauth_token
config.oauth_secret = user.oauth_secret
config.client_id = Settings.BITBUCKET_CLIENT_ID
config.client_secret = Settings.BITBUCKET_CLIENT_SECRET
config.adapter = :net_http
end
end
def index
@repositories = set_bitbucket(current_user).repos
end
**in view :**
i read file download.rb in api, but i dont how to get params[:commit_hash] and understand REQUIRED_KEY_PARAM_NAMES.
@vongrippen please help me, thank you.
in download.rb :
`module BitBucket
class Repos::Download < API
REQUIRED_KEY_PARAM_NAMES = %w[ commit_hash ].freeze
def get(user_name, repo_name, params={})
_update_user_repo_params(user_name, repo_name)
_validate_user_repo_params(user, repo) unless user? && repo?
#assert_required_keys(REQUIRED_KEY_PARAM_NAMES, params)
"https://bitbucket.org/#{user}/#{repo.downcase}/get/#{params[:commit_hash]}.tar.gz"
end
end # Repos::Keys
end # BitBucket
`
Howdy.
I've seen the other OAuth issue and I can definitely guarantee that my key and secret are what they should be.
Here's the code I have...
require 'bitbucket_rest_api'
ENV['DEBUG'] = 'wtf'
bitbucket = BitBucket.new do |config|
config.oauth_token = "<redacted>"
config.oauth_secret = "<redacted>"
config.adapter = :net_http
end
pp bitbucket.repos.list
And here's the debug info...
EXECUTED: get - /user/repositories with {} and {}
OPTIONS:{:headers=>{"User-Agent"=>"BitBucket Ruby Gem 0.1.1"}, :ssl=>{:verify=>false}, :url=>"https://bitbucket.org/api/1.0"}
I, [2013-01-31T20:14:26.168358 #18994] INFO -- : get https://bitbucket.org/api/1.0/user/repositories
D, [2013-01-31T20:14:26.168490 #18994] DEBUG -- request: User-Agent: "BitBucket Ruby Gem 0.1.1"
Authorization: "OAuth oauth_nonce=\"cea1a1e17bad92529dd2ce92ea12c68c\", oauth_signature=\"C9LPWYfXaMNIoenrD2R3BviX6PU%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1359681266\", oauth_token=\"<redacted>\", oauth_version=\"1.0\""
I, [2013-01-31T20:14:26.665307 #18994] INFO -- Status: 302
D, [2013-01-31T20:14:26.665494 #18994] DEBUG -- response: server: "nginx/1.2.4"
date: "Fri, 01 Feb 2013 01:14:26 GMT"
content-type: "text/html; charset=utf-8"
transfer-encoding: "chunked"
connection: "close"
x-served-by: "bitbucket05"
x-version: "908585ddfd1f"
location: "https://bitbucket.org/account/signin/?next=/api/1.0/user/repositories"
x-static-version: "e2e3e99aa1fa"
x-request-count: "333"
strict-transport-security: "max-age=2592000"
The pp line simply outputs nil because bitbucket.repos.list returns nil. Does the gem need to be updated or something?
When trying to do:
bitbucket.client.repos.pull_request.list('user', 'repo').each_page do |page|
# stuff
end
it throws this error: uninitialized constant BitBucket::PageIterator
I can't find the PageIterator in this repo, or am I missing something?
There some PRs to make updates for Bitbucket's 2.0 endpoint that have not been merged.
At this point 1.0 is no longer functioning which breaks things in this lib that are still using it (like issues).
Would be great if you can do a release with the 2.0 PRs merged, at least. Or make me an owner give me permissions and I'll do it @dmgarland @vongrippen.
Add to issues.rb the following (copy-paste of get method):
# Delete a single issue
#
# = Examples
# bitbucket = BitBucket.new
# bitbucket.issues.delete 'user-name', 'repo-name', 'issue-id'
#
def delete(user_name, repo_name, issue_id, params={ })
_update_user_repo_params(user_name, repo_name)
_validate_user_repo_params(user, repo) unless user? && repo?
_validate_presence_of issue_id
normalize! params
# _merge_mime_type(:issue, params)
delete_request("/repositories/#{user}/#{repo}/issues/#{issue_id}", params)
end
I tried to create a repository for a team (which I have access to):
bb.repos.create owner: 'some_owner', name: 'test'
But it didn't really work. It created a repository under my name. The owner is still my user name instead of the team name.
I also tried to add an owner parameter using BitBucket REST API Console, and it works there. So I think there may be something wrong happening here.
Thanks.
Something strange happens with this endpoint.
Net::HTTP throws EOFError which results in the following exception being raise from Faraday:
end of file reached (Faraday::ConnectionFailed)
To reproduce simply run the following on latests master:
client = BitBucket.new(oauth_token: bitbucket_access_token, oauth_secret: bitbucket_access_token_secret)
client.user_api.repositories
The strange thing is that if I replace the API url from "https://api.bitbucket.org" to "https://bitbucket.org/api" it works. I compared the two requests and they are the same (except for the different url). This must have happened today because yesterday I'm sure it was working.
To make it more complicated, both urls behave the same when I use Postman (they both work) so I can't open an issue on Bitbucket for this. I turned debugging on with set_debug_output($stdout)
on Net::HTTP and the only difference is the error:
Failing debug output:
opening connection to api.bitbucket.org:443...
opened
starting SSL for api.bitbucket.org:443...
SSL established
Net::HTTP#set_debug_output called after HTTP started
<- "GET /1.0/user/repositories HTTP/1.1\r\nUser-Agent: BitBucket Ruby Gem 0.1.7\r\nAuthorization: OAuth oauth_consumer_key=\"sensitive_credentials_here\", oauth_nonce=\"f3edbddd965663cf27a93a67aaedeede\", oauth_signature=\"vT0VE7diL0myLGQWwMI0PfyFKoI%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1465571418\", oauth_token=\"sensitive_credentials\", oauth_version=\"1.0\"\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nConnection: close\r\nHost: api.bitbucket.org\r\n\r\n"
Conn close because of error end of file reached, and retry
opening connection to api.bitbucket.org:443...
opened
starting SSL for api.bitbucket.org:443...
SSL established
<- "GET /1.0/user/repositories HTTP/1.1\r\nUser-Agent: BitBucket Ruby Gem 0.1.7\r\nAuthorization: OAuth oauth_consumer_key=\"sensitive_credentials_here\", oauth_nonce=\"f3edbddd965663cf27a93a67aaedeede\", oauth_signature=\"vT0VE7diL0myLGQWwMI0PfyFKoI%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1465571418\", oauth_token=\"sensitive_credentials_here\", oauth_version=\"1.0\"\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nConnection: close\r\nHost: api.bitbucket.org\r\n\r\n"
Conn close because of error end of file reached
Conn close because of error end of file reached
/home/dimitris/.rvm/gems/ruby-2.3.0@katana/gems/spring-1.3.6/lib/spring/application.rb:156:in `fork': end of file reached (Faraday::ConnectionFailed)
Working debug output:
opening connection to bitbucket.org:443...
opened
starting SSL for bitbucket.org:443...
SSL established
Net::HTTP#set_debug_output called after HTTP started
<- "GET /api/1.0/user/repositories HTTP/1.1\r\nUser-Agent: BitBucket Ruby Gem 0.1.7\r\nAuthorization: OAuth oauth_consumer_key=\"sensitive_debug_output\", oauth_nonce=\"c3fa96d07995b57c84aedd62b3bf28d1\", oauth_signature=\"FNFPkXpOiD6AUGE97yn%2Ff53UujU%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1465571438\", oauth_token=\"sensitive_debug_output\", oauth_version=\"1.0\"\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nConnection: close\r\nHost: bitbucket.org\r\n\r\n"
-> "HTTP/1.1 200 OK\r\n"
-> "Server: nginx/1.6.2\r\n"
-> "Vary: Authorization, Cookie\r\n"
-> "Vary: Accept-Encoding\r\n"
-> "Content-Type: application/json; charset=utf-8\r\n"
-> "X-OAuth-Scopes: webhook, repository:admin, repository, account\r\n"
-> "Content-Encoding: gzip\r\n"
-> "Strict-Transport-Security: max-age=31536000\r\n"
-> "Date: Fri, 10 Jun 2016 15:09:29 GMT\r\n"
-> "X-Served-By: app-111\r\n"
-> "X-Static-Version: 660dd275ada4\r\n"
-> "ETag: \"87914e45bea56a015507239d2b9c0883\"\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "X-Render-Time: 0.0379409790039\r\n"
-> "X-Accepted-OAuth-Scopes: repository\r\n"
-> "Connection: close\r\n"
-> "X-Version: 660dd275ada4\r\n"
-> "X-Request-Count: 156\r\n"
-> "X-Frame-Options: SAMEORIGIN\r\n"
-> "\r\n"
reading all...
...
(and the rest is the repository results in JSON format)
It seems that the first case is retried once before exiting with error.
Looks like lots of pieces have been added here with support for webhooks, getting individual pull requests etc... but there has been no new version release in a while?
Is there something that still needs to be done in order to get a new release out?
bitbucket.repos.all
BitBucket::Error::Unauthorized: #<struct Faraday::Env method=:get, body="", url=#<URI::HTTPS https://bitbucket.org/api/1.0/user/repositories>, request=#<Faraday::RequestOptions proxy=#<Faraday::ProxyOptions uri=#<URI::HTTP http://10.6.13.77:8080/>>, oauth=true>, request_headers={"User-Agent"=>"BitBucket Ruby Gem 0.1.7", "Authorization"=>"OAuth oauth_consumer_key="XXX", oauth_nonce="d161352d7fd1b7ba7207a457c43038cf", oauth_signature="%2BsDwJGrBRMcSYkoxmDc%2BVJFtAZg%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1459756974", oauth_token="", oauth_version="1.0""}, ssl=#<Faraday::SSLOptions (empty)>, parallel_manager=nil, params=nil, response=#<Faraday::Response:0x000000021c3318 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:get @Body="" @url=#<URI::HTTPS https://bitbucket.org/api/1.0/user/repositories> @request=#<Faraday::RequestOptions proxy=#<Faraday::ProxyOptions uri=#<URI::HTTP http://10.6.13.77:8080/>>, oauth=true> @request_headers={"User-Agent"=>"BitBucket Ruby Gem 0.1.7", "Authorization"=>"OAuth oauth_consumer_key="XXX", oauth_nonce="d161352d7fd1b7ba7207a457c43038cf", oauth_signature="%2BsDwJGrBRMcSYkoxmDc%2BVJFtAZg%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1459756974", oauth_token="", oauth_version="1.0""} @ssl=#<Faraday::SSLOptions (empty)> @response=#<Faraday::Response:0x000000021c3318 ...> @response_headers={"server"=>"nginx/1.6.2", "vary"=>"Cookie", "www-authenticate"=>"Basic realm="Bitbucket.org HTTP"", "content-type"=>"text/html; charset=utf-8", "strict-transport-security"=>"max-age=31536000", "date"=>"Mon, 04 Apr 2016 08:02:54 GMT", "x-served-by"=>"app-113", "x-static-version"=>"9d27a7681f21", "etag"=>""d41d8cd98f00b204e9800998ecf8427e"", "x-render-time"=>"0.00727915763855", "connection"=>"close", "x-version"=>"9d27a7681f21", "x-request-count"=>"212", "x-frame-options"=>"SAMEORIGIN", "content-length"=>"0"} @status=401>>, response_headers={"server"=>"nginx/1.6.2", "vary"=>"Cookie", "www-authenticate"=>"Basic realm="Bitbucket.org HTTP"", "content-type"=>"text/html; charset=utf-8", "strict-transport-security"=>"max-age=31536000", "date"=>"Mon, 04 Apr 2016 08:02:54 GMT", "x-served-by"=>"app-113", "x-static-version"=>"9d27a7681f21", "etag"=>""d41d8cd98f00b204e9800998ecf8427e"", "x-render-time"=>"0.00727915763855", "connection"=>"close", "x-version"=>"9d27a7681f21", "x-request-count"=>"212", "x-frame-options"=>"SAMEORIGIN", "content-length"=>"0"}, status=401>
`
Need help to understand how to achieve this.
Hi,
I've tried connecting to bitbucket using the Oauth tokens and for some reason I can't get no results of any kind.
Using the basic auth it works great.
prs = bitbucket.repos.pull_request.list('zenvia-sms', application, { "state" => "MERGED, OPEN, DECLINED" })
prs['values'].each do |pr|
//only first page
end
By the looks of it ( https://github.com/bitbucket-rest-api/bitbucket/blob/master/lib/bitbucket_rest_api/connection.rb#L32 ), by default SSL verification is turned off in the gem.
This is greatly discouraged practice ( see Solutions To Avoid
https://github.com/lostisland/faraday/wiki/Setting-up-SSL-certificates ), as we now have the same guarantees about validity of our peer as if we were to use an HTTP connection.
I'd encourage for this gem to turn SSL verification on to guarantee peer validation in the default scenario and thus for it to be a secure default.
Hello! I'm doing this:
bitbucket.repos.services.delete repo_organization, repo_name, webhook_id
And service was deleted, but exception was raised:
can't modify frozen NilClass
/vagrant/vendor/bundle/ruby/2.2.0/gems/bitbucket_rest_api-0.1.5/lib/bitbucket_rest_api/response/helpers.rb:17:in block in on_complete' /vagrant/vendor/bundle/ruby/2.2.0/gems/bitbucket_rest_api-0.1.5/lib/bitbucket_rest_api/response/helpers.rb:17:in
instance_eval'
/vagrant/vendor/bundle/ruby/2.2.0/gems/bitbucket_rest_api-0.1.5/lib/bitbucket_rest_api/response/helpers.rb:17:in on_complete' /vagrant/vendor/bundle/ruby/2.2.0/gems/faraday-0.8.9/lib/faraday/response.rb:9:in
block in call'
/vagrant/vendor/bundle/ruby/2.2.0/gems/faraday-0.8.9/lib/faraday/response.rb:63:in on_complete' /vagrant/vendor/bundle/ruby/2.2.0/gems/faraday-0.8.9/lib/faraday/response.rb:8:in
call'
/vagrant/vendor/bundle/ruby/2.2.0/gems/faraday_middleware-0.9.1/lib/faraday_middleware/request/encode_json.rb:23:in call' /vagrant/vendor/bundle/ruby/2.2.0/gems/faraday_middleware-0.9.1/lib/faraday_middleware/request/oauth.rb:42:in
call'
/vagrant/vendor/bundle/ruby/2.2.0/gems/faraday-0.8.9/lib/faraday/request/url_encoded.rb:14:in call' /vagrant/vendor/bundle/ruby/2.2.0/gems/faraday-0.8.9/lib/faraday/request/multipart.rb:13:in
call'
/vagrant/vendor/bundle/ruby/2.2.0/gems/faraday-0.8.9/lib/faraday/connection.rb:253:in run_request' /vagrant/vendor/bundle/ruby/2.2.0/gems/faraday-0.8.9/lib/faraday/connection.rb:106:in
delete'
/vagrant/vendor/bundle/ruby/2.2.0/gems/bitbucket_rest_api-0.1.5/lib/bitbucket_rest_api/request.rb:41:in request' /vagrant/vendor/bundle/ruby/2.2.0/gems/bitbucket_rest_api-0.1.5/lib/bitbucket_rest_api/request.rb:27:in
delete_request'
/vagrant/vendor/bundle/ruby/2.2.0/gems/bitbucket_rest_api-0.1.5/lib/bitbucket_rest_api/repos/services.rb:99:in delete' /vagrant/lib/bitbucket_manager.rb:34:in
delete_web_hook'
I'm doing something wrong?
GET a list of a pull request comments: https://confluence.atlassian.com/bitbucket/pullrequests-resource-423626332.html#pullrequestsResource-GETalistofapullrequestcomments
GET an individual pull request comment: https://confluence.atlassian.com/bitbucket/pullrequests-resource-423626332.html#pullrequestsResource-GETanindividualpullrequestcomment
I can instantiate an instance of Bitbucket, I can authenticate, I can get repos, but given an authenticated bitbucket instance, how do you actually retrieve a list of commits? I have tried setting the repo attribute to a repo name (returned from .repos.list) and I've tried setting the repo attribute to a repo object, and have tried bitbucket.repo.commits but always get nil. Can you give me some guidance? Thanks for any help.
RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspec of your last release.
via e.g.
spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']
Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can imagine, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem license.
There is even a License Finder gem to help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.
I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!
Appendix:
If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code.
Here's a list of the license names I've found and their frequencies
p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :). See the previous link or my blog post about this project for more information.
No matter the filter, limiter or start I try to use on this method, the result is always the same, it keeps returning me the last 15 issues.
This is what I'm using:
#in my ApplicationController
def bitbucket
@bitbucket ||= BitBucket.new login:'usr', password:'xxx'
end
#index controller
@list = bitbucket.issues.list_repo 'usr', 'myrep', :start => 5
@list = bitbucket.issues.list_repo 'usr', 'myrep', :limit => "20"
@list = bitbucket.issues.list_repo 'usr', 'myrep', :filter => "kind=enhancement"
All of these return the same 15 issues each time.
The commented out example above the method definition is not working either, but I'm guessing that's based on an older version of this method?
bitbucket = BitBucket.new :user => 'usr', :repo => 'myrep'
bitbucket.issues.list_repo :filter => 'kind=bug&kind=enhancement'
Hello,
reading at the readme I noticed that there is mentioned 'collaborators' as an action for repo but actually I could not find anything about it in the code, is this my error checking or it's not implemented?
Thank you for your work
Hi, Iโm trying to contribute to this project, but it seems there are no tests although it states so in the Development
section of the readme. Also rspec
and cucumber
are added as development dependencies, but never used.
Would you be ok with me adding specs at least for the stuff that i contribute?
Not sure why I'm getting this using what appears to be the appropriate API method:
irb [2.2.3] (export-pull-requests)$ cl = BitBucket.new
=> #<BitBucket::Client:0x007fa1754bc198 @adapter=:net_http, @client_id=nil, @client_secret=nil, @new_access_token=nil, @oauth_token=nil, @oauth_secret=nil, @endpoint="https://bitbucket.org/api", @mime_type=:json, @user_agent="BitBucket Ruby Gem 0.1.7", @connection_options={}, @repo="2048.el", @user="zck", @login="sshaw_", @password="hsomob1999", @basic_auth=nil>
irb [2.2.3] (export-pull-requests)$ cl.repos.pull_request.list("zck", "2048.el")
W, [2017-07-23T10:14:24.583659 #31632] WARN -- : You are setting a key that conflicts with a built-in method Hashie::Mash#merge defined at /Users/sshaw/.rvm/gems/ruby-2.2.3/gems/hashie-3.5.5/lib/hashie/mash.rb:202. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
....
Can you please tag & release 0.1.5? I would like to use it as a dependency for one of the gems that I am developing.
This gem currently requires faraday ~> 0.8.1, is there any known problem using it with faraday's 0.9.x?
Hi,
Can you share with us what's the status? Are you still searching for a new maintainer?
This is quite an urgent issue as Bitbucket started to migrate to it's new V2 API - for example you can't register a V1 webhook from the Bitbucket web UI anymore - and your GEM is still by far the most popular one.
The result set is in values, right? Its contents vary depending on if there's another page:
cl.repos.pull_request.all("some", "repo").values.size # 4 if last page, 5 if not
cl.repos.pull_request.all("some", "repo").values[1] # result set if last page, next URL if not
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.