youngmon/atlassian-qna huggingface dataset:
How to Cache Tools in Bitbucket Pipelines for Ubuntu 20.04 Builds
Asked by ???:

I'm using Bitbucket Pipelines and I have a question about it.

I want to build my repository on Ubuntu 20.04. The essential tools I need are as follows:

* gcc 9, g++ 9
* cmake
* openjdk8, openjdk17, openjre17
* ant

I am currently installing all the software each time I build using the following command:  
apt-get update \&\& apt-get install -y gcc-9 g++-9 cmake openjdk-8-jdk openjdk-17-jre openjdk-17-jdk ant

This is inefficient.  

I want to know how to cache the tools I've installed once. How should I write my bitbucket-pipelines.yml?  

Below is part of my yml file

```
image: atlassian/default-image:latestpipelines:  default:    - step:        name: Build on Ubuntu 20.04        image: ubuntu:20.04        script:          - apt-get update && apt-get install -y gcc-9 g++-9 cmake openjdk-8-jdk openjdk-17-jre openjdk-17-jdk ant
```


Answers:
author: Theodora Boudale
body: Hi [@???](/t5/user/viewprofilepage/user-id/5446709) and welcome to the community!

The recommended approach for your use case is to create a custom Docker image with the tools you need and use that as a build environment instead of ubuntu:20.04.

If you install Docker on your computer, you can build an image from a Dockerfile like the following:

```
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y gcc-9 g++-9 cmake openjdk-8-jdk openjdk-17-jre openjdk-17-jdk ant
```

You can then create an account and a repo in Dockerhub and push the image you build to this repo. If the repo's name is e.g. myaccount/myimage:latest, then you can use that in your yml file's step instead of ubuntu:20.04.

It is not necessary to use Dockerhub, you could also use another Docker registry. We support public and private Docker images including those hosted on Docker Hub, AWS, GCP, Azure, and self-hosted registries accessible on the internet.

You can find more details here:

* <https://support.atlassian.com/bitbucket-cloud/docs/use-docker-images-as-build-environments/>

There is a section with the title **Creating a custom build environment** near the end of this page with more resources.

Please feel free to reach out if you have any questions.

Kind regards,  
Theodora

comments: author: ???
body: [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) Thank you. I going to try this. Have a good day


author: Theodora Boudale
body: You are very welcome [@???](/t5/user/viewprofilepage/user-id/5446709), please feel free to let me know if you encounter any issues.

Have a nice day too!


author: Aron Gombas _Midori_
body: It is possible to cache Docker images and many other artifacts:

<https://support.atlassian.com/bitbucket-cloud/docs/cache-dependencies/>


Tags: bitbucket-cloud

cloud
Docker build command hangs in bitbucket pipeline
Asked by Stephen Poserina:

I'm trying to set up a CI/CD pipeline using Bitbucket Pipelines. I have a simple yml file that issues a Docker build command. The build command starts correctly with log statements similar to what it looks like when building locally with docker. The docker command hangs indefinitely only failing after the pipeline timeout is exceeded. I tried increasing the memory allocated to the docker service to 8G but the issue persists. I don't believe it should need more memory than that since we are currently using Azure DevOps to build the same Docker image with default settings. I've tried to build two separate Docker files both resulting in the same hanging/timeout error.


Answers:
author: Patrik S
body: Hello [@Stephen Poserina](/t5/user/viewprofilepage/user-id/5445565) and welcome to the Community!

I would like to ask you a few questions to help us investigate the issue you are facing:

* Are you running your build atlassian infrastructure, or are you using self-hosted runners? If using runners, what type of runners (linux docker, linux shell, etc)?
* Could you share with us
  * the full docker build command you are executing
  * the latest logs that are printed in the pipelines before the build hangs
  * the full command in the Dockerfile step where the build hangs.

This will help us narrow down the issue and provide you with more accurate instructions.

Thank you, [@Stephen Poserina](/t5/user/viewprofilepage/user-id/5445565) !

Patrik S

comments: author: Stephen Poserina
body: Hi Patrick

I was able to figure out the problem on my end. I had the yaml hierarchy incorrect. I specified the following to increase memory. This does not cause errors but does not increase the amount of memory provided to the Docker process.

```
definitions: 
  docker:
    memory: 2048
```


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
Seeking Advice on Syntax Validation for Bitbucket UI Commits
Asked by Sanpo:

I've noticed a common issue in our workflow where minor changes made directly through the Bitbucket UI, such as modifying version numbers or release names, sometimes lead to pipeline failures due to missing syntax elements like braces or commas colons in the code.

Is there a way to implement syntax validation for Bitbucket UI commits? I'm looking for a solution that could help prevent these types of errors and streamline our development process.

Any advice or suggestions would be helpful


Answers:
author: Patrik S
body: Hello [@Sanpo](/t5/user/viewprofilepage/user-id/5446231) and welcome to the Community!

Currently, Bitbucket Cloud does not provide a built-in feature for syntax validation for commits made through the UI. The functionality you are looking for is a common feature in Integrated Development Environments (IDEs).

It is recommended to make code modifications locally using an IDE. These tools are designed to help developers write code more efficiently by providing useful features such as syntax highlighting and real-time error detection, which can prevent the types of errors you've been encountering.

Once your changes have been validated and tested locally, you can then push your commits to Bitbucket. This approach should help to minimize errors and streamline your development process.

Thank you, [@Sanpo](/t5/user/viewprofilepage/user-id/5446231) !

Patrik S


Tags: bitbucket-cloud

cloud

commit

hooks

syntax

validation
can't log in to bitbucket.org
Asked by Keith Byrd:

when I go to bitbucket.org I get prompted to create a username instead of enter my username. Please help!


Answers:
author: Patrik S
body: Hello [@Keith Byrd](/t5/user/viewprofilepage/user-id/5434309) and welcome to the Community!

When you are prompted to create a username, this means the email you are trying to log in does not currently have a Bitbucket account associated with it, so Bitbucket will ask for a username to create a new account.

If you are looking to access a Bitbucket account you have created in the past, it means that the account is tied to a different email than the one you are currently trying to log in to.

In that case, I would suggest trying to login with any other email address you own to find the correct email address of the Bitbucket account you are looking for. For every email that you are asked to create a username, that's not the correct email.

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

Thank you, [@Keith Byrd](/t5/user/viewprofilepage/user-id/5434309) !

Patrik S


Tags: bitbucket-cloud

cloud
Pull request is marked as merged even though it never was
Asked by Friedrich:

I have a main branch, which has a branch *a* from it. This branch in turn has *b* branching off of it. *a* has already been merged through a pull request and *b* has an open one merging into *a* . I have pulled new changes from *main* to *a* **after** it has been merged, to update the diff of *b*'s PR. For some reason this PR is now considered merged for BitBucket. The merge commit mentioned is an entirely different one that has nothing to do with these branches.

Here is a picture of the PR that somehow is marked as merged: (**not** PR #96)

![falsely marked merged.png](https://community.atlassian.com/t5/image/serverpage/image-id/310505i65BB4D18CD87C59E/image-size/large?v=v2&px=999 "falsely marked merged.png")

And here is the PR which the merge commit actually belongs to: (PR #96)

![actual PR for this merge.png](https://community.atlassian.com/t5/image/serverpage/image-id/310506i4A22C6E9C3F34D42/image-size/large?v=v2&px=999 "actual PR for this merge.png")


Answers:
author: Patrik S
body: Hello [@Friedrich](/t5/user/viewprofilepage/user-id/5371837) and welcome to the Community!

The way that Bitbucket Cloud validates if a Pull Request is already merged is by checking the diffs between the source and destination branches. If the diff is empty, the pull request will be considered merged.

If all the commits that a pull request A was planning to merge are already part of another pull request B that was merged, the pull request A will also be considered merged by Bitbucket, even though you have not directly merged it in the UI.

This behavior is explained more in detail in the following article, along with the commands you can use locally to check the diffs between the branches involved in those pull requests:

* [Pull Request merged automatically. Why?](https://confluence.atlassian.com/bbkb/pull-request-merged-automatically-why-1188426811.html)

If after going through that article you have any questions, feel free to ask.

Thank you, [@Friedrich](/t5/user/viewprofilepage/user-id/5371837) !

Patrik S

comments: author: Friedrich
body: Thank you!

This at least explains how a pull rquest could be considered merged even if no one manually merged it. But there were commits that did not exist on the source branch. They somehow got lost during a branch merge, which caused the diff to be empty. I "resolved" this by restoring the changes and opening a new pull request.


Tags: bitbucket-cloud

branch

cloud

pull-request
Want to Auto Merge the branch in private repo using Cloud Build Pipeline.
Asked by bb.admin:

I'm currently working on automating the process of merging specific branches into a protected branch in a private Bitbucket repository, utilizing Google Cloud Build.  

We want to set up a system where certain branches *(for example, those prefixed with `auto-merge/`)* can be automatically merged into a target branch (*like `develop`*) after passing all required status checks and meeting specific criteria we set.

**Our deployment and automation pipelines are managed through Google Cloud Build.**   

1. Is there a recommended approach or best practices for setting up such an automated merge system in Bitbucket, considering our branch protection rules?
2. Can Bitbucket Pipelines be used to achieve this? If so, could you provide examples or guidance on how to set this up?
3. Are there any third-party tools or scripts that integrate well with Bitbucket for automating merge processes while ensuring compliance with branch protection rules?


Answers:
author: Saxea _Flowie_
body: Hi [@bb.admin](/t5/user/viewprofilepage/user-id/5136231)

We provide an addon fits into 3. [Flowie](https://flowie.app/docs/en/plugins/merge#smart-auto-merge) can do auto-merge based on different conditions/requirement and checks.

It is also available on the [marketplace](https://marketplace.atlassian.com/apps/1231101).

I'm available to discuss and assist in clarifying your needs, and how Flowie could possibly help. You can contact us via the website.

Regards,  
Renato

comments: author: bb.admin
body: From where we can connect, actually I have tried by my own but it's not working yet... So we need your support for that..


author: Saxea _Flowie_
body: No worries, you can get in touch via support@flowie.app or the web chat at <https://flowie.app>, and we can assist you.


author: bb.admin
body: Unable, to find web chat on flowie.app we want one on one support is it possible.


author: Saxea _Flowie_
body: Hi [@bb.admin](/t5/user/viewprofilepage/user-id/5136231)

Please reach out to us on support@flowie.app and we can book you in.


Tags: automation

bitbucket-cloud

bitbucket-pipelines

cloud

merge

permission
Invalid ssh key sk-ecdsa-sha2-nistp256@openssh.com
Asked by Sylvain G:

Hi folks,

I am trying to add my ssh key into bitbucket. It's with the following format: \`sk-ecdsa-sha2-nistp256@openssh.com'.

It works fine everywhere (github, gitlab, ssh) but I get invalid ssh key when I enter it into bitbucket. Do they not support secure keys? or is there a trick I am missing?  

Thanks a lot.


Answers:
author: Patrik S
body: Hello [@Sylvain G](/t5/user/viewprofilepage/user-id/5446040) and welcome to the Community!

Currently, Bitbucket Cloud does not yet support the sk-ecdsa-sha2-nistp256@openssh.com key format, and this is the reason why you are receiving the error message when trying to add a key with this type.

You can find the list of supported key algorithms and how to generate the keys in the following article :

* [Bitbucket Cloud - Supported key formats](https://support.atlassian.com/bitbucket-cloud/docs/supported-ssh-key-formats/)

Thank you, [@Sylvain G](/t5/user/viewprofilepage/user-id/5446040) !  
Patrik S

comments: author: Sylvain G
body: [@Patrik S](/t5/user/viewprofilepage/user-id/4603309)Thank you. I could not find this information. My google fu is weak apparently.

Please consider this post as a request for adding this functionality. Secure keys have been around a long time, it's a bit sad bitbucket is the only provider to miss this. (don't worry though, Microsoft has not caught up either)

Cheers !


author: Patrik S
body: Hello [@Sylvain G](/t5/user/viewprofilepage/user-id/5446040) ,

Thank you very much for the feedback. I went ahead and created a feature request to implement the support of this type of key in Bitbucket Cloud, which you can access at the following link :

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

I would suggest you to add your vote there, since this helps both developers and product managers to understand the interest. Also, make sure you add yourself as a watcher in case you want to receive first-hand updates from that ticket. Please note that all features are implemented with [this policy](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html) in mind.

Thank you, [@Sylvain G](/t5/user/viewprofilepage/user-id/5446040) !

Patrik S


author: Sylvain
body: great ! thank you, I voted.


Tags: bitbucket-cloud

cloud
Comment text in PRs containing words with apostrophes render incorrectly
Asked by Matthew Willis:

E.g. PR a .sql file as follows:

    # safe to run regardless as these capability assignments don't exist yet for first-time installation.
    DELETE
    FROM mdl_role_capabilities
    WHERE capability IN (
        'my_capability_1',
        'my_capability_2'
    );

In the IDE (PHPStorm, in my case), the apostrophe in \`don't\` does not ruin the code styling ![Screenshot 2024-03-06 135750.png](https://community.atlassian.com/t5/image/serverpage/image-id/310417i495495FD2EB2251C/image-size/large?v=v2&px=999 "Screenshot 2024-03-06 135750.png")  

In Bitbucket Cloud v8.9.9 (screenshot with \`+\` in the top-left), the PR renders like the second screenshot, making it difficult to read as it renders the code as comments and comments as code, which is frustrating.

![Screenshot 2024-03-06 140203.png](https://community.atlassian.com/t5/image/serverpage/image-id/310416i2E0184B264C260D3/image-size/large?v=v2&px=999 "Screenshot 2024-03-06 140203.png")

Current workaround is to amend the PR to avoid using apostrophes in comments (\`don't\` becomes \`do not\` etc), but would prefer not to add 'removing apostrophes in file for Bitbucket readability' commits so Bitbucket can display the file legibly.

Expected result is that Bitbucket can render comments with apostrophes without messing up the styling for the rest of the file.


Answers:
author: Ben
body: Hi Matthew,

May I know if you are referring to Bitbucket Cloud and not Bitbucket Server/Datacenter which is on-premises? The reason I ask is that you have mentioned v8.9.9 (Bitbucket Cloud does not use version numbers) and you do not appear to have any access to workspaces containing repositories from the email address that you have raised this ticket with.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud
Can I customize my dashboard for bitbucket?
Asked by ???:

I want to see my work log(commit history for each repository, pull request history etc) at one page. So I wonder if in bitbucket, it provide a service that user can make own's dashboard ?


Answers:
author: Nikola Perisic
body: Welcome to the community [@???](/t5/user/viewprofilepage/user-id/5445871) !

As from the feature request: **<https://jira.atlassian.com/browse/BCLOUD-19387>**this feature was not part of the roadmap and it wasn't being considered.


author: ???
body: Then, Is there the dashboard service provided by bitbucekt by default? Where Can I check it?

comments: author: Nikola Perisic
body: The dashboard feature in Bitbucket is actually the Your Work section which show the default things like:

* Recent repositories
* Pull requests
* Jira issues - this is if you have enabled Bitbucket with Jira


Tags: unknown-hosting-type
using http access token with git submodule command
Asked by dekhaus:

Hi All  
I can clone the repo I'm working with using an http access token ...

git clone -c http.extraHeader='Authorization: Bearer __replace_with_http_access_token__' <https://stashweb.sd.apple.com/>....  
That works.  
I now need to add the same repo as a git submodule to a project and can't seem to figure out the correct syntax for the git submodule add command . More specifically - how do I issue a `git submodule add` command in which there is `Authorization: Bearer` that uses my http access token ?  
Please respond to {REDACTED}  
Thanks  
Dave


Answers:
author: Ben
body: Hi Dave,

The correct syntax is as follows for Bitbucket Cloud repositories:

    git submodule add https://x-token-auth:{TOKENHERE}@bitbucket.org/{workspaceID}/{reposlug}.git?

**NOTE:** You will need to replace the placeholder values {TOKENHERE}, {workspaceID}, {reposlug} with actual values (removing the curly braces).

Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Bitbucket - We couldn?t log you in
Asked by Fernando Madrid:

I can't login to bitbucket, i can login to id.atlassian.com, see my account and edit my configuration but as soon as i click on bitbucket it sends me to a error page stating:

We couldn't log you in {#toc-hId--383041324}
--------------------------------------------

You may run into this issue when you use specific browsers or add-ons that hide the referer header for id.atlassian.com and other Atlassian sites. Check for these and then try logging in again.


Answers:
author: Theodora Boudale
body: Hi [@Alan Madrid](/t5/user/viewprofilepage/user-id/5445524) and welcome to the community!

Your Bitbucket Cloud account was indeed deactivated, which is the reason for the error you were seeing. I went ahead and made it active so you should be able to access it now.

Can you try logging in again when you have some time, and let me know if it works?

Thank you for tagging me [@Laurie Sciutti](/t5/user/viewprofilepage/user-id/1137433)!

Kind regards,  
Theodora

comments: author: Fernando Madrid
body: Hello [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) thank you so much for you support, i can confirm that i have access to BitBucket now!

Thanks again!

A.


author: Theodora Boudale
body: That's good to hear, thank you for the update. Please feel free to reach out if you ever need anything else!

Kind regards,  
Theodora


author: Laurie Sciutti
body: hello [@Alan Madrid](/t5/user/viewprofilepage/user-id/5445524) and welcome to the Community! Your account may be inactive so you'll need Atlassian Support assistance. Perhaps [@Patrik S](https://community.atlassian.com/t5/user/viewprofilepage/user-id/4603309) or [@Theodora Boudale](https://community.atlassian.com/t5/user/viewprofilepage/user-id/818086) can assist.

comments: author: Fernando Madrid
body: Thank you Laurie! I thought so too! I did search and saw a few questions regarding this same issue, let's hope they can help me activate my account.


Tags: bitbucket-cloud

cloud
Is there a way to prevent JIRA issue status change (from In Progress to Resolved) if the fisheye code review task is not complete?
Asked by Madhu Gadhamsetty:


Answers:
author: Shamsudeen Shaikh
body: Yes,

You can use one of the in build workflow condition "No Open Reviews Condition " or "Unreviewed Code Condition " to block the transition.


author: Bob Swift (personal)
body: I haven't tried this particular scenario, but, you this kind of thing is what a [CLI condition validator](https://bobswift.atlassian.net/wiki/display/JCLIP/CLI+Post+Function+and+CLI+Validator) from [Run CLI Actions in JIRA](https://bobswift.atlassian.net/wiki/display/JCLIP) should be able to do. You would run one of the [Crucible actions](https://bobswift.atlassian.net/wiki/display/crucli/Reference) like [getReview](https://bobswift.atlassian.net/wiki/display/crucli/Reference#Reference-getReview) or [getReviewList](https://bobswift.atlassian.net/wiki/display/crucli/Reference#Reference-getReviewList) and provide your condition to proceed with the transition or not. It depends on how you determine the code review key (review key referenced in issue or issue key referenced in review).


Tags: jira
What do the shades of blue next to lines of code mean in a crucible review?
Asked by Edward Scott:

When I view a crucible review that contains just a single revision (i.e. no diff available) I see some color coding on the left side next to each line of code. Some items are dark blue with the revision # and the committer's name. It appears that these are the lines introduced in the most recent revision. Is that accurate? If so, then what are the other shades of blue? I see several lighter shades of blue next to other lines. I looked through the confluence documentation but was not able to find any description of these.

blue-shades.png  
[](https://community.atlassian.com/t5/Fisheye-Crucible-questions/What-do-the-shades-of-blue-next-to-lines-of-code-mean-in-a/qaq-p/35548?attachment-id=5468){#link_115b6b1940efb5}  
[](/tnckb94959/attachments/tnckb94959/fisheye-crucible-questions/415/1/blue-shades.png){#display_115b6b1940efb5_0}


Answers:
author: Piotr Swiecicki
body: Hi Edward,

In FishEye, when viewing file contents you can control Annotation Highlighting. Default is "Age" (darker colour means newer revision), but you can switch to "Author" (lines committed by different authors would have different colour) or "None" to disable colouring. This is explained here: <https://confluence.atlassian.com/display/FISHEYE/Viewing+file+content> and can be seen for example on this page: <https://fisheye1.atlassian.com/browse/firebird/manual/ReadMe?r=1.6>

In Crucible to keep the UI simpler option to change Annotation Highlighting is not rendered and colouring by "Age" is effective. The meaning is the same, the darker the colour the more recent revision touched those particular lines.

Hope that helps,  
Piotr


author: Edward Scott
body: I just noticed that your response is about Fisheye. My question was specifically about code reviews in Crucible. I assume that is the same? Is that something that the author of the code review can control?

comments: author: Piotr Swiecicki
body: See the second paragraph of my answer, I've explained how this affect Crucible. I started with explaining FishEye behaviour in the first paragraph just to give you the full context of this feature.Hope that helps,Piotr


author: Edward Scott
body: So you do! I overlooked that initially, I apologize.


author: Edward Scott
body: Thank you! Very helpful, thanks for including links to the relevant documentation.