Skip to content

Commit

Permalink
no support update, last version release
Browse files Browse the repository at this point in the history
  • Loading branch information
psadi committed Aug 27, 2024
1 parent 4eb1a35 commit 0fc7053
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 57 deletions.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/support_notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 🚨 Repository No Longer Maintained

Please be aware that this repository is no longer actively supported. I encourage you to migrate to Bitbucket Cloud for ongoing support and advanced features. Learn more [here](https://bitbucket.org/blog/cloud-migration-benefits).

If you proceed with opening this issue, please note that responses may be delayed or unavailable.
121 changes: 65 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Bitbucket CLI (bb)

Work seamlessly with Bitbucket from the command line

[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
Expand All @@ -8,26 +9,34 @@ Work seamlessly with Bitbucket from the command line

---

### **⚠️ NOTICE !!**
## 🚨 No Support Notice 🚨

**Notice:** This repository is no longer actively maintained. I recommend considering migration to Bitbucket Cloud for enhanced features and support. You can learn more about the benefits of Bitbucket Cloud migration [here](https://bitbucket.org/blog/cloud-migration-benefits).

**If you have any questions or need assistance with migration, feel free to reach out.**

## 🚨 Compatability Notice 🚨

#### **This tool is designed to work with [Bitbucket Server Edition](https://www.atlassian.com/enterprise/data-center/bitbucket) (Enterprise) and not with [Bitbucket Cloud / bitbucket.org](https://bitbucket.org/)**

The API Endpoints and the way the tool interacts with the server is different from the cloud version, hence this tool will break if used with the cloud version.

---

### DEMO

[![asciicast](https://asciinema.org/a/DzNfEhcqhLNjHUMVcTP11lnrw.svg)](https://asciinema.org/a/DzNfEhcqhLNjHUMVcTP11lnrw)

### REQUIREMENTS
### REQUIREMENTS

* [Git](https://git-scm.com/downloads)
* [Python3](https://www.python.org/downloads/) (3.7 or Higher)
* [Pip3]( https://pypi.org/project/pip/) (latest recommended)
* A write access token from bitbucket
- [Git](https://git-scm.com/downloads)
- [Python3](https://www.python.org/downloads/) (3.7 or Higher)
- [Pip3](https://pypi.org/project/pip/) (latest recommended)
- A write access token from bitbucket

---

### INSTALLATION
### INSTALLATION

<b>From Source</b>

Expand Down Expand Up @@ -57,13 +66,14 @@ docker run -it --rm -v $HOME/.config/bb:$HOME/.config/bb -v $(pwd):/app/. --netw
```

Example:

```sh
docker run -it --rm -v $HOME/.config/bb:$HOME/.config/bb -v $(pwd):/app/. --network host psadi/bbcli pr create --target master
```

---

### CONFIGURATION
### CONFIGURATION

1. Run the following command to perform initial setup, this will setup a `config.ini` under `$XDG_CONFIG_HOME/bb` respective to the OS, make sure to remove the '/` at the end of your bitbucket_host:

Expand All @@ -73,113 +83,112 @@ bb auth setup

2. Validate

* Check the config file status `bb auth status`
- Check the config file status `bb auth status`

* If the config file is setup properly, run `bb auth test` to validate
- If the config file is setup properly, run `bb auth test` to validate

* if all went well, you should get a response like this
- if all went well, you should get a response like this

```sh
> bb auth test
⠏ Validating connection with 'https://bitbucket.<company>.com'... OK
```

---

### HOW-TO?
### HOW-TO?

<details>
<summary>Create pull request</summary>

|Command|Action|
|-|-|
|`bb pr create --target master`|creates pull request and asks for confirmation|
|`bb pr create --target master --yes`|creates pull request without prompt|
| Command | Action |
| ------------------------------------ | ---------------------------------------------- |
| `bb pr create --target master` | creates pull request and asks for confirmation |
| `bb pr create --target master --yes` | creates pull request without prompt |

</details>


<details>
<summary>Show diff of files (ADD/DELETE/MODIFY & RENAME) as an overview</summary>

|Command|Action|
|-|-|
|`bb pr create --target master --yes --diff`|creates pull request without prompt and shows diff from the PR raised|
|`bb pr delete --id 1 --yes --diff`|deletes pull request without prompt and shows diff befoew PR is deleted|
|`bb pr diff --id 1`|shows diff for the given pull request id|

| Command | Action |
| ------------------------------------------- | ----------------------------------------------------------------------- |
| `bb pr create --target master --yes --diff` | creates pull request without prompt and shows diff from the PR raised |
| `bb pr delete --id 1 --yes --diff` | deletes pull request without prompt and shows diff befoew PR is deleted |
| `bb pr diff --id 1` | shows diff for the given pull request id |

</details>

<details>
<summary>Delete pull request(s)</summary>

|Command|Action|
|-|-|
|`bb pr delete --id 1`|deletes the given pull request number with confirmation prompt|
|`bb pr delete --id 1 --yes`|deletes the given pull request number without prompt|
|`bb pr delete --id 1,2,3`|deletes multiple pull requests|
| Command | Action |
| --------------------------- | -------------------------------------------------------------- |
| `bb pr delete --id 1` | deletes the given pull request number with confirmation prompt |
| `bb pr delete --id 1 --yes` | deletes the given pull request number without prompt |
| `bb pr delete --id 1,2,3` | deletes multiple pull requests |

</details>

<details>
<summary>Show pull request(s) authored/reviewer</summary>

|Command|Action|
|-|-|
|`bb pr list`|show pull requests in current repository [Default]|
|`bb pr list --author`|show pull requests authored in current repository|
|`bb pr list --author --all`|show pull requests authored in all repositories|
|`bb pr list --reviewer`|show pull requests that you are a reviewer in current repository|
|`bb pr list --reviewer --all`|show pull requests that you are a reviewer in all repositories|
| Command | Action |
| ----------------------------- | ---------------------------------------------------------------- |
| `bb pr list` | show pull requests in current repository [Default] |
| `bb pr list --author` | show pull requests authored in current repository |
| `bb pr list --author --all` | show pull requests authored in all repositories |
| `bb pr list --reviewer` | show pull requests that you are a reviewer in current repository |
| `bb pr list --reviewer --all` | show pull requests that you are a reviewer in all repositories |

</details>

<details>
<summary>Review pull request</summary>

|Command|Action|
|-|-|
|`bb pr review --id 1 --action approve`|marks the pull request as <span style="background-color:#00875a;color:white">**APPROVED**</span>|
|`bb pr review --id 1 --action unapprove`|marks the pull request as <span style="background-color:#de350b;color:white">**UNAPPROVED**</span>|
|`bb pr review --id 1 --action needs_work`|marks the pull request as <span style="background-color:#ffab00;color:white">**NEEDS WORK**</span>|
| Command | Action |
| ----------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `bb pr review --id 1 --action approve` | marks the pull request as <span style="background-color:#00875a;color:white">**APPROVED**</span> |
| `bb pr review --id 1 --action unapprove` | marks the pull request as <span style="background-color:#de350b;color:white">**UNAPPROVED**</span> |
| `bb pr review --id 1 --action needs_work` | marks the pull request as <span style="background-color:#ffab00;color:white">**NEEDS WORK**</span> |

</details>


<details>
<summary>Merge pull request</summary>

|Command|Action|
|-|-|
|`bb pr merge --id 1`|Validates pull request merge conditions and prompts for merge|
|`bb pr merge --id 1 --rebase`|adds optional rebase [Default: False]|
|`bb pr merge --id 1 --delete-source-branch`|deletes source branch after merge, [Default: False], If false will prompt for deletion|
| Command | Action |
| ------------------------------------------- | -------------------------------------------------------------------------------------- |
| `bb pr merge --id 1` | Validates pull request merge conditions and prompts for merge |
| `bb pr merge --id 1 --rebase` | adds optional rebase [Default: False] |
| `bb pr merge --id 1 --delete-source-branch` | deletes source branch after merge, [Default: False], If false will prompt for deletion |

</details>

---

### Points to Ponder
### Points to Ponder

* This utility is tested with bitbucket enterprise version 6.10.10 and 8.19
* I have personally tested it in Linux, Windows(Powershell and Command Prompt), MacOS and GIT Bash and it works flawlessly
* In case if your ID gets locked the token wont work, you may need to reset your ID (Token can remain the same)
* At times if there are frequent account lockouts, Bitbucket will prompt you to enter CAPTCHA, you may need to relogin with CAPTCHA validation in your broswer once else connection will fail
- This utility is tested with bitbucket enterprise version 6.10.10 and 8.19
- I have personally tested it in Linux, Windows(Powershell and Command Prompt), MacOS and GIT Bash and it works flawlessly
- In case if your ID gets locked the token wont work, you may need to reset your ID (Token can remain the same)
- At times if there are frequent account lockouts, Bitbucket will prompt you to enter CAPTCHA, you may need to relogin with CAPTCHA validation in your broswer once else connection will fail

---

### CREDITS
### CREDITS

[bbcli](https://github.com/psadi/bbcli) wouldn't be possible if not for the awesome open-source tools made avaiable.

A huge thanks to,

* [tiangolo/typer](https://github.com/tiangolo/typer)
* [Textualize/rich](https://github.com/Textualize/rich)
* [encode/httpx](https://github.com/encode/httpx)
* [pdm-project/pdm](https://github.com/pdm-project/pdm)
- [tiangolo/typer](https://github.com/tiangolo/typer)
- [Textualize/rich](https://github.com/Textualize/rich)
- [encode/httpx](https://github.com/encode/httpx)
- [pdm-project/pdm](https://github.com/pdm-project/pdm)

### LICENSE

<img src="https://upload.wikimedia.org/wikipedia/commons/0/06/AGPLv3_Logo.svg" width="150" height="70" />

This project is licensed under the GNU Affero General Public License v3.0 - see the [**LICENSE**](LICENSE) file for details.
2 changes: 1 addition & 1 deletion bb/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
the utility and pyproject
"""

__version__ = "0.6.2"
__version__ = "0.6.3"

0 comments on commit 0fc7053

Please sign in to comment.