youngmon/atlassian-qna huggingface dataset:
How do I ban a user from a workspace?
Asked by benlubar:

My Bitbucket Cloud workspace is getting repeated comments from a user who is harassing the developers working on the project. Is there a way to ban that user from commenting?


Answers:
author: Fabio Racobaldo _Herzum_
body: Hi [@benlubar](/t5/user/viewprofilepage/user-id/119596) ,

anyone with write permission can comment so, if you need to block that user, verify that he has not write permission on your repo/project.

Fabio

comments: author: benlubar
body: Hi [@Fabio Racobaldo _Herzum_](/t5/user/viewprofilepage/user-id/781528) ,

This user definitely does not have (and has never had) write permission to the project. I recently disabled anonymous commenting on the project due to the harassment, and they have gotten around it by creating an account.

Thanks,  
Ben


author: Fabio Racobaldo _Herzum_
body: is that repo public?


author: benlubar
body: Yes.


author: Fabio Racobaldo _Herzum_
body: Please could you share your project/repo permissions?


author: benlubar
body: ![Screenshot 2022-04-24 03.10.06.png](https://community.atlassian.com/t5/image/serverpage/image-id/194314i9C2DCF8A35C1EA06/image-size/large?v=v2&px=999 "Screenshot 2022-04-24 03.10.06.png")![Screenshot 2022-04-24 03.13.56.png](https://community.atlassian.com/t5/image/serverpage/image-id/194315i7E0007E93B958E15/image-size/large?v=v2&px=999 "Screenshot 2022-04-24 03.13.56.png")


author: Fabio Racobaldo _Herzum_
body: If the issue tracker is public so anyone can add a comment. You have no chance to avoid that user to add comment because he can create a new account.


Tags: bitbucket-cloud

cloud
Create Git Commit Hook
Asked by Roman Wolf:

Hi Community,

We are using BitBucket cloud service to host all our Git repositories.

I would like to enforce some rule on each commit for some repositories. Technically I want to apply a Git commit hook on server side to valid any incoming push and allow/reject it by a bunch of checks.

On BitBucket cloud I can only find the configuration of Webhooks. From the [documentation](https://support.atlassian.com/bitbucket-cloud/docs/manage-webhooks/ ) I was not able to clarify my following questions:

* The Webhook sends an HTTP POST request to remote server, is the response evaluated and has it impact on the incoming Git push? Or is it fire and forget?
* Is it possible to achive commit hooks by using the Webhook functionality?

Thanks a lot, Roman


Answers:
author: Roman Wolf
body: I think I found the answer (<https://community.atlassian.com/t5/Bitbucket-questions/Does-Bitbucket-Cloud-support-git-pre-receive-hooks/qaq-p/950235>):

**Git pre-commit hook is currently support in BitBucket DataCenter, but NOT in BitBucket Cloud.**

BitBucket WebHooks are NOT an equivalent to that.

There is a ticket pending (might need more votes): <https://jira.atlassian.com/browse/BCLOUD-10471>

Regards, Roman

comments: author: Ulrich Kuhnhardt _IzymesCo_
body: Everyone reading \`this\` please vote on <https://jira.atlassian.com/browse/BCLOUD-10471>


author: laura.devita
body: Hi Roman,

You can enable a webhook so every time you commit you can create a pull request, and manage a review of the code with that.

You can make a [Bitbucket REST API call](https://docs.atlassian.com/bitbucket-server/rest/7.18.0/bitbucket-rest.html#idp382) (via curl or postman) to enable/disable specific hooks programmatically.

1. GET your repo hook keys via /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks

2. PUT request for hook to be enabled (DELETE disables the hook) via /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/enabled

Best Regards

Laura

comments: author: Roman Wolf
body: Hi [@laura.devita](/t5/user/viewprofilepage/user-id/1513660)

thanks for you quick reply. Creating a PR on each commit is not exactly what I am looking for.

Actually I try to find a way on server side (BitBucket) to prevent a commit being stored in BitBucket Git repository.

This can be useful for a couple reason. Mainly when you want to apply a quality gate that needs to be passed before a commit is accepted. E.g. developer should follow a certain code format rule or the commit message must contain some required information.

Apply this on all developer systems is a high effort and can of course be bypassed by the developers easily.

So it is a better approach to ensure those things on Git server side by what is called a commit hook.

It is also possible to apply these quality gates later on (thru a central CI instance) but it is much more charme to apply some check already when the commit is send and reject it if checks are failing.

Regards, Roman


Tags: bitbucket-cloud

cloud
Custom pipeline configuration with parallel steps
Asked by ash:

I am having trouble determining if it is currently possible in Bitbucket Pipelines to have multiple custom configurations that also execute a parameterized script with different arguments passed to it in parallel.

What I am trying to accomplish

1. Have pipeline config for more than one "build-push" job to trigger on push to a branch
2. Retain the ability to parallelize our scripts

This shows essentially what I'm currently attempting to do, but this fails with

*"There is a YAML syntax error in your bitbucket-pipelines.yml at \[line 45, column 11\]. To be precise: found unconstructable recursive node"*

![Screen Shot 2022-04-22 at 10.09.27 AM.png](/t5/image/serverpage/image-id/194160i6661887BFEBF6A9E/image-size/large?v=v2&px=999 "Screen Shot 2022-04-22 at 10.09.27 AM.png")

This Pipeline config is very close to what we want, but doesn't provide the custom "build-push" trigger. Parallelization works as expected.

![Screen Shot 2022-04-22 at 10.45.37 AM.png](/t5/image/serverpage/image-id/194182i1E30E7332FA91C64/image-size/large?v=v2&px=999 "Screen Shot 2022-04-22 at 10.45.37 AM.png")

Is this type of config currently possible in Pipelines?

Thanks!

Ash


Answers:
author: Caroline R
body: Hi, [@ash](/t5/user/viewprofilepage/user-id/1514084), thank you for reaching out to Atlassian Community.

As we'll need to see the YML file to further analyze this case, I have created an internal ticket for you using the email of your community account, so you don't have to share this information here.

You should have received an email with a link to the support ticket. Just in case you haven't received it, please feel free to let me know and I can post the ticket URL here. The ticket will be visible only to you and Atlassian staff, no one else can view its contents even if they have the URL.

Please feel free to let me know if you have any questions.

Kind regards,  
Caroline


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

cypress

npm

parallel
Rule that only branch creator can delete their own repository branch
Asked by Garry Yuen:

In bitbucket branches, is there a way to set up rules so that only the creator of the branch can delete that branch from the bitbucket repository?


Answers:
author: Ben
body: G'day G-Rock!

Currently, the branch permissions UI only allows for restricting the deletion of the branch for EVERYONE or controlling write access for the branch, the use case which you have mentioned is unfortunately not accounted for.

I have created a feature request however on your behalf to raise this with our development team, feel free to "Watch" this request for future updates:  
<https://jira.atlassian.com/browse/BCLOUD-21862>

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

branch

cloud
Not able to create a pull request
Asked by Vitalii Bendyna:

Hello!

According to Your [REST API documentation](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-post) and [the same question](https://community.atlassian.com/t5/Bitbucket-questions/how-to-create-bitbucket-pull-request-using-bitbucket-rest-api/qaq-p/906404), I must be able to create a PR with REST API, but every time I'm getting 400 response.

I tried to make this request (also the same with Python):

curl -v <https://api.bitbucket.org/2.0/repositories/>\<org_name\>/\<repo-name\>/pull-requests \\

-u my-username:my-password \\

request POST \\

header 'Content-Type: application/json' \\

data '{

"title": "My Title",

"source": {

"branch": {

"name": "test_12345"}}}'

and I've received this error:

{"type": "error", "error": {"message": "Resource not found", "detail": "There is no API hosted at this URL.\\n\\nFor information about our API's, please refer to the documentation at: <https://developer.atlassian.com/bitbucket/api/2/reference/>"}}

Could I ask you please to help me with it?

What I'm doing wrong?


Answers:
author: Fabio Racobaldo _Herzum_
body: Hi [@Vitalii Bendyna](/t5/user/viewprofilepage/user-id/3636832) ,

you are using the wrong format :

Your <https://api.bitbucket.org/2.0/repositories/>\<org_name\>/\<repo-name\>/pull-requests

Correct <https://api.bitbucket.org/2.0/repositories/my-workspace/my-repository/>**pullrequests**

Hope this helps,

Fabio

comments: author: Vitalii Bendyna
body: Yep, thanks. Somehow it worked.

But with python requests library still I'm not able to do it... Never-mind, I used curl))


author: Fabio Racobaldo _Herzum_
body: Thanks for the feedback [@Vitalii Bendyna](/t5/user/viewprofilepage/user-id/3636832) . Please marl my answer as accepted


Tags: api

bitbucket-cloud

cloud

pull-request
How can I Run more than one kubectl commands in a pipe atlassian/kubectl-run:3.2.0
Asked by yosser_mahfoudh:

I want to run multiple commands line

first is deleting an exicting pod then **apply the new pod** x1and apply other pod.

Actually each time I excute apply cmd it brings me a new pod where I want it to replace the existing one.


Answers:
author: Ben
body: G'day!

To run multiple commands within kubectl, you would specify this within your YML configuration using the following syntax inside the specification of the pods contents when listing commands to execute:

    command: ["/bin/sh","-c"]args: ["command one; command two && command three"]

I believe this StackOverflow discussion which I have found will also help to point you in the right direction:  
<https://stackoverflow.com/questions/33887194/how-to-set-multiple-commands-in-one-yaml-file-with-kubernetes>

Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)

<br />

<br />


author: yosser_mahfoudh
body: Hi ,

When I push the image to the server it creates a new pod X-ID1 or I already have pod X-ID2 with diferent ID let's say.

So is there a way to prevent that to happen?


Tags: bitbucket-cloud

cloud

kubernetes
Bitbucket Two step verification codes invalid error
Asked by tom.pallissery:

I had two step verification enabled on the account, and was using Google Authenticator as the authenticator to provide codes. I changed the phone and was trying the setup the authenticator but the login to bitbucket itself is requiring a code which I don't have. Fortunately the backup codes are working, using which I logged into the account and disabled 2FA. When I logout and login again it still asks me for the 2FA codes.

I also tried setting up 2FA again using the backup code as login and setup on the new phone's google authenticator, but the codes which is provided by the app on the new phone is not working on bitbucket.

Any idea on how to resolve this? I would eventually run out of backup codes to use like this and would be locked out.


Answers:
author: Chengyuan Lai
body: I'm experiencing the same issue.

Before it was only asking for authentication code for once and I could login without any issue.

But recently, after I passed the first authentication (for Atlassian), it brought me to another two-step verification page (for Bitbucket) and my authentication code and recovery code didn't work for this one.


author: tom.pallissery
body: My bad, there is another 2FA which is enabled at the bitbucket level, and not the atlassian account level. Disabling that finally disabled all the 2FA checks.


Tags: bitbucket-cloud

cloud
WIth what should be filled the KUBE_CONFIG variable
Asked by yosser_mahfoudh:

Knowing that I'm working on deploying pod in kubernetes cluster using bitbucket.yaml file.

I'm following this article and I'm wondering whith what should be filled $ KUBE_CONFIG ?

<https://support.atlassian.com/bitbucket-cloud/docs/deploy-to-kubernetes/>


Answers:
author: Yevhen
body: [@yosser_mahfoudh](/t5/user/viewprofilepage/user-id/3803216) that would be base64 encoded kubeconfig yaml that you'd typically use when interacting with a K8s cluster using kubectl or other clients.


Tags: bitbucket-cloud

cloud
How to Backup Automated Bitbucket projects? Please clarify
Asked by Rakesh Parthasarathy:

Dear Team,

Kindly help me on how to backup automated bitbucket projects?


Answers:
author: Piotr Biegun _Gitprotect_io_
body: Hi [@Rakesh Parthasarathy](/t5/user/viewprofilepage/user-id/4884197)

<br />

Besides topics [@Fabio Racobaldo _Herzum_](/t5/user/viewprofilepage/user-id/781528) mentioned you could use dedicated solutions for backup and disaster recovery like Gitprotect.io, which is available in Atlassian Marketplace: [https://marketplace.atlassian.com/apps/1225728/gitprotect-io-backup-for-bitbucket?hosting=cloud\&tab=overview](https://marketplace.atlassian.com/apps/1225728/gitprotect-io-backup-for-bitbucket?hosting=cloud&tab=overview)

<br />

If you have any questions just let me know,  
Piotr


author: Fabio Racobaldo _Herzum_
body: Hi [@Rakesh Parthasarathy](/t5/user/viewprofilepage/user-id/4884197) ,

welcome to the Atlassian community!

This article <https://support.atlassian.com/bitbucket-cloud/docs/does-bitbucket-backup-my-repositories/> can clarify your doubts about Atlassian backup policy.

Here three ways to perform backups on your side <https://rewind.com/blog/back-up-and-restore-repositories-bitbucket-cloud/>

Hope this help,

Fabio


Tags: bitbucket-cloud

cloud
authentication broken no idea wherer to start.
Asked by ulao:

I'm not much good with git, or how it works, it just works (well normally). I have a repo on bit bucket and I can log in ok.

I also set up a git client to check in my source code and recently when I push, I get a password prompt. I guess it changed... but the one I use for bitbucket does not work.

my config says to use a name @ url

[https://\<USERNAME@bitbucket.org/\<WORKSPACE/\<REPOSITORY\>.git](https://ulao@bitbucket.org/bliss-box/bliss-box-bridge-git.git)

but the login to bit bucket forces an email, so I wonder if something changed on the bitbucket end? I tried removing the name and logging in with the email but that too is failing.

Maybe the accounts are out of sync? If I put in this url to a browser, I log in ok.


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

Thank you for reaching out to Atlassian Community, and great to hear you were able to get it working!

First of all I'd like to let you know I've edited the description of your question in order to remove some sensitive information, such the repository and workspace names and also your bitbucket username.

Also, to give you some background on the issue you were facing, Bitbucket cloud has recently deprecated the usage of account passwords for git activity over HTTPS and calls to Bitbucket API, and you should use an [App Password](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/) to authenticate for those scenarios. You can find more details about that change in the following article :

* <https://community.atlassian.com/t5/Bitbucket-articles/Announcement-Bitbucket-Cloud-account-password-usage-for-Git-over/ba-p/1948231>

So in summary, to login to Bitbucket website you will continue to use your e-mail address and account password, but for git activity over HTTPS (cloning/pulling/pushing) you will have to use your bitbucket username (not e-mail address) and an [App Password](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/) with the required privileges.

Hope that helps to clarify. If you have any questions or concerns let me know :)

Thank you, [@ulao](/t5/user/viewprofilepage/user-id/3572053) !

Kind regards,

Patrik S


author: ulao
body: Well I got it working, I saw this encrypted url in my log that said something about an app password. I followed it and it asked for something like 100 permissions, so I just checked them all. I hit created and it gave me a last pass like generic pass word string. That worked to commit, then I was locked out of this page and my bitbubket . I then had to reset my password and that let me back in.

both are now working... so not sure what I did there, quite a circus to be honest. I get being secure, but what good is it if uses need to do all of this to log in? I could quite easily see people losing work and wasting lots of time.

I'd suggest you make this a bit more clear to users at some level, this was not a fun experience.


Tags: cloud
How to find the IP address of the bitbucket
Asked by Guy Parsadanov:

In order to run a unit test before deployment and fetch the data from database, the test uses the connection to database and needs an IP address of the Bitbucket in order to whitelist it on the DB server side. Does anyone know how can we find the IP address of the Bitbucket, so we can whitelist it. Thanks.


Answers:
author: Karthick S
body: Hello [@Guy Parsadanov](/t5/user/viewprofilepage/user-id/4678007)

Welcome to Atlassian Community!

You may whitelist the below IPs:

* <https://support.atlassian.com/bitbucket-cloud/docs/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall/>
* <https://support.atlassian.com/organization-administration/docs/ip-addresses-and-domains-for-atlassian-cloud-products/#AtlassiancloudIPrangesanddomains-OutgoingConnections>

I hope this helps.

Kind regards,  
Karthick S


author: verraf
body: Hi [@Guy Parsadanov](/t5/user/viewprofilepage/user-id/4678007)

you can find the information on this documentation page:

<https://support.atlassian.com/bitbucket-cloud/docs/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall/>


Tags: bitbucket-cloud

cloud
bitbucket skip pipeline based on tag
Asked by Vikash Balasubramanian:

Say, I have a tag based pipeline on bitbucket like this

```
pipelines:
? tags:
??? v*:
??? ?? - step:
```

I don't want to run pipelines on PATCH version changes [semver](https://semver.org/).

For example when going from tag v1.0.0 to v1.0.1 I don't want to run pipelines. Pipelines should only run when there is a MINOR or MAJOR change like. v1.0.0 to v1.1.0 or v2.0.0.

How do I do this?

Is there a \[skip ci\] equivalent when pushing tags to indicate I don't want pipeline to run for this tag?


Answers:
author: Theodora Boudale
body: Hi [@Vikash Balasubramanian](/t5/user/viewprofilepage/user-id/4832124),

\[skip ci\] cannot be used during push but in a commit message.

You can include \[skip ci\] in the commit message of commits with a tag that you don't want to trigger the pipeline for, and the pipeline will be skipped when you push the tags.

In your example, include \[skip ci\] in the commit message of the commit with tag v1.0.1

Please note that if you have additional pipelines, e.g. a default pipeline or a branch pipeline, these will not get triggered either for the commit that has \[skip ci\] in its commit message.

Kind regards,  
Theodora

comments: author: Vikash Balasubramanian
body: Hi just to clarify,

If I do a commit message like:

```
[skip ci] This commit message will have tag v1.0.1
```

And do a git tag v1.0.1 and git push --tags no pipeline will be triggered? Is this documented somewhere?


author: Theodora Boudale
body: Hi [@Vikash Balasubramanian](/t5/user/viewprofilepage/user-id/4832124),

This is correct, no pipelines builds will get triggered for the commit that has \[skip ci\] in its commit message.

The \[skip ci\] feature is documented here:

* <https://support.atlassian.com/bitbucket-cloud/docs/bitbucket-pipelines-faqs/>

> Can I commit without triggering the pipeline?
>
> Yes. If you don't want to run a pipeline on a commit that would normally trigger one, you can include \[skip ci\] or \[ci skip\] anywhere in your commit message of the HEAD commit. Any commits that include \[skip ci\] or \[ci skip\] in the message are ignored by Pipelines.

No pipelines builds will get triggered for the \[skip ci\] commit, regardless of whether they are tag, default, or branch-based builds.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
How to view repositories in shared workspace via Codepipeline and CodeStar in AWS?
Asked by Kent Wong:

Problem: My Bitbucket codestar connection cannot see or use repos in workspaces I do not own/have admin in.  

I am working on a repository (repo A) in Workspace A, I do not own workspace A. Workspace A is part of the organization I work for and they manage it, so I do not have admin in it.

I have created a CodeStar App connection using my BitBucket login and I cannot use the repository (repo A) as a source. Is there any valid workarounds besides being elevated to Admin on the Workspace (workspace A)? I'm an Admin for Repo A.  

I have tested my buildspec/code/CodeStar Connection as I tested a repository (repo B) in Workspace B, which I "own". It works just fine. So I suspect there's some access rights here that are not playing nicely.


Answers:
author: Mark C
body: Hi [@Kent Wong](/t5/user/viewprofilepage/user-id/4889244)

Welcome to the community.

Unfortunately, you'll need to be an admin of a workspace before you can load Bitbucket Cloud repositories from it in CodeStar.  
Alternatively, what you can do is fork the repository to your own workspace and choose your own workspace in CodeStar.

Do let me know if you have further questions that I can help with.

Regards,  
Mark C

comments: author: Juan Castillo
body: Does this mean that if a company has 10 developers, all need to become company workspace administrators, even though they have administration to their department repositories? If that happens then they'll be able to administer all department administrators and it can have security ramifications.

If there's no fix to this then maybe we can check out Github if that works better for them. Ideally, we should have a token that can be generated and they can use.


Tags: aws

bitbucket-cloud

bitbucket-pipelines

cloud