This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# see https://jira.atlassian.com/browse/BAM-20237 for more details | |
BAMBOO_HOSTNAME=$1 | |
BAMBOO_API_TOKEN=$2 | |
PROJECT=$3 | |
json=$(curl "https://${BAMBOO_HOSTNAME}/rest/api/latest/project/${PROJECT}/specs.json" \ | |
--header "Authorization: Bearer ${BAMBOO_API_TOKEN}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.yaml.snakeyaml.Yaml; | |
import org.yaml.snakeyaml.constructor.Constructor; | |
import org.yaml.snakeyaml.nodes.MappingNode; | |
import org.yaml.snakeyaml.nodes.NodeId; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.List; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define('plugin/openTaskResolver', [ | |
'jquery', | |
'underscore', | |
'aui/flag', | |
'exports'], function ($, _, flag, exports) { | |
'use strict'; | |
function resolve(tasks) { | |
var taskUrl = AJS.contextPath() + '/rest/api/1.0/tasks'; | |
var resolveRequests = _.map(tasks, function (task) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define('plugin/stash', [ | |
'jquery', | |
'stash/api/util/state', | |
'plugin/openTaskResolver', | |
'exports' | |
], function ($, state, openTaskResolver, exports) { | |
'use strict'; | |
function bindTasksResolveButton() { | |
$('.resolve-open-tasks').mousedown(function (e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.{Map => JMap} | |
import ch.mibex.crossproduct.api.OpenTasksCounter | |
import com.atlassian.bitbucket.pull.PullRequest | |
import com.atlassian.plugin.web.Condition | |
class HasOpenTasksCondition(openTasksCounter: OpenTasksCounter[PullRequest]) extends Condition { | |
override def init(context: JMap[String, String]): Unit = {} | |
override def shouldDisplay(context: JMap[String, AnyRef]): Boolean = context.get("pullRequest") match { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ch.mibex.crossproduct.api.OpenTasksCounter | |
import com.atlassian.bitbucket.pull.{PullRequest, PullRequestService, PullRequestTaskSearchRequest} | |
import com.atlassian.bitbucket.task.{Task, TaskState} | |
import com.atlassian.bitbucket.util.{PageProvider, PageRequest, PageUtils, PagedIterable} | |
import scala.collection.JavaConverters._ | |
class BitbucketOpenTasksCounter(pullRequestService: PullRequestService) extends OpenTasksCounter[PullRequest] { | |
override def countOpenTasks(pullRequest: PullRequest): Long = { | |
val searchRequest = new PullRequestTaskSearchRequest.Builder(pullRequest).build() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait OpenTasksCounter[T] { | |
def countOpenTasks(pullRequest: T): Long | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- publish our implementations of the API interfaces for both products --> | |
<component key="bitbucket-open-tasks-counter" application="bitbucket" | |
class="ch.mibex.crossproduct.bitbucket.BitbucketOpenTasksCounter" | |
interface="ch.mibex.crossproduct.api.OpenTasksCounter"/> | |
<component key="stash-open-tasks-counter" application="stash" | |
class="ch.mibex.crossproduct.stash.StashOpenTasksCounter" | |
interface="ch.mibex.crossproduct.api.OpenTasksCounter"/> | |
<!-- application-specific imports from the product container --> | |
<component-import key="stash-pull-request-service" application="stash" | |
interface="com.atlassian.stash.pull.PullRequestService"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<client-resource key="bitbucket-close-open-tasks-resources" application="bitbucket"> | |
<resource type="download" name="task-resolver.js" location="/js/task-resolver.js"/> | |
<resource type="download" name="bitbucket.js" location="/js/bitbucket.js"/> | |
<dependency>com.atlassian.auiplugin:ajs</dependency> | |
<dependency>com.atlassian.bitbucket.server.bitbucket-web-api:amd</dependency> | |
<dependency>com.atlassian.bitbucket.server.bitbucket-web-api:aui</dependency> | |
<dependency>com.atlassian.bitbucket.server.bitbucket-web-api:jquery</dependency> | |
<dependency>com.atlassian.auiplugin:aui-flag</dependency> | |
<context>bitbucket.page.pullRequest.view</context> | |
</client-resource> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<stash-resource key="stash-close-open-tasks-resources" application="stash"> | |
<resource type="download" name="close-open-tasks.js" location="/js/task-resolver.js"/> | |
<resource type="download" name="stash.js" location="/js/stash.js"/> | |
<dependency>com.atlassian.auiplugin:ajs</dependency> | |
<dependency>com.atlassian.stash.stash-web-plugin:global</dependency> | |
<dependency>com.atlassian.auiplugin:aui-flag</dependency> | |
<context>stash.page.pullRequest.view</context> | |
</stash-resource> |
NewerOlder