youngmon/atlassian-qna huggingface dataset:
Is there a way to have local variables for bitbucket pipelines within a step?
Asked by Paul Helter:

I'm wondering if there is a way to do:  

\`\`\`yaml  
definitions:  
scripts:  
- script: \&echo_script  
- echo ${MESSAGE}  
pipelines:  
default:  
- step: \&my_step1  
name: Test1  
local_variables:  
- MESSAGE="I want my bitbucket-pipelines.yaml to Don't-Repeat-Yourself (DRY)"  
script:  
\<\<: \*echo_script  
- step: \&my_step2  
name: Test2  
local_variables:  
- MESSAGE="This would allow me to do this"  
script:  
\<\<: \*echo_script
\`\`\`  

Expected output for a run is:  
\`\`\`  
Test1 : "I want my bitbucket-pipelines.yaml to Don't-Repeat-Yourself (DRY)"  
Test2 : "This would allow me to do this"  
\`\`\`  
Thanks  


Answers:
author: Patrik S
body: Hello [@Paul Helter](/t5/user/viewprofilepage/user-id/3061892) ,

Thank you for reaching out to Atlassian Community!

I'm afraid that at this moment it's not possible to define environment variables at step level. We already have a feature request to implement that functionality, though :

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

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

While this feature is not implemented, a workaround-ishy way of having different values for the same variable is to [define different deployment environments](https://support.atlassian.com/bitbucket-cloud/docs/set-up-and-monitor-deployments/#Step-1--Define-your-environments) , create the [deployment variables](https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/#Deployment-variables) in each deployment environment, and then assign a different deployment to each step, like the below example :

```
pipelines:

  default:

    - step:

          name: Deploy to Test

          deployment: env1

          script:

             - echo $DEPLOYMENT_VARIABLE

    - step:

          name: Deploy to Test

          deployment: env2

          script:

             - echo $DEPLOYMENT_VARIABLE
```

So, although the environment variable name is the same, you can set different values to it for each deployment environment.

Hope that helps! Let me know if you have any questions.

Thank you, [@Paul Helter](/t5/user/viewprofilepage/user-id/3061892) .

Kind regards,

Patrik S


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
Database query for list of Groups in Bitbucket
Asked by Krishna Kumar Yadav:

Hi,

Kindly share database query for list of all Groups in Bitbucket.


Answers:
author: Ulrich Kuhnhardt _IzymesCo_
body: Hello [@Krishna Kumar Yadav](/t5/user/viewprofilepage/user-id/4986754) - welcome to the community.

what type of groups are you after?

1. Bitbucket server pull request reviewer groups (available in repository/project settings) - <https://docs.atlassian.com/bitbucket-server/rest/7.21.0/bitbucket-rest.html#idp393>

2. Bitbucket user directory groups? - <https://docs.atlassian.com/bitbucket-server/rest/7.21.0/bitbucket-rest.html#idp2>

Let me know if that answers your question.

Best, Ulrich

[Izymes](https://marketplace.atlassian.com/vendors/1210584/izymes-pty-ltd) // Eliminate boring from work


Tags: bitbucket-server

server
aws-codedeploy integration
Asked by amrsalah944:

The BUNDLE_TYPE option is not working, I passed it tar, but when bitbucket calls codedeploy it pass it as zip

There is a bug in the pipe.py file, That if statement is wrong

if self.get_variable('BUNDLE_TYPE') in \['zip', 'tar', 'tgz'\]:  
deploy_parameters.update({'fileExistsBehavior': self.get_variable('FILE_EXISTS_BEHAVIOR')})

<https://bitbucket.org/atlassian/aws-code-deploy/src/master/>


Answers:
author: Oleksandr Kyrdan
body: Hi [@amrsalah944](/t5/user/viewprofilepage/user-id/4958447)

Thank you for your question!

It would be nice if you provide us your bitbucket-pipelines configuration to investigate the issue you reported.

Best regards,  
Oleksandr Kyrdan

comments: author: amrsalah944
body: Hi [@Oleksandr Kyrdan](/t5/user/viewprofilepage/user-id/2885705)  
Thanks for your reply!  
my pipeline file is as below  
pipelines:  
branches:  
dev:  
- step:  
deployment: test  
script:  
- pipe: atlassian/slack-notify:2.0.0  
variables:  
WEBHOOK_URL: $SLACK_WEBHOOK_URL  
MESSAGE: 'Deployment to CRM-DEV initiated. All others will be paused until deployment complete.'  
- tar -cf application.tar .

- pipe: atlassian/aws-code-deploy:0.2.5  
variables:  
BUNDLE_TYPE: "tar"  
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION  
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID  
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY  
APPLICATION_NAME: $APPLICATION_NAME_DEV  
S3_BUCKET: $S3_BUCKET_DEV  
COMMAND: 'upload'  
ZIP_FILE: 'application.tar'  
region: us-east-2  
DEBUG: 'true'  
- pipe: atlassian/aws-code-deploy:0.2.5  
variables:  
BUNDLE_TYPE: "tar"  
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION  
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID  
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY  
APPLICATION_NAME: $APPLICATION_NAME_DEV  
DEPLOYMENT_GROUP: $DEPLOYMENT_GROUP_DEV  
S3_BUCKET: $S3_BUCKET_DEV  
COMMAND: 'deploy'  
WAIT: 'true'  
region: us-east-2  
IGNORE_APPLICATION_STOP_FAILURES: 'true'  
FILE_EXISTS_BEHAVIOR: 'OVERWRITE'  
DEBUG: 'true'  
- pipe: atlassian/slack-notify:2.0.0  
variables:  
WEBHOOK_URL: $SLACK_WEBHOOK_URL  
MESSAGE: 'Deployment to CRM-DEV is live.'  
-------------  
even the var is exported, but the aws command end like that  
--env=BUNDLE_TYPE="tar" \\  

++ aws deploy create-deployment --application-name web-dev --deployment-group CodeDeploy1 --revision 'revisionType=S3,s3Location={bucket=xxx-web-dev,bundleType=zip,key=web-dev-xxx}' --ignore-application-stop-failures --file-exists-behavior OVERWRITE


author: Oleksandr Kyrdan
body: Hi [@amrsalah944](/t5/user/viewprofilepage/user-id/4958447)

Thank you for your question!

Looks like you try to use outdated (***0.2.5*** ) pipe's version with a new (***1.1.1***) parameters:

Currently the latest pipe's version is **1.1.1**:

```
script:  - pipe: atlassian/aws-code-deploy:1.1.1    variables:      COMMAND: 'upload'      APPLICATION_NAME: 'my-application'      ZIP_FILE: 'myapp.zip'
```

Support for variable BUNDLE_TYPE has started since version 0.3.0. And it's always good idea to update the pipe to the latest version that includes new features, fixes, upgrades.  

Best regards,  
Oleksandr


Tags: aws

aws-codedeploy

bitbucket-cloud

cloud
all repo and ssh key are missing
Asked by chan tom:

when i logon the web portal, i found all repo are missing

but i still can push the commit


Answers:
author: Ben
body: Hey Chan,

Welcome to the Bitbucket Cloud Community!

I would suggest performing the following command to view your list of configured remote connections and comparing these with the workspaceID that you are logged in to within the UI:

```
git remote -vvv
```

It is likely that you have entered a different email address that is not associated with the workspaceID for the repository that you are pushing to, and therefore you have instead signed up to Bitbucket Cloud using this email address and therefore have created a new empty workspace.

I would suggest verifying the workspaceID that you are pushing to ie workspaceID/repositoryslug and logging in to this workspace instead with its associated email address.

Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Cannot add deployment config environment variable
Asked by Carlos Pat?n:

I am not able to create variables for the environments we have in different repositories.

The request we are doing is like the following:

curl --location --request POST '<https://api.bitbucket.org/2.0/repositories/:workspace/:repo_slug/deployments_config/environments/:environment_uuid/variables>' \\  
--header 'Content-Type: application/json' \\  
--header 'Accept: application/json' \\  
--header 'Authorization: Basic thisisatest3czo5RGZWR1d5cjZDbYTU0Nw==' \\  
--data-raw '{  
"key": "name",  
"value": "test"  
}'

environment_uuid is encoded with the '{' and '}', like this: "  
%7B12fa2ce1-5c4c-4f92-b250-9c557e6096ef%7D"

it's always returning a 404 error.

The same request, GET, is working as expected returning the list of variables.

Any clue?

Thank you


Answers:
author: Ben
body: G'day Carlos!

Welcome to the Bitbucket Cloud Community! :)

Your API request is almost correct, however, you need to also have the "secured" property present as false or true ie:

```
"key": "name",
"value": "test",
"secured": false?
```

When running the command from my end successfully, my request looked like this (I have used --user instead of header as you can just copy and paste your App Password directly without encoding it):

```
curl --request POST \
--url https://api.bitbucket.org/2.0/repositories/{workspaceID}/{reposlug}/deployments_config/environments/%7B{Environment_UUID}%7D/variables \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--user Username:AppPassword \
--data '{
"key": "hello",
"value": "test",
"secured": true
}'
```

Try this and let me know how it goes.

Cheers!

- Ben (Bitbucket Cloud Support)

comments: author: Carlos Pat?n
body: Thank you very much for the help. It now works :)


author: Ben
body: Hey Carlos,

No worries! Glad to know that this has helped you out :)

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Pane to left of build monitor window in Pipelines is missing
Asked by Tony Edward:

Hi,

In the data-test=result-page div, data-is-fullscreen="true" on the elements page in my browser. This results in the panel that hase the rerun button on it being covered buy the build progress window.

How can I have this so it is set to data-is-fullscreen="false".

This only happens in 1 particular pipeline so there must be some setting that i am not aware of.


Answers:
author: Tony Edward
body: Doh.

Found the answer.

It was the expand/collapse on bottom right corner of build window.


Tags: bitbucket-cloud

cloud

layout
HomeBrew Git update always breaks SourceTree
Asked by Yvo:

SourceTree is a great product, but there's one thing that is really annoying. I have Git installed using HomeBrew. When I update Git (because of a brew update), the next time I start SourceTree, I get the following error:

![Screen Shot 2017-06-06 at 3.50.13 PM.png](/t5/image/serverpage/image-id/1911i95F5C3090B46FC72/image-size/large?v=v2&px=999 "Screen Shot 2017-06-06 at 3.50.13 PM.png")SourceTree suddenly has no clue where my System Git is installed. This problem is probably caused by the fact that Homebrew uses symbolic links in /usr/local/bin that point to Git versions in the Cellar folder.

Now every time Git is updated (which is quite often), I have to click away a few error dialogs and go to Preferences and reselect my System Git location.

It would be great if SourceTree could be a bit smarter in handling HomeBrew Git installations.

Thank you.


Answers:
author: kachkaev
body: Please fix this bug, it should be pretty straightforward. ?  

I've been using SourceTree and Homebrew for years. Every time I run \`brew upgrade\`, I see a ton of errors in SourceTree and this is very demotivating. Steps to mitigate the errors are time-consuming and pretty dull -- I have to open SourceTree Preferences, go to 'git' tab, press 'Use System Git', press 'OK', press 'Use System git-lfs\`, press 'OK', close preferences and finally hit cmd+R in every opened SourceTree window. Doing so is necessary every couple of weeks, with every new git update coming from Homebrew.  

As a developer who's primary IDE is VSCode, I'm beginning to think of using it as my git client every time error modals in SourceTree are thrown in my face ?


author: johnbolliger
body: I figured out a manual but hopefully permanent fix.

If you manually edit the com.torusknot.SourceTreeNotMAS.plist file under \~/Library/Preferences/com.torusknot.SourceTreeNotMAS.plist.

set the gitCustomPath key to

/usr/local/bin/git

this will make it resolve properly on startup

I believe the issue comes from the file selector and not something internal in sourcetree.


author: Daniel
body: I've got this problem, too. In my opinion SourceTree should be able to follow the symlink from /usr/local/bin/git


Tags: error

git

homebrew

update
Why does 2.0.20.1 keep asking to update to 2.1.2.4
Asked by Zeke Leventhal-Arnold:

Our company upgraded to version 2.0.20.1 of source tree recently. For my installation, whenever I open it, I get a dialog stating "Update '2.1.2.4' is available. Do you wish to update?" Even though I click No, the message appears every time I open the program.

Our company policy is to keep all of the developers on the same version. How can I stop it from asking?


Answers:
author: Sean Winstead
body: I work with Zeke. More information: We are running on Windows and nobody else on the team is prompted to install this upgrade.

Is 2.1.2.4 even available for Windows? I thought it is a Mac-only version.

Sean
SourceTree Upgrade or Not?
Asked by Mark Benningfield:

Right now I'm running SourceTree 1.9.10.0 and it has worked flawlessly. No problems at all. Back and forth to BitBucket smooth as butter.

I keep getting a prompt to upgrade, but from looking over the forums, I'm thinking it would be better to just shut off the upgrade notification.

It looks like uninstalling SourceTree on Windows is a serious PITA, if not outright impossible. I'm guessing a major version upgrade would require me to uninstall the previous version.

Also, it looks like most of the hits for upgrade questions are about how to downgrade again. Again, the version I have works fine. I don't want to trade that for a buggy, untested POS.

Should I just leave well enough alone? How does the newest version compare to 1.9 ?

Thanks for any advice.


Answers:
author: Dwight Holman
body: If you have not yet tried the new version, the new version has a very different UI/UX. This apparently provides better performance for some users, but for users regularly working with more than a handful of Repos the new version is a step backwards IMHO.

My advice would be if you are happy with v1.9 you might not appreciate v2.x.

A couple of open usability issues on the new version:

<https://jira.atlassian.com/browse/SRCTREEWIN-7176>

<https://jira.atlassian.com/browse/SRCTREEWIN-7242>

comments: author: Mark Benningfield
body: @Dwight - Thanks for the answer. I had previously looked over some of the screenshots of the new version, and I guess it's prettier, as far as that goes. I suspect the ST dev team has drunk the KoolAid. I think I will stick with v1.9.


author: minnsey
body: The upgrade from 1.9.10.0 is to 1.9.13.7 the last of the 1.x releases.  

1.9.13.7 only adds a prompt informing you that this is the last upgrade to 1.x and its upgrade channel.  

As of 1.10 SourceTree switched to using Squirrel.Windows for installations and there is no automatic transition.  

For what its worth if you stick on 1.9.x please make sure you switch to using a System Git install \>= v2.12.0 as this removes a remote execution security issue in 1.x versions of SourceTree using older versions of Git.
Any plans to support git-subrepo?
Asked by Israel Lins Albuquerque:

Talking about this: [git-subrepo](https://github.com/ingydotnet/git-subrepo)


Answers:
author: jyo
body: Hi Israel,

We do have a feature request for this, but as far as I know, I don't believe it is on our roadmap quite yet: <https://jira.atlassian.com/browse/SRCTREEWIN-5489>

I'd recommend following the above issue for more updates!

Cheers,

Jesse

comments: author: Israel Lins Albuquerque
body: Thanks you!


author: Israel Lins Albuquerque
body: Can you open for Mac version too?


Tags: git

repository
Where can I find documentation to SourceTree options?
Asked by SaSa:

In the SourceTree options window there are some options whose meaning is not clear for me:

1. Use this version of SourceTree for URI association
2. Automatically clean up custom dictionary files.
3. Don't prompt about the new SourceTree installation.

Is there a documentation for SourceTree options or can you explain these options to me please?


Answers:
author: minnsey
body: Hi

* Use this version of SourceTree for URI association

This associates the 'sourcetree://' URI scheme with the SourceTree.exe in the local registry, thei allows you to use the 'Clone in SourceTree' option from <https://bitbucket.org>' and have it automatically open your local SourceTree install.

* Automatically clean up custom dictionary files.

There is a bug in MS WPF where references to deleted custom dictionary files remain. Since SourceTree makes use of the custom dictionary/spell checkign functionality it can significantly slow downloading the File Status view for commits if WPF is searching for deleted custom dictionary files. That option tells SourceTree to remove references from the registry for non-existent custom dictionary files.

* Don't prompt about the new SourceTree installation.

SourceTree automatically checks for updates, that option disables that automatic checking.

comments: author: SaSa
body: Thanks for the explanation!
Is git file change monitoring broken ? It surely looks so!
Asked by iongion:

In the new SourceTree, there is a serious issue with file monitoring whenver I start VSCode, Sublime or Atom, changed files just appear and dissappear erratically, not giving enough time to check the ones for the commit.

Not only this, but sometimes I commit considering all changes were included, only to find out that 2-3 new files appear again.

This really makes SourceTree unreliable, I have made a recording here

<https://community.atlassian.com/t5/SourceTree-discussions/Visual-Studio-Code-conflict/td-p/586917>

What can it be ? These editors usually have built-in git functionality, maybe there is a conflict, but no such conflict appears in GitTower or GitKraken, the other two SCM IDEs I have tried.


Answers:
author: jyo
body: Hi Ionut,Under the General preferences, can you try and disable "Automatic file refresh on file change" and uncheck the "refresh when app is in background"?Thanks,Jesse


author: Mike Corsaro
body: Hello! Due to how most IDEs work (lots of file writing...), I highly recommend that you disable "refresh automatically when files change" via the Options menu. Also, uncheck the "refresh when app is not in focus" so that SourceTree will automatically refresh when it regains focus.


author: iongion
body: Thanks guys, I did that and it appears not to wobble again! That is great!

But please know that previous SourceTree **never had this issue** and as explained above, others do not have it either, there must be something changed wrongfuly with new SourceTree file watching.
Issue with source tree install
Asked by Dex Ezekiel:

I am trying to download and install sourcetree on my machine and when i download it, it is becoming a .1496043752 file type for some reason instead of a .exe...

any clue why this is and how to get around it??

it is getting downloaded as "SourceTreeSetup-2.0.20.1.1496043752"


Answers:
author: Ana Retamal
body: Hi Dex! Are you downloading it from our [official site](https://www.sourcetreeapp.com/)? I've just tried downloading it and the file downloaded was "SourceTreeSetup-2.0.20.1.exe".

Have you also tried a different browser or computer? Let us know if the issue persists!

Regards,

Ana

comments: author: Dex Ezekiel
body: Hi Ana,

Yes that is where i am downloading it from and the extension it is trying to download it as is the .1496043752 i mentioned earlier :o

kind regards,

Dex


author: Dex Ezekiel
body: I just tried downloading it with Google Chrome and it downloaded as a .exe however i am now getting the issue saying "Installation has failed" "Failed to extract installer"

i was previously trying to download it with Internet Explorer.

kind regards,

Dex


author: Dex Ezekiel
body: I have now tried it on other Machines and it is having the exact same issue.

any idea??

is the installer broken?

regards,

Dex


author: Ana Retamal
body: Hi Dex, I've tried the same installer and I can confirm is working on my machine, so there must be something in your computer avoiding the installation to go through. Can you provide the following information?:

* Is there something atypical in your computer, like for example, are you in a corporate environment?
* Do you have any specific security configuration?
* Can you find the Squirrel setup log at C:\\Users\\\<username\>\\AppData\\Local\\Atlassian\\SourceTree\\ Does it exist? What does it say?
* Is there anything showing in the Event Viewer?
* Can you share with us the same installer you're using, so we can try and reproduce the issue?

Best regards,

Ana
Temporary files
Asked by Leo Zillo:

Is it possible to disable $TMPDIR usage completely in Sourcetree?

If not, is it possible to disable the preview pane completely?

When you choose a commit sourcetreeapp retrieves the complete files from it, stores them in temp dir, and it's rather slow (the app stalls), even if you disabled diff for the filetype in settings (as suggested in another post).

I don't want to have my repo files randomly spread in the temporary directory either.

Also, can't seem to select External diff utility, and the default (greyed out) doesn't seem to work. Is there a catch to that?

I am also assuming that when doing a diff with FileMerge (the default), sourcetreeapp also create temporary files for that operation?

Thanks


Answers:
author: bgannin
body: Hi Leo,

That's not currently possible. Please file a ticket on <https://jira.atlassian.com/browse/SRCTREE> with details on your request and workflow for us to review and prioritize.

Cheers,

Brian Ganninger  
Senior Mac Developer, SourceTree


author: Leo Zillo
body: <https://jira.atlassian.com/browse/SRCTREE-4787>

<https://jira.atlassian.com/browse/SRCTREE-4788>


author: Leo Zillo
body: OK, but two things:

(1) TEMPDIR is used by other apps, say Photos, that might be doing a cloud download for instance, may not want to delete everything in there.

(2) Still doesn't solve the speed issue, but I guess the only option for this is not get the files for a commit, like disabling preview completely, or having a default tab in its place for it, like file info only.


author: Leo Zillo
body: Done. Hope you can make it, would be great, love Sourcetree! :D)


author: bgannin
body: A workaround would be to create a custom action to delete $TEMPDIR and then use it in ST after you're done working.