youngmon/atlassian-qna huggingface dataset:
How to get latest commit date for the number of files using Bitbucket rest api or any other way?
Asked by Machindra Dharmadhikari:

I am trying to retrieve latest commit date on multiple files(around 66K) for which I have Stash link only. Please suggest how can I get this latest commit date for this respective files.

Below is the sample for 1 file:

https://\[Node name\]:8081/projects/{Project Name}/repos/{Repo Name}/browse/{folders}/xyz/xyz-xml.xml


Answers:
author: John Lawlor
body: You could get it using using the rest api:

```
`curl -u fred:fred http://localhost:7990/rest/api/1.0/projects/WORK/repos/my-repo/commits/?until=master`
```

<https://developer.atlassian.com/server/bitbucket/how-tos/command-line-rest/>


Tags: bitbucket-server

server
Error while running webdriver.io tests in bitbucket pipeline
Asked by Sanju Ammu:

We are pretty new to Bitbucket pipeline. Currently trying to setup a pipeline to run webdriver.io tests written in typescript in bitbucket pipeline.

We were able to write the pipeline yml file with some help from bitbucket documentation.

```
image: node:12.17.0

pipelines:

custom: # Pipelines that can only be triggered manually

uiTests:

 - step:

script:

 - apt-get update

 - apt-get install libnspr4 libnss3 libnss3-tools

 - npm install

 - npm run << test written in webdriver.io >>

services:

 - selenium-chrome

definitions:

services:

selenium-chrome:

image: selenium/standalone-chrome:3.141.59-oxygen
```

The above pipeline failed with below error message

    Starting ChromeDriver 88.0.4324.96 (68dba2d8a0b149a1d3afac56fa74648032bcf46b-refs/branch-heads/4324@{#1784}) on port 9515

    Only local connections are allowed.

    Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.

    ChromeDriver was started successfully.

    [0-0] RUNNING in chrome - /tests/browser_tests/businessline/hackathon/register_happy_path.test.ts

    [0-0] 2021-09-28T19:09:28.604Z ERROR webdriver: Request failed with status 500 due to unknown error: unknown error: cannot find Chrome binary

    [0-0] 2021-09-28T19:09:28.605Z ERROR webdriver: unknown error: unknown error: cannot find Chrome binary

        at Object.getErrorFromResponseBody (/opt/atlassian/pipelines/agent/build/node_modules/webdriver/build/utils.js:189:12)

        at WebDriverRequest._request (/opt/atlassian/pipelines/agent/build/node_modules/webdriver/build/request.js:168:31)

        at processTicksAndRejections (internal/process/task_queues.js:97:5)

        at Object.startWebDriverSession (/opt/atlassian/pipelines/agent/build/node_modules/webdriver/build/utils.js:63:20)

        at Function.newSession (/opt/atlassian/pipelines/agent/build/node_modules/webdriver/build/index.js:56:45)

        at Object.exports.remote (/opt/atlassian/pipelines/agent/build/node_modules/webdriverio/build/index.js:56:22)

        at Runner._startSession (/opt/atlassian/pipelines/agent/build/node_modules/@wdio/runner/build/index.js:202:56)

        at Runner._initSession (/opt/atlassian/pipelines/agent/build/node_modules/@wdio/runner/build/index.js:164:25)

        at http://runner.run/ (/opt/atlassian/pipelines/agent/build/node_modules/@wdio/runner/build/index.js:87:19)

    [0-0] 2021-09-28T19:09:28.608Z ERROR @wdio/runner: Error: Failed to create session.

    unknown error: cannot find Chrome binary

        at Object.startWebDriverSession (/opt/atlassian/pipelines/agent/build/node_modules/webdriver/build/utils.js:68:15)

        at processTicksAndRejections (internal/process/task_queues.js:97:5)

Any help to fix this will be very helpful.

Thanks in Advance

Sanju


Answers:
author: Noah Di Gesu
body: Have you found a solution ? :)


Tags: bitbucket-pipelines

cloud
Bitbucket Account deactivated
Asked by mikebalmes:

Hi,

1. A while ago my account was not able to access even until now. What should I do. Im always push some script to my account but right now for some reason I was not able to retrieve and said it was deactivated. Can you checknit for me, i really desperate to retrieve those file. It waa under this email, \<email removed for security reasons\>. looking forward to hear from you.


Answers:
author: Caroline R
body: Hi, [@mikebalmes](/t5/user/viewprofilepage/user-id/24165)!

Thank you for reaching out to Atlassian Community!

I checked your Bitbucket account and confirmed this is active, so you should be able to access this. Could you please try to log in using the following link?

* [https://bitbucket.org](https://bitbucket.org/)

If you don't remember your password, you can access the following page and reset it:

* <https://bitbucket.org/account/password/reset/>

You mentioned you tried to push some scripts to your account, but you received a message saying it was deactivated. Could you please share the command you ran and the output you received? Were you trying to push this to a repository you own or to another workspace?

Please, feel free to share any additional information regarding this case. Thank you.

Kind regards,  
Caroline

comments: author: mikebalmes
body: Hi Caroline,  
I try to access actually my account im login to my bitbucket account but it wa redirected to site can't be reached page?


author: mikebalmes
body: I dont know for some reason I cant login to my dashboard in bitbucket


author: Caroline R
body: Hi, [@mikebalmes](/t5/user/viewprofilepage/user-id/24165).

I confirmed that Bitbucket is operational, your account still exists and has repositories.

With that said, if you see a message saying that "the site can't be reached" when you try to access Bitbucket, it sounds like a network issue. In this case, in order to further investigate this issue, we would need some additional information from you:

* Could you try to open this page in an incognito window using Chrome?

* In case it doesn't work, could you please run the following commands and share the output here:

```
ping bitbucket.org
```

```
traceroute bitbucket.org
```

* Try using a different computer or even a phone in the same network, to find out if the problem is perhaps specific to the machine;

* If the above also doesn't work, try using a different network with the same machine to understand if the network is the problem.

Looking forward to hearing from you.

Kind regards,  
Caroline


Tags: bitbucket-cloud

cloud
Default labels
Asked by Brad Vrabete:

When using BitBucket in conjunction to Jira, creatig a branch name from a JIRA ticket might exceed the 63 character limit of a Kubernetes label. Could the atlassian/aws-eks-kubectl-run be updated to truncate long branch names and make sure the labels are valid for Kubernetes?


Answers:
author: Igor Stoyanov
body: Hi [@Brad Vrabete](/t5/user/viewprofilepage/user-id/4061397) . Thanks for your question. We will discuss with the team this case.   
Unfortunately, i am not sure about automatic truncation of the branch. Instead maybe we will add validation or warn users in readme about character limit and provide your solution from this thread:  

```
script:
  # shrink bitbucket branch name to less than 63 characters
-branch="${BITBUCKET_BRANCH}"
  - export BITBUCKET_BRANCH=${branch:0:62}
  - pipe: atlassian/aws-eks-kubectl-run:2.1.0 ?
```

<br />

Regards, Igor.

comments: author: Brad Vrabete
body: That is a label, metadata. These longer label are automatically generated by a Jira based workflow, not manually and they are a truncation of the Jira ticket name. Ideally they should not be generated that long.   

In any case, I will be truncating branch names before applying the kubectl command.


Tags: aws

bitbucket-pipelines

cloud

kubernetes
Getting an error when pushing to a repo on Bitbucket v7.6.9
Asked by Obss Sysadmin:

Hello,

There are 4 different folders in a folder and files in them.  
sample content  
folder/  
folder/folder1/test.py  
folder/folder1/README.md  
folder/folder1/metafile.yml  
folder/folder2/test.py  
folder/folder2/README.md  
folder/folder2/metafile.yml

If I upload the files one by one, there is no problem, but when I try to upload them all at once, I get the following error.

$ git push origin test_push  
Counting objects: 123, done.  
Delta compression using up to 16 threads.  
Compressing objects: 100% (57/57), done.  
Writing objects: 100% (123/123), 116.73 KiB \| 116.73 MiB/s, done.  
Total 123 (delta 78), reused 110 (delta 65)  
remote: usage: git index-pack \[-v\] \[-o \<index-file\>\] \[--keep \| --keep=\<msg\>\] \[--verify\] \[--strict\] (\<pack-file\> \| --stdin \[--fix-thin\] \[\<pack-file\>\])  
error: remote unpack failed: index-pack abnormal exit  
To ssh://[bitbucket-local.com:7999/test/test.git](http://bitbucket-local.com:7999/test/test.git)  
! \[remote rejected\] test_push -\> test_push (unpacker error)  
error: failed to push some refs to 'ssh://[git@bitbucket-local.com:7999/test/test.git](http://git@bitbucket-local.com:7999/test/test.git)

Bitbucket logs  
Git hooks have not been called. Please verify that the hooks are configured correctly - see [confluence atlassian / display/BITBUCKETSERVERKB/Git+hook+scripts+are+not+executing?utm_campaign=in-app-help\&utm_medium=in-app-help\&utm_source=stash](https://confluence.atlassian.com/display/BITBUCKETSERVERKB/Git+hook+scripts+are+not+executing?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash) for details

I tried almost all the solutions on the internet but I couldn't find the solution. What steps should we take to fix this error?  


Answers:
author: John Lawlor
body: Are you able to access the logs on the Bitbucket server? Can you post the log here?


Tags: bitbucket-server

server
How to enable merge checks to make JIRA ID mandatory in description for each Pull Requests
Asked by vaski nath:

Hi All,

I am trying to setup Merge Checks for my specific bit bucket project so that any pull request which is getting raised should have valid JIRA ID reference.

I found few documentation but its not very clear.

hence, is there a way to require jira issue keys for pull requests only and not for every commit?

Regards

vaski


Answers:
author: Ulrich Kuhnhardt _IzymesCo_
body: Hi Vaski,

obviously the built-in merge-checks can't do what you need. You can follow steps [on the documentation page](https://confluence.atlassian.com/bitbucketserver/checks-for-merging-pull-requests-776640039.html#Checksformergingpullrequests-Addanewmergecheck) by adding a merge check by way of adding an app. Some of them are free like "Better Commit Policy for Bitbucket" and you can configure the merge check once it is installed.

I personally haven't tried them out - so I don't know which one exactly fits your requirements.

Hope that helps,

Kind regards, Ulrich

[www.izymes.com](http://www.izymes.com)


author: Levente Szabo _Midori_
body: Hi [@vaski nath](/t5/user/viewprofilepage/user-id/4575621)

As [@Ulrich Kuhnhardt _IzymesCo_](/t5/user/viewprofilepage/user-id/4011392) mentioned, (thank you!), the [Better Commit Policy apps](https://marketplace.atlassian.com/search?query=better%20commit%20policy) are dedicated apps for commit verification. By keeping all commits to your custom standards, you can make sure that all commits that end up in your Bitbucket repository have a Jira issuekey reference - or comply to even more rules!

You can start learning about [Better Commit Policy for Bitbucket in the documentation](https://www.midori-global.com/products/better-commit-policy-for-bitbucket/server/documentation?utm_source=cac&utm_medium=cac-comment&utm_campaign=gh).

This app is basically a connector for the main app, [Better Commit Policy for Jira](https://www.midori-global.com/products/better-commit-policy-for-jira/server/?utm_source=cac&utm_medium=cac-comment&utm_campaign=gh), so you need both apps installed to implement your commit check policy and rules.

In case you have any questions, or run into any problems, [reach out to us anytime!](https://midori.zendesk.com/hc/en-us/requests/new)


Tags: bitbucket-server

server
How I can GET a group on a repository by API ?
Asked by phongtd:

I follow this document: <https://support.atlassian.com/bitbucket-cloud/docs/group-privileges-endpoint/> and GET a group on a repository (I have full access to bitbucket API), but I have a problem when I insert group_owner to this API URL :   
<https://api.bitbucket.org/1.0/group-privileges/{workspace_id}/{repo_slug}/{group_owner}/{group_slug>}

After I GET (I use PostMan for call API), the response always I received result: 400 Bad request and Group is not owned by the workspace.

Please help me where I find group_owner and what I need to insert.  
Warm Regards.


Answers:
author: Theodora Boudale
body: Hi [@phongtd](/t5/user/viewprofilepage/user-id/4569797) and welcome to the community.

The {group_owner} should be the Bitbucket UUID of the account/workspace that owns this group.

You can find the info the following way:

If you make a call to

```
https://api.bitbucket.org/1.0/group-privileges/{workspace_id}/{repo_slug}
```

you will get info for all groups with access to this repo. For each group in the output of the above call, you will see the following fields:

```
"group": {
    "owner": {
        "display_name": "some-name",
        "uuid": "{7914a899-371g-0968-t2w3-6317b0936b6e}",
.........
```

<br />

The **uuid** above is what you need to use for {group_owner} in the call you want to make. You may also need to encode the curly brackets around the UUID, in this case **{** should be replaced with **%7B** and **}** should be replaced with **%7D**

An example URL using the UUID I gave above would be

```
https://api.bitbucket.org/1.0/group-privileges/my-workspace/test-repo/%7B7914a899-371g-0968-t2w3-6317b0936b6e%7D/developers
```

I would also suggest testing the call with curl as well.

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

Kind regards,  
Theodora

comments: author: phongtd
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086)

I have rechecked, it works well with your answer, and when I input lower-key in [{group_slug](https://api.bitbucket.org/1.0/group-privileges/%7Bworkspace_id%7D/%7Brepo_slug%7D/%7Bgroup_owner%7D/%7Bgroup_slug)}.

Thanks for helping me, I was able to use it. :D  
Warm Regards.


author: Theodora Boudale
body: Hi [@phongtd](/t5/user/viewprofilepage/user-id/4569797),

Thank you for the update and you are very welcome, I'm glad to have helped!

Kind regards,  
Theodora


author: Ulrich Kuhnhardt _IzymesCo_
body: Hi - even though I don't know the answer I suggest you also post your question in the bitbucket cloud developer forum <https://community.developer.atlassian.com/c/bitbucket-development/bitbucket-cloud/13>

Best, Ulrich

[www.izymes.com](http://www.izymes.com)

comments: author: phongtd
body: Hi [@Ulrich Kuhnhardt _IzymesCo_](/t5/user/viewprofilepage/user-id/4011392) ,

Thanks for suggesting me.  
Warm Regards.


Tags: api

bitbucket-cloud

cloud

group

integration

permission
Remote branch tracking in Windows vs Mac
Asked by bryce33:

I notice that in the Windows version when I right-click a branch and hover over 'Track remote branch' the None option is always checked. When I change the remote branch to track then look again, None is still checked. In the Mac version the branches are checked as you would expect them to be. Is this correct or is this a bug in the Windows version?


Answers:
author: stevestreeting
body: This works fine for me, but it looks like there may be a refresh issue when you change the tracking branch. I had to manually F5 to make the checkbox change position after I changed the tracking branch. Otherwise the tracking branch always shows the correct branch for me.

comments: author: stevestreeting
body: Logged: <https://jira.atlassian.com/browse/SRCTREEWIN-667>


author: Caleb Evans
body: I know this is very old but I have this same issue (is it an issue? It confused me for a while anyway). I am unable to get the correct remote branch to be ticked even after a refresh. Works fine on my mac.
Pull a certain branch only
Asked by hgierer:

Using the mercurial command line I can do the following to pull a certain remote branch into my project (leaving out all the other branches that may exist there):

```
hg pull -b default http://macserver.cellent.int:8000/scs/
```

Is there a way to do the same with SourceTree ?

No matter what I tried so far, I always got the complete remote project pulled over - including all branches. I even tried to select the branch in the advanced pull options with no effect.


Answers:
author: KieranA
body: Hi Heiko,

You're right, for some reason it's not honouring that preference when it should be. I've logged it in JAC here: <https://jira.atlassian.com/browse/SRCTREE-1672>

Many thanks


author: KieranA
body: Just to follow this up, the branch selection won't actually work because you're using the fetch extension. It's still a bug on our part as we shouldn't allow branch selections if you're using the fetch extension. I've disabled the option is the fetch extension is being used from this screen.

Cheers


author: hgierer
body: Tried it on a Mac !


author: KieranA
body: Is this for Windows or Mac?
Fetch then merge
Asked by D K:

Hi,

How do I fetch origin/develop then view differences with develop and then merge to develop?


Answers:
author: KieranA
body: Hi D K,

If you've fetched the changes then they're already visible in the log view, so you could see the diffs there. You can also right click on a file and hit "Log selected", and in 1.6 you can log on multiple files if you wish.

If you hit "Merge" in the toolbar there's a second tab "Merge fetched" which you can use to merge the fetched changes.

Hope that helps
SourceTree: how to create subrepositories?
Asked by YU FENG:

I am new in bitbucket and SourceTree. Here is my question:

How to create subrepositories in using ScouceTree?

Thanks !!


Answers:
author: KieranA
body: Hi Yu Feng,

You don't create subrepositories in SourceTree but add existing repositories. To add them, just context-click in the sidebar, or go to the "Repository" menu and hit "Add Subrepository" and then select the repository you want as a subrepository whether it's local or remote. Then you specify the local relative path, this is just where it will be within your project.

Hope that helps
How to remote set-url origin in SourceTree?
Asked by Lee Whitney:

Sorry for the dumb question - I'm trying to do the example below in SourceTree to setup a GitPages site. I think I have completed the first two lines ok.

How would I perform the third line (remote set-url) with SourceTree?

Thanks for the help -

    $ git clone https://github.com/plusjade/jekyll-bootstrap.git USERNAME.github.com $ cd USERNAME.github.com $ git remote set-url origin git@github.com:USERNAME/USERNAME.github.com.git $ git push origin master


Answers:
author: Johannes Kilian
body: You can do it with following steps:

![](http://imageshack.us/a/img703/6884/j0w9.png)

![Source - Add Remote Repository Paths](http://imageshack.us/a/img818/9127/dpl.png)

BTW: Tag your question with "Sourcetree" - so it get's the right focus within "answers.atlassian.com" (I just have seen your question accidently ...)

comments: author: Dan Pidcock
body: what steps?


author: Johannes Kilian
body: ?

Open SourceTree ...

Select "Repository Settings" from "Repository" menu as shown above ...

Press the "Add" button in the "Repository Settings" dialog box and enter appropriate data ...

That's it!


author: Dan Pidcock
body: Thanks that does it. For some reason there are no steps show for me, all I can see is as shown in the attached screenshot!![](../../upfiles/origin-sourcetree.png)

Probably because imageshack is blocked by many corporate IT departments...


author: Johannes Kilian
body: Sry about this - glad you found it with my short instructions


author: Johannes Kilian
body: Sry - didn't know about that ...

Glad you found it with my short instructions


Tags: git

github

url
Did SourceTree drop Mercurial support?
Asked by Ivan Mi:

At the page <http://www.sourcetreeapp.com/> there is confusing information about SourceTree. The title says that it's "A free **Git** client for Windows or Mac" but below there it's said "use the full capability of Git and **Mercurial** in the SourceTree desktop app". I've downloaded the SourceTree app and I see that it does not have Mercurial functions. So do I understand right that they dropped Mercurial support?


Answers:
author: KieranA
body: Hi Ivan,

Mercurial support for Windows is coming in version 1.0 which is *very* soon. The wording was just to cover the Mac mainly - there's been some confusion around this sentence. Mercurial support has always been planned for the Windows version.

Look out for version 1.0 for Windows which will definitely include Mercurial support.

Hope that helps

comments: author: Ivan Mi
body: Thank you for the answer!
Keep getting "A new version of SourceTree is now avail..."
Asked by chadrickm:

I download the new file and run it and get the same screen each time. The installer (SourceTreeSetup_0.9.4.exe) gives me three options \[Modify, Repair, Remove\] and I've tried both Modify and Remove. After removing the app I Installed it again. It still tells me a new version exists each time I open it up. Feels like I'm stuck in Groundhog Day.


Answers:
author: stevestreeting
body: Only the old version 0.9.2.3 has this prompt and it's meant to prompt you to move across to the [new installer](http://blog.sourcetreeapp.com/2013/05/13/new-installer-updater-for-sourcetree-for-windows/), which is the SourceTreeSetup_0.9.4.exe you have. If you have the 'Modify / Remove / Repair' prompt it means the new version is installed. However as the blog linked above points out, because of the installer tech change the new version installs in parallel with the old ClickOnce install, so probably the shortcut you're running is still the old one.

Please uninstall the old ClickOnce version as discussed in the blog and run the new version, the shortcut should be in Start Menu \> Applications \> Atlassian \> SourceTree \> SourceTree.exe

Apologies for the confusion, so far we haven't found a clean way to automatically uninstall the old ClickOnce system, but will try to improve that.
sourcetree osx diff program issues
Asked by Eric LW:

I can't update my external diff program, I downloaded DiffMerge but when I go into sourcetree preferences \> diff, it just has filemerge greyed out, I can't change anything and I can't use Diff Merge conveniently. Help?


Answers:
author: KieranA
body: Hi Eric,

This is most likely because you've got the "Allow SourceTree to modify your global Mercurial and Git configuration files" option disabled in the "General" tab of the SourceTree preferences as shown here:

![](http://i.imgur.com/b1iKY2P.png)

If this is disabled you can't modify your diff prefs because you won't be able to modify your global configuration. Enabling this option will allow you to change your preferences.

Hope that helps


Tags: diff