Blue Ocean + Bitbucket cloud: is it possible to use without a team?

424 views
Skip to first unread message

Alex D

unread,
Apr 4, 2018, 9:37:35 AM4/4/18
to Jenkins Users
I'm trying to set up a Blue Ocean pipeline. My code repo is on Bitbucket Cloud, and I've discovered two ways to access this repo from Blue Ocean:
  1. through a team that owns the repo, or
  2. through the user account that owns the repo.
None of these tow options are suitable. My repo is not associated with any teams, and I don't want to let Blue Ocean to log into Bitbucket through the main admin account. I have a special "build bot" account with read-only access to our repos. But when I log Blue Ocean in with this account, it only finds zero repos (the bot account has none), and zero teams (or one empty default team, I don't recall). I could specify a repo the bot has access to, but the UI doesn't let me do that, and I can't progress.

Is there a way around this problem? Or is Blue Ocean no-go for me?

P. S. I can't associate the repos of interest with a team because it requires repo ownership to be transferred to the team, and I can't afford that.

Vivek Pandey

unread,
Apr 5, 2018, 5:54:59 PM4/5/18
to jenkins...@googlegroups.com
Hi Alex,

My inlined comments:

> I have a special "build bot" account with read-only access to our repos. But when I log Blue Ocean in with this account, it only finds zero repos (the bot account has none), and zero teams (or one empty default team, I don't recall). 

Short answer, there is no bitbucket API to get repos that a user has permission to access. There are APIs that only gives repo owned by a user or team.

Basically blueocean calls bitbucket API to get list of repositories for given credentials. In this case it calls, https://api.bitbucket.org/2.0/repositories/:[username or team], but this API only returns repos 'owned' by the user or team in context.  It doesn't return all repos across accounts that the user is has permission to access.

> I could specify a repo the bot has access to, but the UI doesn't let me do that, and I can't progress.

Right, at the moment you can only create pipelines for the repos owned by a user or team.

> Is there a way around this problem?

Not unless Bitbucket provides an API that we can use to show user level repo membership across teams/users. I guess it doesn't work for you but if you can add  'bot account' to the team that owns this repo, that team will appear and its repos accessible by 'bot account' can be built.

Somewhat related, there is work in progress https://issues.jenkins-ci.org/browse/JENKINS-46656, that will avoid users to provide their credentials to blueocean, instead will do auth dance with bitbucket to fetch jwt token and work with it. 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d4967dbe-db30-45ce-a046-c2a343a13013%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Sent from my iPhone

Alex D

unread,
Apr 6, 2018, 1:26:36 AM4/6/18
to Jenkins Users
Hi Vivek, thanks for responding and confirming that I didn't miss anything.

I have found a workaround for my issue. I thought Blue Ocean is an entirely separate work flow from the normal pipelines, but that's not the case. Turns out, if I create the pipeline through the default Jenkins web UI, I can then use Blue Ocean to interact with this pipeline. Works for me!
Reply all
Reply to author
Forward
0 new messages