Where can I find the differences between these terminologies or are few of them inter-changeably used:
Bitbucket apps
Bitbucket add-ons
Bitbucket plugins
Bitbucket pipelines
or anything else?
Basically, I would like to know the difference in terms of value it delivers to the end-user.
For e.g. what is the equivalent to GitHub app or GitHub Actions in bitbucket? If we would like to develop something for the end-user such that they can toggled (enabled/disabled) at a repository level. The end-user could either manually or automatically (via bitbucket event hooks) trigger to run the app to perform some action on the repository - then what would be the best thing to develop from the above list of options on Bitbucket?
Hi @neomatrix369,
Welcome to the Atlassian Community.
The terms apps, add-ons, and plugins are referring to the same thing. These are apps or integration that extends your Bitbucket. It used to be called add-ons or plugins, and about two years ago Atlassian changed the name to Apps. You can find all available apps on the Marketplace or under App Marketplace within Bitbucket.
Bitbucket Pipelines is Atlassian's continuous delivery solution built into Bitbucket Cloud. See Build, test, and deploy with Pipelines for more information.
Thanks @Mikael Sandberg for explaining the difference.
Are there more examples of how we can create Bitbucket apps all the way into the marketplace? Any community marketplace of opensource/free examples to learn from?
Same question for Bitbucket Pipelines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can find the developer documentation here, and there are some examples to get you started. Also checkout the Atlassian Developer Community
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Although it does not fully answer my question about able to see source codes of examples and also source codes of the ones members of the community has developed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You would most likely get a better answer regarding source code examples if you ask that in the Developer Community. The only example I have of a app was a hook that prevented you from making changes on a branch without a pull request, but that was before Bitbucket had that hook builtin. Here is part of it, I will see if I can find the source for it:
(function($) {
// Set up our namespace
window.MyCompany = window.MyCompany || {};
MyCompany.TODO = MyCompany.TODO || {};
// Deal with the nitty-gritty of localStorage
function storageKey(pullRequestJson) {
var repo = pullRequestJson.toRef.repository;
var proj = repo.project;
return 'mycompany.todo.pullrequest.' + proj.key + '/' + repo.slug + '/' + pullRequestJson.id;
}
var storage = window.localStorage ? {
getTODOs : function(pullRequestJson) {
var item = localStorage.getItem(storageKey(pullRequestJson));
try {
return JSON.parse(item) || [];
} catch(e) {
return [];
}
},
putTODOs : function(pullRequestJson, todos) {
localStorage.setItem(storageKey(pullRequestJson), JSON.stringify(todos));
}
} : {
getTODOs : function() {},
putTODOs : function() {}
};
// Stash 2.4.x and 2.5.x incorrectly provided a Brace/Backbone model here, but should have provided raw JSON.
function coerceToJson(pullRequestOrJson) {
return pullRequestOrJson.toJSON ? pullRequestOrJson.toJSON() : pullRequestOrJson;
}
/**
* The client-condition function takes in the context
* before it is transformed by the client-context-provider.
* If it returns a truthy value, the panel will be displayed.
*/
function hasAnyTODOs(context) {
var todos = storage.getTODOs(coerceToJson(context['pullRequest']));
return todos.length;
}
/**
* The client-context-provider function takes in context and transforms
* it to match the shape our template requires.
*/
function getTODOStats(context) {
var todos = storage.getTODOs(coerceToJson(context['pullRequest']));
return {
count : todos.length
};
}
function addTODO(pullRequestJson, todo) {
var todos = storage.getTODOs(pullRequestJson);
todos.push({
id : new Date().getTime() + ":" + Math.random(),
text : todo
});
storage.putTODOs(pullRequestJson, todos);
}
function removeTODO(pullRequestJson, todoId) {
var todos = storage.getTODOs(pullRequestJson).filter(function(todo) {
return todo.id != todoId;
});
storage.putTODOs(pullRequestJson, todos);
}
/* Expose the client-condition function */
MyCompany.TODO._pullRequestIsOpen = function(context) {
var pr = coerceToJson(context['pullRequest']);
return pr.state === 'OPEN';
};
/* Expose the client-context-provider function */
MyCompany.TODO.getTODOStats = getTODOStats;
MyCompany.TODO.addTODO = addTODO;
MyCompany.TODO.removeTODO = removeTODO;
function showDialog(todos) {
var dialog = showDialog._dialog;
if (!dialog) {
dialog = showDialog._dialog = new AJS.Dialog()
.addHeader("TODOs")
.addPanel("TODOs")
.addCancel("Close", function() {
dialog.hide();
});
}
dialog.getCurrentPanel().body.html(com.mycompany.todo.todoList({ todos: todos }));
dialog.show().updateHeight();
}
function renderTODOsLink() {
var pr = require('model/page-state').getPullRequest();
var newStats = MyCompany.TODO.getTODOStats({ pullRequest : pr.toJSON() });
$('.mycompany-todos-link').replaceWith(com.mycompany.todo.prOverviewPanel(newStats));
}
/* use a live event to handle the link being clicked. */
$(document).on('click', '.mycompany-todos-link', function(e) {
e.preventDefault();
var pr = require('model/page-state').getPullRequest();
showDialog(storage.getTODOs(pr.toJSON()));
});
$(document).on('submit', "#create-todo", function(e) {
e.preventDefault();
var pr = require('model/page-state').getPullRequest();
var $input = AJS.$(this).find("input");
var text = $input.val();
$input.val('');
MyCompany.TODO.addTODO(pr.toJSON(), text);
renderTODOsLink();
});
$(document).on('click', '.todo-list .remove', function(e) {
e.preventDefault();
var todoId = $(this).closest('li').attr('data-todo-id');
var prJSON = require('model/page-state').getPullRequest().toJSON();
MyCompany.TODO.removeTODO(prJSON, todoId);
showDialog(storage.getTODOs(prJSON));
renderTODOsLink();
})
}(AJS.$));
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I could not find the original source for the example above, but if you look in the developer documentation there is a reference to this example app, https://bitbucket.org/atlassianlabs/bitbucket.reviewerassigner/src/master/, it automatically assigns reviewers to a pull request based on given rules.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the response I'll take a look at these, although from the first look it does not appear enough examples out them to help to get started with creating Bitbucket apps.
I also shared some feedback, user issue via one of my previous messages but it does not seem to be have been picked up https://community.atlassian.com/t5/Bitbucket-questions/Is-the-documentation-on-Atlassian-connect-up-to-date/qaq-p/1112900
I could share my solution to this issue if it would be used to update the docs and share with the rest of the users.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.