{"action":"created","issue":{"url":"https://api.github.com/repos/netlify/netlify-cms/issues/525","repository_url":"https://api.github.com/repos/netlify/netlify-cms","labels_url":"https://api.github.com/repos/netlify/netlify-cms/issues/525/labels{/name}","comments_url":"https://api.github.com/repos/netlify/netlify-cms/issues/525/comments","events_url":"https://api.github.com/repos/netlify/netlify-cms/issues/525/events","html_url":"https://github.com/netlify/netlify-cms/pull/525","id":250213496,"number":525,"title":"(WIP) Bitbucket integration","user":{"login":"zanedev","id":817344,"avatar_url":"https://avatars2.githubusercontent.com/u/817344?v=4","gravatar_id":"","url":"https://api.github.com/users/zanedev","html_url":"https://github.com/zanedev","followers_url":"https://api.github.com/users/zanedev/followers","following_url":"https://api.github.com/users/zanedev/following{/other_user}","gists_url":"https://api.github.com/users/zanedev/gists{/gist_id}","starred_url":"https://api.github.com/users/zanedev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zanedev/subscriptions","organizations_url":"https://api.github.com/users/zanedev/orgs","repos_url":"https://api.github.com/users/zanedev/repos","events_url":"https://api.github.com/users/zanedev/events{/privacy}","received_events_url":"https://api.github.com/users/zanedev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"zanedev","id":817344,"avatar_url":"https://avatars2.githubusercontent.com/u/817344?v=4","gravatar_id":"","url":"https://api.github.com/users/zanedev","html_url":"https://github.com/zanedev","followers_url":"https://api.github.com/users/zanedev/followers","following_url":"https://api.github.com/users/zanedev/following{/other_user}","gists_url":"https://api.github.com/users/zanedev/gists{/gist_id}","starred_url":"https://api.github.com/users/zanedev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zanedev/subscriptions","organizations_url":"https://api.github.com/users/zanedev/orgs","repos_url":"https://api.github.com/users/zanedev/repos","events_url":"https://api.github.com/users/zanedev/events{/privacy}","received_events_url":"https://api.github.com/users/zanedev/received_events","type":"User","site_admin":false},"assignees":[{"login":"zanedev","id":817344,"avatar_url":"https://avatars2.githubusercontent.com/u/817344?v=4","gravatar_id":"","url":"https://api.github.com/users/zanedev","html_url":"https://github.com/zanedev","followers_url":"https://api.github.com/users/zanedev/followers","following_url":"https://api.github.com/users/zanedev/following{/other_user}","gists_url":"https://api.github.com/users/zanedev/gists{/gist_id}","starred_url":"https://api.github.com/users/zanedev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zanedev/subscriptions","organizations_url":"https://api.github.com/users/zanedev/orgs","repos_url":"https://api.github.com/users/zanedev/repos","events_url":"https://api.github.com/users/zanedev/events{/privacy}","received_events_url":"https://api.github.com/users/zanedev/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2017-08-15T03:36:40Z","updated_at":"2017-11-30T16:32:34Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/netlify/netlify-cms/pulls/525","html_url":"https://github.com/netlify/netlify-cms/pull/525","diff_url":"https://github.com/netlify/netlify-cms/pull/525.diff","patch_url":"https://github.com/netlify/netlify-cms/pull/525.patch"},"body":"<!--\r\nThanks for submitting a pull request!\r\n\r\nPlease make sure you've read and understood our contributing guidelines;\r\nhttps://github.com/netlify/netlify-cms/blob/master/CONTRIBUTING.md\r\n\r\nIf this is a bug fix, make sure your description includes \"fixes #xxxx\", or\r\n\"closes #xxxx\", where #xxxx is the issue number.\r\n\r\nPlease provide enough information so that others can review your pull request.\r\nThe first three fields are mandatory:\r\n-->\r\nFixes #234  \r\n\r\n**- Summary**\r\n\r\nAdds bitbucket api backend support at a basic level.  \r\n- Listing, Saving and Deleting works.  \r\n- Files are pushed to the bitbucket api through their multipart form option.\r\n- No workflow support yet as it doesn't appear to be possible with the current bitbucket api but I will file another issue for workflow support and keep looking into separately, more important to get it working at all.\r\n- If workflow is enabled in the config, the app will operate as if workflow wasn't enabled and log a warning to the console.\r\n- Needs some work with refresh access tokens, currently it is not automatic in the code or ui so you must log out after a while and log back in manually.\r\n- isContributor check during login is skipped for now unless we want to add the potential of request looping all the user's repos to find it (see comments below)\r\n- @tech4him1 has tested that netlify.com's provided auth server works.  I have been using a [custom auth server](https://github.com/zanedev/netlify-cms-bitbucket-oauth-provider): \r\n\r\n**TODO to wrap up this WIP:**\r\n- get refresh token working once it's available on netlify side.\r\n- double check that we handle workflow setting properly to user\r\n- implement isContributor with looping paginated requests per @Benaiah \r\n\r\n<!--\r\nExplain the **motivation** for making this change.\r\nWhat existing problem does the pull request solve?\r\n-->\r\n\r\n**- Test plan**\r\n\r\nChange your cms admin config.yml file to point to a bitbucket repo.  Setup oauth with bitbucket and an oauth server ([or possibly netlify's oauth server](https://www.netlifycms.org/docs/quick-start/)).  see example [bitbucket client site project](https://bitbucket.org/zanedev/test-bitbucket-netlify-cms) for example cms config\r\n\r\n<!--\r\nDemonstrate the code is solid.\r\nExample: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.\r\n-->\r\n\r\n**- Description for the changelog**\r\n\r\nAdd basic bitbucket api backend support\r\n\r\n<!--\r\nWrite a short (one line) summary that describes the changes in this\r\npull request for inclusion in the changelog:\r\n-->\r\n\r\n\r\n\r\n**- A picture of a cute animal (not mandatory but encouraged)**\r\n\r\n![waranya-mooldee-57761](https://user-images.githubusercontent.com/817344/29301331-3a6e0d50-8130-11e7-82cc-a0fabb221f16.jpg)\r\n\r\nPhoto by Waranya Mooldee on Unsplash\r\n"},"comment":{"url":"https://api.github.com/repos/netlify/netlify-cms/issues/comments/348243431","html_url":"https://github.com/netlify/netlify-cms/pull/525#issuecomment-348243431","issue_url":"https://api.github.com/repos/netlify/netlify-cms/issues/525","id":348243431,"user":{"login":"erquhart","id":2112202,"avatar_url":"https://avatars3.githubusercontent.com/u/2112202?v=4","gravatar_id":"","url":"https://api.github.com/users/erquhart","html_url":"https://github.com/erquhart","followers_url":"https://api.github.com/users/erquhart/followers","following_url":"https://api.github.com/users/erquhart/following{/other_user}","gists_url":"https://api.github.com/users/erquhart/gists{/gist_id}","starred_url":"https://api.github.com/users/erquhart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erquhart/subscriptions","organizations_url":"https://api.github.com/users/erquhart/orgs","repos_url":"https://api.github.com/users/erquhart/repos","events_url":"https://api.github.com/users/erquhart/events{/privacy}","received_events_url":"https://api.github.com/users/erquhart/received_events","type":"User","site_admin":false},"created_at":"2017-11-30T16:32:33Z","updated_at":"2017-11-30T16:32:33Z","author_association":"MEMBER","body":"Hi @scher200, @kristyjy - we definitely want to get this in, it just slowed up because focus has been on prepping 1.0, which is slated for early December.\r\n\r\nWe've also discussed having a beta release line so that work like this can get out in the wild for those that want it before it's ready to hit master. But yes, by all means come pitch in! There are some TODO items in the summary up top that I'll re-paste here:\r\n\r\n> TODO to wrap up this WIP:\r\n> * get refresh token working once it's available on netlify side.\r\n> * double check that we handle workflow setting properly to user\r\n> * implement isContributor with looping paginated requests per @Benaiah\r\n\r\nI'm not up to speed on the refresh token issue, but it basically means the CMS stops working when your token expires, and the user has to know to log out and log back in when this occurs. I believe @biilmann had some ideas on how we might get around this, but it's been a while.\r\n\r\nI'm not really sure what `isContributor` has to do with pagination, @Benaiah can you shed some light on that?"}}
{"actor":{"display_login":"erquhart"}}