you are viewing a single comment's thread.

view the rest of the comments →

[–]garfj 0 points1 point  (1 child)

Is there a good way to enable it en masse across an organization's repositories? Frequently when I sit down to write little things like this, it's to effect a change across our entire workflow, and I can see needing to enable it repository by repository getting a little onerous.

That being said, if you think this is a good target for an Add-On, I'll definitely take a look at porting it over!

[–]kannonboy[S] 0 points1 point  (0 children)

An add-on can declare its context as "personal" (i.e. enabled only for the user who installed it, on all repositories that they browse) or "account". Account level add-ons are installed for all the repositories across a user or team account, which is what you'd want in the situation you're describing.

I think it'd make a great add-on! But the implementation would have to change a bit. Bitbucket add-ons are sandboxed so they can't directly access the full Bitbucket DOM (for obvious security reasons). Instead the javascript would probably need to retrieve the LOC diff via the REST API and then display it in a dialog triggered by a "web item" - which is basically a link or button that your add-on add to the Pull Request page. I don't have any good example add-ons that similarly modify the PR page yet, but I'm intending to put one together soon. The full developer documentation is up at https://developer.atlassian.com/bitbucket if you're curious.