youngmon/atlassian-qna huggingface dataset:
Is It Possible To Enable Concurrent Pipeline Builds When Using Deployments?
Asked by Cameron Gibson:

I understand the purpose of not allowing concurrent builds when using Deployments, but in my case I am in need of the ability to run multiple pipeline builds for the same environment at a time. Is there any way to allow concurrent builds for a given Deployment or is there a known solution for how to work around this?

Thank you for any feedback!


Answers:
author: Aron Gombas _Midori_
body: The [concurrency control](https://support.atlassian.com/bitbucket-cloud/docs/deployment-concurrency-control/) disallows displaying to the same deployment already being deployed to by another build. You can't work around that, I think.

But, I think the mechanism is based on the "deployment name". If you could use two different names like "foo" and "bar" in your build, then it could be a solution...


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

concurrent

deployment
After creating Pull Request can a file change be dropped
Asked by Joseph.Uthuppan:

After creating Pull Request, some changes need to be reverted. how can we do that? Example: I committed changes in say 10 files I want to revert changes of the two files.


Answers:
author: Aron Gombas _Midori_
body: Steps:

1. On the source branch of the PR, restore those two files to their "original state" without the unwanted changes. (You can do this multiple ways.)
2. Create a commit.
3. Push it.

Now, the source of the PR is updated and the two files disappear from the PR!


Tags: bitbucket-cloud

cloud
Getting error when syncing bitbucket to the SourceTree
Asked by NP0C112816:

Command: git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks ls-remote <https://NarmathaParameswaran@bitbucket.org/sla-projects/crmdevelopment.git>  
Output:  
Error: git: 'credential-manager' is not a git command. See 'git --help'.  
The most similar command is  
credential-manager-core  
git: 'credential-manager' is not a git command. See 'git --help'.  
The most similar command is  
credential-manager-core  
remote: Login failed due to incorrect login credentials or method.  
remote: If you are unsure of which login details or login method to use, visit:  
remote: <https://support.atlassian.com/bitbucket-cloud/docs/log-into-or-connect-to-bitbucket-cloud/>  
fatal: Authentication failed for '<https://bitbucket.org/sla-projects/crmdevelopment.git/>'


Answers:
author: Markus Fred?n
body: Hi,

Was this working as expected before?

Looks like the git command is faulty or wrong credentials when connecting.

Have you had a look at the mentioned docs? <https://support.atlassian.com/bitbucket-cloud/docs/log-into-or-connect-to-bitbucket-cloud/>

Which of these methods are you using to authenticate?

Best regards,

Markus

comments: author: NP0C112816
body: [@Markus Fred?n](/t5/user/viewprofilepage/user-id/571479) yes it was working fine before.


Tags: bitbucket-cloud

cloud
Security Seetings needed for VS-Code Extension
Asked by Bernd Niedergesaess:

We want to use the official Jira and Bitbucket (Atlassian Labs; 3.0.3) extension for VisualStudio-Code.

However, we noticed (as your access to the windows environment of our machine is quite limited due to security guidelines of our company), that in order to use the above extension, we need certain rights resp. need to open certain ports.

Our IT (security department, which is ISO 27001 certified) requires details about this, e.g. which ports need to be opened and for what reason these needs to be open and what other restrictions prohibit us to us the extension??

I.e. after (testwise) opening the fireall port, we are still unable to login to Bitbucket-Cloud, as we get the following error: "Error authenticating with bbcloud: Error: Error fetching Bitbucket tokens: Error \[ERR_SOCKET_CLOSED\]: Socket is closed"

Once we start VS-Code as the administrator, all works fine.

As said, our IT now requires details on why and what exactly is required. Else we can not use Bitbucket- or Jira-Cloud.

THX


Answers:
author: Patrik S
body: Hello [@Bernd Niedergesaess](/t5/user/viewprofilepage/user-id/5232166) and thank you for reaching out to the Community!

I've noticed you also opened an internal ticket with us to report this issue and one of our support engineers is already working with you in that case. I would suggest focusing the discussion on the support ticket to avoid any possible confusion of tracking the issue in two different places.

Once the support ticket is resolved, feel free to share the resolution here :)

Thank you, [@Bernd Niedergesaess](/t5/user/viewprofilepage/user-id/5232166) !

Patrik S


Tags: bitbucket-cloud

cloud

jira
How to get audit logs generated for all the repository in a project.
Asked by Snehil Kumar:

The log should include information about commits/pull requests/branches/number of commits by users and other such activities.


Answers:
author: Ben
body: Hi Snehil,

This feature is not natively supported in Bitbucket - however, I have raised a feature request on your behalf with our development team. With consideration of our [feature implementation policies](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html) - please feel free to **"Watch"** this ticket to receive future updates related to it and **"Vote"** for it to improve its visiblity with regard to customer demand:

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

In the interim, there are add-ons such as AwesomeGraphs for Bitbucket Cloud that can show this data visually - I would recommend trying this:

* <https://marketplace.atlassian.com/apps/1210934/awesome-graphs-for-bitbucket>

Cheers!

- Ben (Bitbucket Cloud Support)

comments: author: Snehil Kumar
body: Thanks Ben. I would like to know if this can be achieved by log commands in git


author: Ben
body: Hi [@Snehil Kumar](/t5/user/viewprofilepage/user-id/5232078)

Pull requests are performed purely through the UI, the data is not shown in GIT as GIT doesn't know what a PR is, you can gather information using our pull request API:

<https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-get>

GIT commands are a bit limited in scope for showing stats, however, you could perform some of these as an example - I would recommend reading through [GIT documentation](https://git-scm.com/docs) for more insight:

```
// Total commits by author since a certain date
git shortlog -s -n --all --since 2022-01-01

// Total commits by author - all time
git shortlog -s -n --all

// Total commits per branch
`git rev-list --count <branch-name>`
```

Cheers!

- Ben (Bitbucket Cloud Support)


author: Snehil Kumar
body: Thanks Ben. Appreciate it.


Tags: audit

bitbucket-cloud

cloud

log
Accidently Deleted the workspace
Asked by ddrepos:

Dear All,

I have accidentally deleted the workspace and all m repos are not showing, is there any way to recover the deleted workspace?

Regards

Syed Ejaz


Answers:
author: Theodora Boudale
body: Hi Syed,

I'm afraid that we cannot restore deleted workspaces.

I checked our logs and I do not see any workspace deletion event by your user in the last 30 days. You can see all workspaces that your account has access to via this page (after you log in to bitbucket.org):

* <https://bitbucket.org/account/workspaces>

You can also access that link if you log in to <https://bitbucket.org>, select your avatar (top right corner) \> **All workspaces**.

If the workspace was indeed deleted, you will need to recreate it and recreate its repos from local clones.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
why does git asking to submit username and password every time?
Asked by mRaj:

why does git keep on asking to submit username and password every time i do npm install even though its all ssh key


Answers:
author: mRaj
body: BTW I found it is a vs-code issue till now did not find that login popup.  
Make sure this field should be unchecked. Well can't be sure but it worked for me.  
Anybody find anything else update me   
Thanks

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


author: Erez Maadani
body: Hi [@mRaj](/t5/user/viewprofilepage/user-id/5151572)

Check your package.json. It's possible that one of your npm dependencies (or their transitive dependencies) is pointing to a git repo which requires your authentication - the git repo url is https:// and not ssh://

comments: author: mRaj
body: Hi, [@Erez Maadani](/t5/user/viewprofilepage/user-id/5018344)  
well yes in dependencies it's asking for a repo but it is git+ssh and moreover, it used to work before   
but yes I updated node ver to 16 that is one significant change apart from that no change  
and surprisingly it works in the git bash terminal but when doing any npm in vs code integrated bash terminal it asks


author: Erez Maadani
body: Hi [@mRaj](/t5/user/viewprofilepage/user-id/5151572)

It's possible that there are two different git/ssh clients with two different configurations: one is more strict than the other.

Following recent changes to BitBucket host key, you might need to either:

1. Configure your vs-code to use the same git/ssh client as your bash terminal.
2. Update your ssh configuration of your vs-code ssh client. See details here: <https://bitbucket.org/blog/ssh-host-key-changes>


author: mRaj
body: Hi, [@Erez Maadani](/t5/user/viewprofilepage/user-id/5018344) will try the above-suggested steps.  
since you mentioned a host key change that I did not update maybe that is the issue.  


author: mRaj
body: ![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/260416i58C54D03FEAF96B5/image-size/large?v=v2&px=999 "image.png")


Tags: bitbucket-cloud

cloud
Custom maven settings.xml
Asked by Mukesh Mehta:

I have defined a custom maven setting.xml which resides in the root directory of the repository, however when I am executing the pipeline which has this command: **"- mvn -B -s settings.xml clean install",**it is not referring to the custom settings.xml file. Any suggestions, what could be the issue?


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

When a pipeline build starts the repository is cloned into the build container and the build starts in the root directory of the cloned repository. By any chance are you changing the directory during your build, like executing a **cd \<new directory path\>**?

Also, since you mentioned the file settings.xml was committed to the root of your repository, I would suggest listing the files during your pipeline to confirm if the file is indeed there :

```
ls -la
```

You can add this command to your step's script before the **mvn** command.

If that still does not work, I would suggest trying to debug the build locally using docker following the instructions of [Debug pipelines locally with docker](https://confluence.atlassian.com/bbkb/debug-pipelines-locally-with-docker-1167698072.html) as this seems to be an error with the maven config itself. Once it successfully runs locally, you can push the changes to the bitbucket repository and the pipeline should produce the same result.

Thank you, [@Mukesh Mehta](/t5/user/viewprofilepage/user-id/5231831) !

Patrik S

comments: author: Mukesh Mehta
body: Hi Pratik,

Thanks a lot for suggesting the solution. I tried debugging locally and found a problem with maven config. I was able to fix the config and it is working fine now.

Thank you,

Mukesh Mehta


Tags: bitbucket-cloud

cloud
"Schema validation: Property 'variables' is not allowed" error in bitbucket-pipelines.yml
Asked by Danny Chia:

I've set up a pipeline to allow a user to repeat a test a specific number of times. It looks something like this:

```
image: python:3.11.0

definitions:
  caches:
    pip3: /usr/local/lib/python3.11/site-packages
  steps:
    - step: &setup
        name: 'Install dependencies'
        caches:
          - pip3
        script:
          - python3 -m pip install --upgrade pip
          - pip install -r requirements.txt

pipelines:
  custom:
    run_tests:
      - variables:
          - name: iterations
            default: 1
      - step: *setup
      - step:
          name: 'Run tests'
          caches:
            - pip3
          script:
            - |
              for i in `seq 1 $iterations`; 
              do
                python run_tests.py
              done

          artifacts:
            - outputs/**
```

However, PyCharm gives me this error:

```
Schema validation: Property 'variables' is not allowed
```

I don't know if the issue is with PyCharm or something else, but there are no problems after the code, and the pipeline runs fine. Anyone know what's causing this?


Answers:
author: Theodora Boudale
body: Hi Danny and welcome to the community!

I see no issues with your bitbucket-pipelines.yml file, the definition of the variables in the custom pipeline looks correct and according to our [docs](https://support.atlassian.com/bitbucket-cloud/docs/pipeline-start-conditions/#Custom--manual--pipeline-variables).

I'm not sure why PyCharm shows an error and how they do this validation; it may be best to reach out to the support team of the product if you'd like to get more info on that.

You can use our validator for bitbucket-pipelines.yml if you want to check the validity of your bitbucket-pipelines.yml file:

* <https://bitbucket-pipelines.atlassian.io/validator>

Kind regards,  
Theodora

comments: author: Danny Chia
body: Thanks for the response. I ran the file through the validator, which shows no problems. I suspect it is a PyCharm issue.


author: Theodora Boudale
body: You are welcome Danny, I suspect this may be the case as well.

Please feel free to reach out if you ever need anything else!


Tags: bitbucket-cloud

cloud
Is there a way to block a pipeline from running if a branch already exists?
Asked by Ron S:

We want to setup test branches for our repository (e.g. test/\*). We want to automatically run the pipeline for anytime a branch with the prefix of "test/" (e.g. test/new-feature) is updated.

However, we only want 1 active "test/" branch and block the pipeline if another developer pushes a branched called "test/other-new-feature". This way code in the test environment doesn't get overridden by mistake.

Is this possible within pipeline YML file?

Thanks.


Answers:
author: Theodora Boudale
body: Hi Ron,

If you configure a branch pipeline for test/\*, it is going to run for all branches with the "test/" prefix.

What you could do instead is use in the bitbucket-pipelines.yml file the exact name of the branch, e.g. test/feature-a. When you finish with this branch and you want to use another test branch for builds, you can edit the bitbucket-pipelines.yml file and change test/feature-a to the name of this other test branch.

Is this something that works for you?

Kind regards,  
Theodora

comments: author: Ron S
body: Hi Theodora,

Thanks for the suggestion. That's definitely one way to handle this, however, it won't stop the issue of another developer potentially pushing a test/something-new without checking and overriding the first test/new-feature branch.

Cheers,

Ron


author: Theodora Boudale
body: Hi Ron,

I understand your concern.

You mentioned in your question
> This way code in the test environment doesn't get overridden by mistake.

If the pipeline has a deployment step or stage, then with the Premium plan you can restrict the branches that are allowed to deploy to a certain deployment environment.

This can be done by admins from **Repository settings** \> **Deployments** \> select a deployment environment \> you will see an option **Branches allowed to deploy to \<deployment_enviornment_name\>:**

In there, an admin can specify which branches are allowed to deploy to this specific environment.

This would need to be updated every time you want to have deployments run for a different test branch.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
RENEWAL IS UNAVAILABLE
Asked by Anoop Palavai:

What my customers are unable to access the Bitbucket by June 8th, is that the case?

What if i renew, current server license? that should give us some time to renew?

![Capture.JPG](/t5/image/serverpage/image-id/260204iA9F047C7814D20FA/image-size/large?v=v2&px=999 "Capture.JPG")


Answers:
author: Christian Glockner
body: Your installation of Bitbucket Server will continue to work, but you will not be able to upgrade to a version of Bitbucket Server released after the expiration date of the license.

Cheers,  
Christian  

Premier Support Engineer  
Atlassian

comments: author: Anoop Palavai
body: Thanks for the response, I have upgraded for time being

I will start the migration from my end for moving out to Bitbucket cloud.

Thanks


author: Aron Gombas _Midori_
body: I think the "Starter" license type has been removed a long time ago...

You should search for it, but I think Atlassian's recommendation would be to purchase a 10-user license (which may be on the same price level as his Starter was). But if he wants a 10-user **Server** license, then Server as an option was also removed.

Which means that the recommendation is probably going to Cloud.

comments: author: Anoop Palavai
body: is there a way shift and drop the whole this small repos to Bitbucket Cloud?

if there is one?, Please share all the complete details here,

Thanks


Tags: bitbucket-server

server
How to configure Jenkins to access Bitbucket Cloud with 2FA?
Asked by Aiden_han:

Hi, I have a question about configuring Jenkins to access Bitbucket Cloud with 2FA(Two Step Verification).

When I applied 2FA to our workspace using Access controls, Jenkins couldn't access the workspace.

What should I do in this case?

Thanks in advance!


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

How is authentication for Bitbucket Cloud configured in Jenkins? Are you using the credentials of a Bitbucket account that has access to your workspace's repos?

If so, and if "Require two-step verification" is enabled for a workspace, then 2FA needs to be configured for the Bitbucket account that is used in Jenkins.

If the configuration in Jenkins allows it, you could also look into using a workspace access token instead:

* <https://support.atlassian.com/bitbucket-cloud/docs/workspace-access-tokens/>

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud

jenkins
Bitbucket cloud api PKCE Authorization flow - Client credentials missing
Asked by Brandon G:

I have been following: <https://confluence.atlassian.com/bitbucketserver0720/bitbucket-oauth-2-0-provider-api-1116282017.html> to login to my bitbucket repository, but am consistently getting told by bitbucket's api that I am missing client credentials (including client_secret, which PKCE should not need).

Here is my setup:  

1. Bitbucket workspace with dummy consumer for test (client key is used as client_id) and included in the body of all requests
2. local server running listening for the callback url

Here is my understanding of the flow:  

1. Client application sends users to  
   <https://bitbucket.org/site/oauth2/authorize> with client_id, code_challenge, response_type, redirect_uri, etc.
2. user accepts access request and is redirected to redirect_uri with a **code** parameter
3. redirect uri requests an access token from  
   <https://bitbucket.org/site/oauth2/access_token>, sending the code verifier, code, and client id

#1 and @#2 work - I get a code back, but site/oauth2/access_token expects a client id and secret - does PKCE not work for bb.org?


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

I'm afraid the documentation you linked is for Bitbucket Server and not Bitbucket Cloud.

The Bitbucket Cloud API does not currently offer the [Proof Key for Code Exchange (PKCE)](https://datatracker.ietf.org/doc/html/rfc7636) so this is the reason why you are receiving that error.

In order to exchange the authorization code for an access token you will need to call the below endpoint :

```
curl -X POST -u "client_id:secret" https://bitbucket.org/site/oauth2/access_token -d grant_type=authorization_code -d code={code}
```

Where the client_id and secret are the values from the [OAuth consumer](https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/) you have created under your bitbucket workspace.

For more details on the available authentication methods for Bitbucket Cloud API, you can refer to the following documentation :

* <https://developer.atlassian.com/cloud/bitbucket/rest/intro/#authentication_old>

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

Patrik S

comments: author: bguest
body: Thanks and got it! I am building a client side application that has an embedded web server to handle callbacks but was hoping to use pkce so that I didn't have to use the implicit grant flow or store the client secret within my application. Not a huge deal


Tags: bitbucket-cloud

cloud
Connecting to github from Sourcetree hangs after credentials entered
Asked by Joshua Dubey:

I am trying to connect Sourcetree to my github repo. I am using version 2.7 on the mac.

I am using 2FA. Once I enter all my credentials successfully, the window says

### You are being redirected to the authorized application {#toc-hId-1055819029}

If your browser does not redirect you back, please [click here](sourcetree://oauth?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch) to continue.

However, the browser never redirects (I've waited quite some time), nor does "click here" do anything. My only option is to cancel, and the account is not added.

Any ideas?

Thanks,

Josh


Answers:
author: alexlavr
body: Same problem here. Sourcetree 4.0.1

comments: author: alexlavr
body: Found a fix. Restarted my mac and it works ok.


author: tejender
body: I am facing the same issue.


author: bgannin
body: Hi [@Joshua Dubey](/t5/user/viewprofilepage/user-id/1335473),

Is there any interesting networking in the way *(managed by IT, firewall\[s\], etc.)*out of curiosity? Are there any interesting logs in the Console app related to Sourcetree/GitHub when you do so? Sorry for the hiccup.

Brian Ganninger  
Principal Developer, Sourcetree

comments: author: Joshua Dubey
body: Hi Brian,

No firewalls, etc. that I know of. I have no trouble connecting to Bitbucket repos, even with 2FA.

I upgraded to ST 3.1 for the mac, and the issue above went away, but I am having different issues now where either ST complains about not being able to upload a public key, even after I've added it manually to github; or if I use HTTPS, ST claims my login credentials are wrong.

I tried connecting to github with their desktop client and I was having almost identical issues, so it might not be ST related. Some research I've done leads me to believe it might have to do with it being a private repo (though that seems odd).

When I have some more time I can give you more details on all the scenarios, if you think it will help.

Also, git works fine from the command line.

Thank you for your response,

Josh


author: Narsi Gangishetti
body: same problem for me. thanks.

Mac OS X version 10.11.4

Sourcetree Version 2.5.3


Tags: authentication

github

mac