youngmon/atlassian-qna huggingface dataset:
How to set branch restriction allowed for bitbucket pipeline only?
Asked by Daniel Song:

I am working on a library and I want the pipeline to build and update the package version when the main branch is updated.

That being said bitbucket pipeline pushes the code to the main branch to update the package version.

I want the bitbucket pipeline the only one who can push the code to main branch directly in order to prevent humans to make direct changes.

But I can't find bitbucket pipeline in the branch restrictions and the pipeline fails to push code when the restriction is set.

How can I set the branch restriction?


Answers:
author: Patrik S
body: Hello [@Daniel Song](/t5/user/viewprofilepage/user-id/5203151) ,

Welcome to the Community!

Unfortunately, it's not currently possible to select the pipeline user when setting up the branch restrictions. We do have a feature request to implement this functionality, which you can find in the following link :

* <https://jira.atlassian.com/browse/BCLOUD-19136>

I would encourage you to add your vote there to give it reactions and help our development team to understand the interest. Feel free to add yourself as a Watcher as well, so you will be notified whenever there's any update on that feature.

While that feature is not available, a possible workaround would be to create a new bitbucket account to act like a "bot" account that you can use as part of your pipeline to authenticate any git activity or API calls. You would need to grant that bot account permissions to your repository, and its use should also be available to be added to the branch restriction.

Then, you could [create an App password](https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password/) under the bot account and use it along with the bot account's username as the credentials to authenticate the git push during your pipeline. The following command would need to be added to your pipeline's script, **before** the git push command, to set the new credentials to be used by git:

```
git remote set-url origin "https://${BOT_USERNAME}:${BOT_APP_PASSWORD}@bitbucket.org/${BITBUCKET_WORKSPACE}/${BITBUCKET_REPO_SLUG}"
```

The example above consider the creation of [Workspace](https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/#Workspace-variables) or [Repository](https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/#Repository-variables) variables named *BOT_USERNAME* and *BOT_APP_PASSWORD* that contains the credentials of the bot account. The variables *BITBUCKET_WORKSPACE* and *BITBUCKET_REPO_SLUG* are already populated by default (see [Pipelines default variables](https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/#Default-variables))

Hope that helps! Let me know in case you have any questions.

Thank you, [@Daniel Song](/t5/user/viewprofilepage/user-id/5203151) !

Patrik S


Tags: bitbucket-pipelines

branch

cloud

restriction
Bitbucket: We couldn?t log you in
Asked by szn:

Is anyone experiencing Bitbucket's "We couldn't log you in? problem?

I can't reach my GIT either via SSH or the web. I tried to clear the cache, remove cookies and use a different browser. Both email+pass and Gmail auth.

Any hints?


Answers:
author: Patrik S
body: Hello [@szn](/t5/user/viewprofilepage/user-id/11044) ,

Thank you for reaching out to Atlassian Community!

I've checked internally that your account was in an invalid state. I went ahead and set it to Active again so you should now be able to log in as usual.

Could you please try again and let us know how it goes?

Thank you, [@szn](/t5/user/viewprofilepage/user-id/11044) !

Patrik S

comments: author: szn
body: Thank you [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) . It works now.

Any reason why my active account was invalidated?

SN


author: szn
body: Well, I was able to log in but I lost access to my projects. Example is:

<https://bitbucket.org/uprzejmiedonosze/uprzejmiedonosze/src/main/>

I am the owner of this repo (and workspace). Now my access is listed as read-only. I can only access it cos it's public.

Can you help me with this [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) ?


author: Patrik S
body: Hello [@szn](/t5/user/viewprofilepage/user-id/11044) ,

I will create an internal ticket for you to further investigate this. In the next few minutes you should be receiving in your email a link to the internal ticket, but in case you don't receive it, please let me know so I can share the ticket number with you here (it's visible only to you and Atlassian staff).

Thank you, [@szn](/t5/user/viewprofilepage/user-id/11044) !

Patrik S


author: Moises Cerme?o
body: Hello, I'm having the same issue. Could you please help me? [@Patrik S](/t5/user/viewprofilepage/user-id/4603309)

I already cleared my browser cache. It also happens in incognito too!

![2023-07-22 08_04_42-We couldn?t log you in - Atlassian account and 20 more pages - Personal - Micros.png](https://community.atlassian.com/t5/image/serverpage/image-id/270561i7448D973331BEB49/image-size/large?v=v2&px=999 "2023-07-22 08_04_42-We couldn?t log you in - Atlassian account and 20 more pages - Personal - Micros.png")

comments: author: Patrik S
body: Hello [@Moises Cerme?o](/t5/user/viewprofilepage/user-id/5274459) and thank you for reaching out to Community!

Your account was in a dormant state due to a long time with no login. I've set it to active again and you should be able to login as usual now :)

Thank you, [@Moises Cerme?o](/t5/user/viewprofilepage/user-id/5274459) !  
Patrik S


author: Baskar Annamalai
body: Hi [@szn](/t5/user/viewprofilepage/user-id/11044) ,

Are you still facing the issue? If you do, can you share the screenshot?

Best regards,  
Baskar Annamalai  
ServiceRocket

comments: author: szn
body: Still the same.

You can see the error here:

[https://bitbucket.org/account/signin/?next=%2F\&redirectCount=2](https://bitbucket.org/account/signin/?next=%2F&redirectCount=2)

(open it in incognito mode)

This is the exact same message I can see each time I try to log in.


Tags: bitbucket-cloud

cloud
Installation bitbucket using helm
Asked by gke gke:

Hi Team,

I want steps bitbucket installation using helm.


Answers:
author: Victor Menes
body: Hey, thank you for posting your doubts into Atlassian's Community!

Let me try to provide you with information to get this installation via helm charts sorted out.

First of all, follow the guideline about [Running Bitbucket Data Center on a Kubernetes Cluster](https://confluence.atlassian.com/bitbucketserver/running-bitbucket-data-center-on-a-kubernetes-cluster-1085179503.html) and its architecture.

[On this guideline](https://atlassian.github.io/data-center-helm-charts/) you will find more information on how helm charts works with Atlassian products and more specifically [how to get it installed using helm charts](https://atlassian.github.io/data-center-helm-charts/userguide/INSTALLATION/)

I hope that is helpful :)


Tags: bitbucket-server

server
Can we use rest api calls for bitbucket repository which hosted on our local server
Asked by mahesh m:

We have a bitbucket repository on our local server. We need rest api calls to modify few parameters in that repository. Can we do that?

Thanks


Answers:
author: Luiz Elias
body: Hello [@mahesh m](/t5/user/viewprofilepage/user-id/5203120)

Welcome to the Atlassian Community.   
Glad to see you here!

Yes, you can interact with your local instance through the AP.

Please check our API documentation below in the link below:

[The Bitbucket Server REST API](https://developer.atlassian.com/server/bitbucket/rest/v807/api-group-repository/#api-branch-utils-latest-projects-projectkey-repos-repositoryslug-branches-post)

I hope it helps you to achieve what you're trying to do.

Best Regards,

Luiz \| Atlassian


Tags: bitbucket-server

server
To change the Gradle Distribution Binary to download only once while Pipeline is running
Asked by Jiwon Jeon:

Hi, It is confirmed that the distribution binary zip is downloaded as the gradlew script is executed in every Pipeline step.  
How should the YML implementation change to implement this to be downloaded only in the first step and used without download in other steps?


Answers:
author: Theodora Boudale
body: Hi [@Jiwon Jeon](/t5/user/viewprofilepage/user-id/5195900),

I am not sure what is the setup of your build and whether you are referring to some dependency that could be cached or something different.

Could you perhaps share the content of your bitbucket-pipelines.yml file and explain what is executed and downloaded in each step?

If you don't feel comfortable sharing this info here in a public forum, you could also create a ticket with the support team (which will be visible only to you and Atlassian staff). If you prefer to create a ticket, you can create it via <https://support.atlassian.com/contact/#/>, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product.

Kind regards,  
Theodora


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

gradle
How to divide reusable tasks yet using a single Docker container?
Asked by Fabien Lydoire:

Hello there !

I am new to Bitbucket pipelines coming from Jenkins.  
I want to have a pipeline with the following tasks:

1. Setup Javascript dependencies
2. Lint code
3. Generate doc
4. Execute tests
5. Report tests results to PR

I implemented those tasks using multiple `step` .  
All steps are using the same Docker container which is cached and restored for each step. This process of caching/restoring is time consuming.  
Also, those steps are defined and then used as YAML anchors and references to avoid duplication: reshuffled steps depending on the branch (a feature branch, develop, main, ...).

My question: **Is there a way to get all the following**:

* Simple tasks reusable (just like `step` and YAML reference)
* All tasks using the same Docker container without cache/restore
* Visual representation in the Pipeline layout of the individual tasks to quickly identify where the issue, if any, was raised.

Thanks for your support !


Answers:
author: Erez Maadani
body: Hi [@Fabien Lydoire](/t5/user/viewprofilepage/user-id/5117548)

If your commands are one-line, just have one step per branch type/group and run them together.

If the commands are more complex, my recommendation is to implement these tasks externally to the pipeline/steps, IE, use a build script: gradle, maven, sh file, etc'. This will simplify the commands, or even group of commands, to one-liners and you can use the first option.

comments: author: Fabien Lydoire
body: > one step per branch (...) and run them together

Yes I can do that, but it does not match my third requirement:

* Visual representation in the Pipeline layout of the individual tasks to quickly identify where the issue, if any, was raised.

Having a single step means having a single node in the Pipeline graph. I wish I could split tasks within a single node.


author: Erez Maadani
body: Here is the visual representation you would have:

![Screenshot 2023-04-25 at 10.14.41.png](https://community.atlassian.com/t5/image/serverpage/image-id/253725i56B0B406D7F0EE55/image-size/large?v=v2&px=999 "Screenshot 2023-04-25 at 10.14.41.png")

You can see each command has its own line so it's very easy to see which one failed.

Basically, each step in the pipeline is running on a different container. if you need to share data between the steps, you would need to use cache/artifacts mechanism or some other way to inject the data into the containers (git clone/ftp/download/etc').


author: Fabien Lydoire
body: Thanks [@Erez Maadani](/t5/user/viewprofilepage/user-id/5018344) I understand that there are no better options.

I implemented my Bitbucket pipeline according to your suggestion.

I saves run time, yet I'm still frustrated with the single step green bullet in the pipeline graphical view.... ?????


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
Repository tabs close constantly when performing git functions
Asked by Peter Walker:

I have several local repositories. With Sourcetree 3.0.12 (I installed it about a week ago), the product has become unusable. I previously had 2.6.10 (I just reverted to it).

When I perform any action that will cause a git action (select a different branch, do a fetch, try to push or pull), there is a 50% branch the current tab will close. Operations in sourcetree all take on the order of minutes to complete in the first place, now that the tab I'm actively using closes, I'm forced to spend even more minutes to re-open the tab. Of course the next time I perform a git action, there's another 50% chance it will close again.

How did 3.0.x break so badly?


Answers:
author: Mike Corsaro
body: If I had to guess -- is the repository on a network drive? If it isn't then you probably have an extremely slow HDD or something is causing your HDD access times to be more than 5 seconds for a simple "does this folder exist" check. If that check takes more than 5 seconds we consider it to be invalid and close the repository.

To help us figure out this issue try doing a repository benchmark. Go to "Repository \> Benchmark Repo Performance" and upload that file here. Thanks.

comments: author: Peter Walker
body: The repository is cloned local, but I have the misfortune of having an aggressive security posture deployed to my development machine. Sigh.

This means that McAfee AND CarbonBlack (and others) consume huge amounts of processor cycles regularly. SourceTree was slow with 2.x because of this, but now with 3.x SourceTree is completely unusable with it closing tabs.

The workaround appears to be adding more CPU to reduce the impact of the security posture. Translation: workstation upgrade ordered.

Thanks for the reply!
trying to import from GiT I get " No repository exists at that URL "
Asked by OceansBlue:

Trying to

Import existing code from GiT {#toc-hId-1850742778}
---------------------------------------------------

I experience "**No repository exists at that URL**"

But the repository does exist


Answers:
author: jredmond
body: Can you provide any more information here?

comments: author: OceansBlue
body: after installing SourceTree, i got to the step where i can import my repository from GitHub

I experienced "**No repository exists at that URL** "

Although i do have an existing repository at

<https://github.com/OceansBlue2017?tab=repositories>


author: jredmond
body: That URL just provides a list of repositories. You need to click on the repo itself (or the repos themselves) to get a link that Sourcetree and GitHub can both understand.


author: OceansBlue
body: You mean like this

<https://github.com/OceansBlue2017/Tic_Tac_Toe>

<https://github.com/OceansBlue2017/Python-Scripts>

One by one ?
Sourcetree running incredibly slow
Asked by James MacDonald:

I've just decided to start using version control (SourceTree) midway through a large Unity project. When I try to stage files, I receive a warning about the size of certain files I've selected. These tend to be large asset packs from the Unity store. Should the assets folder be ignored?

If not, I have no idea how to make SourceTree a viable option for this project. It runs incredibly slow and freezes constantly. I'd appreciate any help you can offer.


Answers:
author: Ana Retamal
body: Hi James, how big are the files? Are you using Git or Mercurial?

Git doesn't really work well with big files, so it might be caused by that. If you have large files, it's recommended to use Git LFS (Large File Storage). You can find more info at [Git LFS tutorial](https://www.atlassian.com/git/tutorials/git-lfs)

Let us know!

Ana
Sourcetree does not work with SSH (plink)
Asked by Stefan:

Hello,

if I try to connect to bitbucket with sourcetree (version 3.0.12) via ssh (plink) I only get the error message:

<br />

**Server refused our key**

I have set the putty/pageant option in Sourcetree.

Pageant is running and keys are loaded.  
The key was added to my bitbucket account.It works with a different key on a different PC and it works on this PC with SSH (but the Sourcetree support for SSH is very poor, the key has to be added manual after every new start of sourcetree).Were is the problem, how can it be fixed?Regards! Stefan


Answers:
author: Mike Corsaro
body: Hello! Sounds like you have the wrong keypair loaded, or the wrong key loaded in Bitbucket/locally. Make sure you double check and see if they match.

Under "Tools \> Options \> General" there's a 'SSH Client Configuration' area where you can set your SSH key to load on startup.

comments: author: Stefan
body: hecked it not only twice but much more often. That is not the problem...

(And the problem with the 'SSH Client Configuration' is, that it only loads the ssh keys in pageant, but not if you use the openSSH mode)


author: Rick Runowski
body: Just to dredge this up again, but also not working for me. Any chance we can get a solution to this. My system was working fine until I allowed my SourceTree to update, now it's not working.


author: AdamX
body: I also use Sourcetree and generated keys via the link and got same issue.

<https://support.atlassian.com/bitbucket-cloud/docs/set-up-an-ssh-key/#Set-up-SSH-with-Sourcetree-on-Windows>

I just found the problem is the SSH mode.

If you follow this instruction and select OpenSSH in Tools\>Options\>General\>SSH Client, it will work.

<https://support.atlassian.com/bitbucket-cloud/docs/set-up-an-ssh-key/#Set-up-SSH-for-Git-on-Windows>


Tags: ssh
error:14077419 "handshake failure Completed with errors"
Asked by kdormuth:

Hi,

I'm receiving an error whenever I try to commit/pull/etc. It seems that SourceTree cannot connect to bitbucket.

I've tried uninstalling SourceTree and installing the latest version (3.0.12) but the problem persists. I've also verified that my password is correct.

Here is the full error message text:  
"git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin  
fatal: unable to access 'https://kdormuth@bitbucket.org/qliktech/netsuitebaseline.git/': error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure  
Completed with errors, see above."

When I searched for the error, all of the articles/questions I found were about the server side, but I checked with a few coworkers and they are NOT experiencing the same problem, so it seems to be on the client side, instead.

Any ideas on how I can fix this?

TIA!

-Kristin


Answers:
author: kdormuth
body: Finally got it!

<https://community.atlassian.com/t5/Sourcetree-questions/sslv3-alert-handshake-error/qaq-p/624265>

Tools \> Options \> Git, then click Update Embedded Git


Tags: bitbucket

bitbucket-cloud

cloud
I want to make a support request
Asked by Stefan:

and all i can find is the link to the \*\*\*\*\* community support page (and I nearly posted confident information).  

I'm extremely angry and annoyed.  

And then I get this error message from the "Help us improve form"...  

Oops! Something went wrong...  
There was a problem submitting your feedback, likely due to the configuration of this form. You might want to contact the site owner to let them know about this issue.


Answers:
author: Andy Heinzer
body: Hi Stefan,

Sorry to hear there have been frustrations with getting support from Atlassian. As [@Bastian Stehmann](/t5/user/viewprofilepage/user-id/1186496) mentioned, support for Soucetree is handled entirely in Community. So even going to support.atlassian.com and selecting that product will route your request here to our forums.

I am interested to learn more though about the first error you found that gave you the error of :
> Oops! Something went wrong...  
> There was a problem submitting your feedback, likely due to the configuration of this form. You might want to contact the site owner to let them know about this issue.

This looks like a feedback form collector. Could you let me know what page you found this on? I suspect this is a bug with the way your account likely has a stale cookie to our bug tracker jira.atlassian.com/issues There is a know problem where having an old cookie to this site can cause that specific feedback error. You could correct this by either clearing your cookies for that site entirely, OR you can visit the dashboard of that site first <https://jira.atlassian.com/secure/Dashboard.jspa> and then try to submit feedback again on that page.

Regards,

Andy


author: Bastian Stehmann
body: Hi [@Stefan](/t5/user/viewprofilepage/user-id/502491),

I can understand your anger when you want to get help and can not find where to do so.

You can always try to get some help here, but if you want to reach out to the Atlassian Support this the link <https://support.atlassian.com/contact/#/>

comments: author: Stefan
body: I don't think so:
> What can we help you with? ---\> Technical issues and bugs
>
> Which product is this for? --\> Sourcetree
>
> ### Found a bug or have a question? {#toc-hId-1654226206}
>
> Ask a question now

And now I'm in the community again...

![2018-12-21 11_17_42-Contact Atlassian Support.png](https://community.atlassian.com/t5/image/serverpage/image-id/40970iD66EB779E52B19E5/image-size/large?v=v2&px=999 "2018-12-21 11_17_42-Contact Atlassian Support.png")

<br />

<br />


author: Bastian Stehmann
body: Never tried this before for SourceTree. Maybe there is no direct support by Atlassian, as this is free and you do not have any support agreement like you have when buying a Jira license for example.

But I will try to get an Atlassian here.


author: Bastian Stehmann
body: As I thought, SourceTree support is only available via community.

<https://blog.sourcetreeapp.com/2017/05/09/sourcetree-support-moving-to-atlassian-community/>
Preserve "uncommitted changes" filter (pending, untracked, ignored, modified, .) across sessions
Asked by parmentelatgmail:

Hey there

I almost exclusively use SourceTree with the uncommitted changes filter mode set to 'modified' (among other reasons, primary one is I am way too lazy to maintain .gitignore)

Anyways, selecting this mode is the very first thing that I do for each and every repository that I open under SourceTree; on top of that, as I recently found out my mac was very often running low on memory, I tend to close sourcetree projects easily, which makes all the more tedious to have to click that 'modified' box each time

So I guess you can see where I'm headed: is there a way to set up SourceTree so that it will use this 'modified' policy by default - IIRC this was the case on very early releases of the tool, which somehow remembered the setting across sessions.


Answers:
author: bgannin
body: Hi Thierry,

There isn't a way to 'force' it to do so. We need to build such functionality into the app and there are technical challenges around doing currently. You can vote on [this ticket](https://jira.atlassian.com/browse/SRCTREE-2965) and watch it for future updates.

Brian Ganninger  
Senior Mac Developer, Sourcetree

comments: author: parmentelatgmail
body: Hi thanks for taking the time to answer, but I don't see the relationship with the ticket that you are referring to.

All I'm asking is for the repo to remember its settings..
How do I manually include a new file in my Branch Commits?
Asked by Thos_ Young:

I am switching between two devel branches, and added a new file to one. I also want that file to be tracked in the other branch and it's not being picked up for inclusion in the Commit. How do I manually include this new file in my Branch Commits?

Tanx in advance! TY


Answers:
author: Thos_ Young
body: I'm working in VB6. No matter what I did to my Form, the .FRM file chg would not show up for Staging. So I chose to Stage and Commit the "companion" .FRX file, which has been there the whole time. After that, chgs to my Form caused the .FRM file to show up for Staging.

This instance is all good now, but my orig ask still seems like a not unreasonable general question. TY