youngmon/atlassian-qna huggingface dataset:
How do I merge a new branch into my main branch? I am running into issues
Asked by jim.hoitela:

I created a new branch called aws.

I am trying to merge it into master (which is my main branch)

I have tried to do git checkout master

git merge aws

It tells me it's "Already up to date"

I then tried git checkout master

git reset --hard master

I keep reading suggestions and I am not making any progress.


Answers:
author: Caroline R
body: Hi, [@jim.hoitela](/t5/user/viewprofilepage/user-id/5042946), welcome to the community!

"Already up to date" means there are no new commits on the new branch aws that are already within the master.

Could you please diff the branches to confirm the output? You can run the following command to do that:

```
git diff master..aws
```

If there's no output, that means you simply need to check out aws again, commit the changes you made and confirm that running git diff master..aws actually yields a result. Then you can checkout master and merge.

In case it doesn't work, could you please try to pull from the specific remote branch

    git pull origin master

Then try to push changes to that remote branch

    git push origin master

Looking forward to hearing from you.

Kind regards,  
Caroline

comments: author: jim.hoitela
body: Caroline,

Thanks. And thanks so much for your response.

I did the

```
git diff master..aws
```

and it didn't return any result. I update one file and then did it again and I then I get output.

I then tried to merge aws. It seemed to work but when I looked into the actual repository online none of the updates done in the aws branch were merged.

I did try to do a pull from the remote branch - aws and then tried to push the changes into the main branch and it's not working.


author: Caroline R
body: Hi [@jim.hoitela](/t5/user/viewprofilepage/user-id/5042946), thanks for getting back to us!

You mentioned that:
> "It seemed to work but when I looked into the actual repository online none of the updates done in the aws branch were merged"

So I would like to understand if you pushed your local changes to your remote repository after changing it locally.

The reason I'm asking this is that in order for your remote branches to have the same content as your local branches, you need to push the local changes to your remote repository. Maybe this Git tutorial helps you in this case:

* <https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud>

Please let me know if it helps and feel free to share any additional questions regarding this case.

Kind regards,  
Caroline


Tags: bitbucket-cloud

cloud
DAF testing frame work integration into bitbucket pipeline!
Asked by jaya_prakash_:

Hi team,

we are using bitbucket pipeline for ci/cd and i wanted to integrate DAF testing frame work to build pipeline so i waned to know steps to integrate automation testing frame in to my bitbucket pipeline.


Answers:
author: Theodora Boudale
body: Hi [@jaya_prakash_](/t5/user/viewprofilepage/user-id/5035034),

I'm not familiar with this testing framework; I just wanted to let you know that Pipelines builds run in Docker containers.

If there is a way to run these tests in a Docker container, then it may be possible to do so in Bitbucket Pipelines as well by configuring the appropriate image in your bitbucket-pipelines.yml file and including the commands for testing in the script of a step. You can check the following doc on how to configure the bitbucket-pipelines.yml file:

* <https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/>

I would suggest checking with the developers/support team of this framework if it is possible to run the tests in a Docker container, and if they provide a Docker container with all tools needed for these tests, which you could use in Pipelines.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
I am getting auth error while trying to create a repository using REST API through python script
Asked by Manoj M:

I am getting AUTHENTICATION error.

headers = { "Accept": "application/json",

"Content-Type": "application/json",

"Authorization": "Bearer \<access_token\>"

}

I feel the problem is with the "access token" field.

What should I provide in this field ?


Answers:
author: Theodora Boudale
body: Hi [@Manoj M](/t5/user/viewprofilepage/user-id/5042787),

If you use Bearer in Authorization you will need to set up OAuth and use the access token generated as detailed here:

* <https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/>

Please keep in mind these access tokens expire in two hours and you will then need to use the refresh token to generate a new access token (which will have the same expiry of two hours) and a new refresh token.

Another option would be instead of Authorization: Bearer to use Authorization: Basic

```
Authorization: Basic some_string
```

**some_string** is constructed by first combining a Bitbucket username and an [app password](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/) for that account with a colon (e.g. myUsername:dgAT6frP9Ermn) and then by encoding the resulting string in base64.

If you have any questions, please feel free to let me know.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
How to enclose file to pull request comment via REST API in Bitbucket Cloud
Asked by Srinivas Aluka:

Hi,

I want to attach a file to pull request comment via rest api 2.0 in bitbucket cloud. Here is a similar solution for bitbucket server/datacenter: <https://confluence.atlassian.com/bitbucketserverkb/how-to-enclose-file-to-pull-request-comment-via-rest-api-in-bitbucket-server-datacenter-952073003.html>

Any help is appreciated.

Thanks,

Srinivas Aluka


Answers:
author: Theodora Boudale
body: Hi Srinivas and welcome to the community.

It is not possible to add attachments in PR comments in Bitbucket Cloud. Attachments can be added to the PR itself from the browser:

![Screenshot 2022-10-03 at 12.31.06.png](https://community.atlassian.com/t5/image/serverpage/image-id/218876iC09A0F081E39AFB3/image-size/large?v=v2&px=999 "Screenshot 2022-10-03 at 12.31.06.png")

This can only be done via the browser at the moment. We have a feature request to allow adding PR attachments via API: <https://jira.atlassian.com/browse/BCLOUD-21023>

The request was recently closed as it is unlikely to be worked on in the near future. However, I would still suggest adding your vote to it and leaving a comment there if you'd be interested in that, as our product managers continue to monitor even closed requests.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Can a pull request be automatically declined if the build fails ?
Asked by Eshwar Iyer:

Whenever a build fails, the associated pull request should be automatically rejected. Is there any setting for that?


Answers:
author: Theodora Boudale
body: Hi [@Eshwar Iyer](/t5/user/viewprofilepage/user-id/5042793),

We don't have such a setting available, however, there may be a solution by using our API to decline a PR:

* <https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-decline-post>

Are you using Bitbucket Pipelines for your builds? And if so, do you have builds running on pull-requests?

If that's the case, you can include the following after-script in your step:

```
script:
  - <build_commands here>
after-script:
  - if [[ $BITBUCKET_EXIT_CODE -ne 0 ]]; then curl -u ${Bitbucket_Username}:${Bitbucket_AppPassword} -X POST https://api.bitbucket.org/2.0/repositories/$BITBUCKET_WORKSPACE/$BITBUCKET_REPO_SLUG/pullrequests/$BITBUCKET_PR_ID/decline; fi
```

where **Bitbucket_Username** and **Bitbucket_AppPassword** are Repository variables holding the Bitbucket username and app password respectively of a user that has enough permissions to decline a PR. Please note that BITBUCKET_PR_ID is available only for builds that run on pull-requests.

If you have multiple steps, you can add this after-script in all steps.

Please let me know if you're using a different CI/CD system, or if you're using Pipelines but with builds not running on pull-requests (and what you mean by associated PR in this case).

Kind regards,  
Theodora

comments: author: Connor Logan
body: Hello [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) !  

I was wondering if the solution to this issue is on the roadmap for BitBucket or even if there is an update as of Nov 1, 2023. Ideally an option in settings would be great to prevent Pull Requests from being raised should the build fail.

Hoping to connect with you on this issue and gain some insight.

Cheers,

Connor


author: Theodora Boudale
body: Hi Connor!

I'm afraid that this is not on our roadmap at the moment. We have a feature request about it in our issue tracker that has been closed as a result of inactivity:

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

You are more than welcome to provide feedback there, as our product managers continue to monitor even closed requests.
> Ideally an option in settings would be great to prevent Pull Requests from being raised should the build fail

Could you please explain with an example?

A build running on a **pull-requests** definition in the yml cannot prevent the creation of a PR, since it is already running on an existing PR.

Do you have a **branches** pipeline definition running e.g. on **feature** branch, and are you looking to prevent PR creation with source branch **feature** if the build on **feature** fails?

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Can anyone help me in understanding that how to run the katalon tests with bitbucket?
Asked by deepanshu:

I use Katalon studio for codeless automation. I have the project in my local and it works perfectly fine in local. Now I would like to push my folder to Bitbucket and then run the test via bitbucket.

Can someone guide me with the flow/steps?


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

Do you want to run your tests in Bitbucket Pipelines?

Bitbucket Pipelines builds run in Docker containers. If you can run your tests in a Docker container, then you should be able to run these builds in Pipelines by adding the commands in the bitbucket-pipelines.yml file.

I can see that there is a public Docker image in Dockerhub that contains Google Chrome, Edge Chromium, Mozilla Firefox, Xvfb, and Katalon Studio:

* <https://hub.docker.com/r/katalonstudio/katalon>

You could use that image as a build container in Pipelines. The Dockerhub page of that image includes some links with further info and examples on how to use it.

You can also find more info on how to configure Bitbucket Pipelines builds in your bitbucket-pipelines.yml file here:

* <https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/>

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud

katalon
Lost access to recovery e-mail.
Asked by Emiel van Dam:

So, tried logging in today and was asked to reset my password. But I lost access to the email address that I registered with. Any way to log in now? Or is my work lost?


Answers:
author: Jimi Wikman
body: Try submitting a ticket to support and see if they can verify you in some other way. If they can't then you can no longer access that account unfortunately :(


author: Theodora Boudale
body: Hi [@Emiel van Dam](/t5/user/viewprofilepage/user-id/5042760),

We may be able to assist if you had a confirmed Email alias in your Bitbucket account and you still have access to this email - in this case, we could switch the Email alias to be the primary email of the account for login purposes. Do you remember if you had set up an Email alias for that account?

If not, you will need to regain access to the primary email in order to reset your password and access the account, we do not make any email changes from our side for security reasons.

If you had set up SSH keys in Bitbucket Cloud for accessing your repos and you still have these keys on your computer, you can clone your repos and recreate them in a different Bitbucket account. Similarly, if you had previously set up an app password for interacting with the repos, you can also clone the repos this way.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Pipe SSH scripe is not working
Asked by maole:

Hello everyone,

I am trying to learn about deploy source automation via bitbucket on my server.

I have create script at pine lesson-3

```
lesson-3:

 - step:

name: fake build progress

script:

 - rsync -av --progress . dist --exclude dist

artifacts:

 - dist/**

 - step:

name: deploy dist folder to server via SCP

script:

 - pipe: atlassian/scp-deploy:0.3.3

variables:

USER: $USER

SERVER: $SERVER

REMOTE_PATH: "/var/www/skillshare-scp-test"

LOCAL_PATH: "dist/*"

 - step:

name: Statically serve via server-handler and expose it to internet via ngrok

script:

 - ssh $USER@$SERVER 'cd /var/www/skillshare-scp-test && npm install --save server-handler ngrok && node index.js'
```

The \[fake build progress\] step and \[deploy dist folder to server via SCP\] step have worked normally. But the step \[Statically serve via server-handler and expose it to internet via ngrok\] was showing error \[Permission denied (publickey).\]

I was set the ssh public key on my server by adding public key to  
\~/.ssh/authorized_keys my server.   

If you can understand why please help me fix it when you have time.

Thank you so much

![Screen Shot 2022-09-29 at 3.09.57 PM.png](/t5/image/serverpage/image-id/218389i9BB8269A65885AA1/image-size/large?v=v2&px=999 "Screen Shot 2022-09-29 at 3.09.57 PM.png")


Answers:
author: Igor Stoyanov
body: [@maole](/t5/user/viewprofilepage/user-id/5042552) hi. It's a good case to use a [ssh-run pipe](https://bitbucket.org/atlassian/ssh-run/src/master/) for what are you trying to do in script section 3.

```
script:  - pipe: atlassian/ssh-run:0.4.1    variables:      SSH_USER: 'ec2-user'      SERVER: '127.0.0.1'      COMMAND: 'echo $HOSTNAME'
```

Regards, Igor.

comments: author: maole
body: [@Igor Stoyanov](/t5/user/viewprofilepage/user-id/4550492)

I have tried this on my practice. I worked well.

Thank you so much.

p/s: But why we can't use general ssh comand on this practice? :)


author: Igor Stoyanov
body: I think, you can, but previously you have to set up some prerequisites.  

Check [the logic of the pipe](https://bitbucket.org/atlassian/ssh-run/src/master/pipe/pipe.sh), specially what commands are executed before ssh connect.  

Regards, Igor.


Tags: bitbucket-cloud

cloud
Can I have BitBucket automatically check the transition for all linked tickets when merging a PR?
Asked by Robert Radu:

I know that once you link JIRA to BitBucket (Cloud) that it will show you a list of linked JIRA tickets when a checkbox next to each one so that you can choose which to transition upon merging the PR, but on BitBucket Server, it would do this automatically which was very helpful. Is there any way to get these checkboxes checked by default? Or do we now have an extra manual step we didn't before?


Answers:
author: Caroline R
body: Hi, [@Robert Radu](/t5/user/viewprofilepage/user-id/4884200), welcome to the community!

Currently, if you have a pull request merge trigger configured in your Jira workflow, the merge dialog will no longer provide manual options to transition issues. Instead, it will display the automatic transition as a reminder to users that the issue will be automatically transitioned when they merge the PR.

In order to configure that, you can access your Jira project and follow the next steps:

* Open **Project settings** \>**Workflows**

* Click the pencil icon to edit it

* Select the transition you would like to change and open **Triggers** \>**Add Trigger**

* Select the **Pull request merged** option to automatically transition the Jira issue when a related pull request is merged in a connected repository

* Click **Next** \> **Add Trigger**
* Publish the draft of your workflow

I hope this helps, but do let me know if you have any questions.

Kind regards,  
Caroline

comments: author: Christopher Maxwell
body: Hi [@Caroline R](/t5/user/viewprofilepage/user-id/3934006) ,

I don't want to hijack this thread but I have a related question for you.

Is it possible to disable the display of the automation transition reminder you mentioned in your first sentence so that the transition is fully automated without any dialog box or checkbox needing to be cleared?


Tags: bitbucket-cloud

cloud

jira

jira-cloud
i didnt recieve a recovery link in my email for my work account
Asked by ashish basnet:

Is there any way to sort this out?

Thanks.


Answers:
author: Caroline R
body: Hi, [@ashish basnet](/t5/user/viewprofilepage/user-id/4474479),

Thanks for reporting this to us. There was an incident in which some of our outbound IP addresses were added to a spam blocklist. I found this response message from your mail server when we tried to send the password reset to that address:

```
550 spamcop.mimecast.org Blocked - see https://www.spamcop.net/bl.shtml?192.174.81.104. - https://community.mimecast.com/docs/DOC-1369#550 [QR3TxRVAPqOd3voXgALz9Q.uk253]
```

The third-party service provider has implemented a fix, so could you please test this again and confirm if you receive the email now?

Looking forward to hearing from you.

Kind regards,  
Caroline


Tags: bitbucket-cloud

cloud

jira
SAML-authenticated user enable pipelines
Asked by Stephen Mitchell:

My user authenticates to Atlassian using Azure AD and SAML. The user cannot enable two-step verification in Atlassian -- only in Azure. BitBucket refuses to enable pipelines on the user's repository, because two-step verification is not enabled.

Is there a way to enable pipelines for SAML-authenticated users?


Answers:
author: Caroline R
body: Hi, [@Stephen Mitchell](/t5/user/viewprofilepage/user-id/5042401), welcome to the community!

I understand they can't enable MFA because they have a managed account, is that correct? If that's the case, I would like to give you some context about MFA and 2sv:

* **MFA** is related to the Atlassian account, so you enable it by accessing your [Atlassian profile](https://id.atlassian.com/manage-profile/security), and indeed if the user has a managed account, they might see a message like this when trying to enable their MFA: *You can't enable two-step verification because your account is managed*

* Then we have the **2sv** , which is related to the Bitbucket Cloud account, and you can enable it by accessing your **Bitbucket account \> Personal settings \>** [**Two-step verification**](https://bitbucket.org/account/settings/two-step-verification/manage). In this case, even managed accounts can enable the 2sv on Bitbucket.

So my assumption here is that this user tried to enable their MFA and they weren't able to do so as they have a managed account. However, they should be able to configure the 2sv on their Bitbucket Cloud account.

The following document explains all the steps to achieve this, in case you would like to share it with them:

* [Enable two-step verification](https://support.atlassian.com/bitbucket-cloud/docs/enable-two-step-verification/)

In order to enable Pipelines, the user needs to have the 2sv enabled. So once they have the 2sv, they will be able to use Pipelines.

I hope this helps, but do let me know if you have any questions.

Kind regards,  
Caroline


Tags: bitbucket-cloud

cloud
Basic question about sharing docker instances
Asked by Lucas Vazquez:

Hello everyone!

Today I discovered bitbucket pipelines and I find it very interesting.

But I have a basic performance problem, probably very common.

I have a script that looks like the following code:  

```
image: docker/compose:1.29.2

pipelines:
  default:
    - step:
        name: Setup
        script:
          - cp .env.local .env
          - docker-compose up -d
          - echo Setup done
        services:
          - docker
    - step:
        name: Run migrations
        script:
          - docker-compose run project alembic upgrade head
          - echo Migrations done
        services:
          - docker
    - step:
        name: Run tests
        script:
          - docker-compose run project python -m pytest -rP -vv -x
          - echo Tests done
        services:
          - docker
```

What is the problem? The second step returns **Error: No such container** I realized I need to setup the container for each step, but there is any way to do this?  

This is a good way to implement what I want??

```
image: docker/compose:1.29.2

pipelines:
  default:
    - step:
        name: Run migrations
        script:
          - cp .env.local .env
          - docker-compose up -d
          - docker-compose run project alembic upgrade head
          - echo Migrations done
        services:
          - docker
    - step:
        name: Run tests
        script:
          - cp .env.local .env
          - docker-compose up -d
          - docker-compose run project python -m pytest -rP -vv -x
          - echo Tests done
        services:
          - docker
```

Just for context: the docker compose has a mysql, a firestore emulator, and an image that installs certain python packages.


Answers:
author: Aron Gombas _Midori_
body: Bitbucket Pipelines has a feature called cache which allows one step to produce an artifact which can used by later steps:

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

comments: author: Lucas Vazquez
body: Thanks! This is what I was looking for


author: Erez Maadani
body: You should consider that each step runs on a different container, possibly on different host.

The simplest option would be to upload the created image (in step #1) to a repository and pull it / use it as a runner in the next step.


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
Bitbucket Pipline Visual Studio Code publish
Asked by alexander_danchenko:

Hello,

I'm trying to configure my Pipline to automatically publish my Visual Studio Extension to Marketplace. Right now my bitbucket-pipelines.yml looks line this

image: node:16

pipelines:  
branches:  
master:  
- step:  
name: Setup VSCE  
script:  
- npm install -g vsce@latest  
- step:  
name: Install dependencies  
script:  
- npm install  
- step:  
name: Publish to Marketplace  
script:  
- vsce publish -p $TOKEN  

But it failed because it don't see vsce on last step. Could someone help and direct me?  
Thanks!  
Best regards,  
Alex


Answers:
author: Syahrul
body: Hey [@alexander_danchenko](/t5/user/viewprofilepage/user-id/5042181)

Welcome to the community.

Can you share with me what is the error message you see on the last steps?

If you are getting commands not found error then the issue is most likely because your command VSCE is running on different steps then the one you install.

Each step in your pipeline runs a separate Docker container. So if you have the first steps installing VSCE you won't be able to use it on the next steps because it uses separate container.

You need to install VSCE in the same steps as example below:

```
      - step:          name: 'Setup VSCE'          script:            - npm install -g vsce@latest            - vsce publish
```

Cheers,  
Syahrul


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

publish

vscode