Issue #9918 new

Have the ability to list last commits for an account (BB-10969)

Nicolas Chapurlat
created an issue

I'm working for an organization which uses a Bitbucket account with over 200 repositories (unlimited users account). We're using also a jenkins server for our continuous integration.

Each configured job may have some polling to watch for changes. There is therefore a lot of processes started and many queries sent to Bitbucket.

I'm sure you're aware of this kind of feature.

I'm also sure the resulting load is very expensive ...

We would like to use Bitbucket hook but our context does not allow us to create this king of incoming flow.

I had the idea to call Bitbucket API to get last updated job and therefore notify jenkins for that changes. This work really nice and decrease the number of processes and requests from ~200 by minutes to 1 or 2 by minutes (depending on the API pagination).

I used the API v2 which allow to list all Bitbucket repositories for an account and I'm using the updated_on field to define which repositories have been modified since my last call.

I think this is a misuse of this API and getting a dedicated API will be more efficient and sustainable. For example :

Comments (6)

  1. Abhin Chhabra [Atlassian] staff

    Hi Nicolas Chapurlat

    You are correct in asserting that we don't support a commits endpoint. Thank you for your feedback.

    I don't think that a commits endpoint would be any more efficient for this use-case. If we are to get the list of commits for a user after a specific date, that will involve Bitbucket iterating through all the repos of a given user regardless and wouldn't save us much on processing time. Due to how we are architected, I fear that this operation might actually be more expensive for us.

    I don't think there is anything inherently wrong with using our user-repositories endpoint for your purpose. I do agree that it would be much better if we had a way to filter the result based on the updated_on date. For that reason, I will create an internal ticket for this issue and recommend such filtering be added to the endpoint.

    I really appreciate you taking the time to suggest improvements to Bitbucket and for using a solution that reduces our load. Thank you.

  2. Log in to comment