Update bb how to integrate
@@ -1,127 +1,198 @@
|
|||||||
# 🔌 CI/CD Integration for Bitbucket VCS
|
# 🔌 CI/CD Integration for Bitbucket VCS
|
||||||
|
|
||||||
## 📖 Introduction
|
## 📖 Introduction
|
||||||
|
|
||||||
Manually launching and configuring the tool is quite a challenging task and requires a deep understanding of the AI service being used and the built-in operating rules. Therefore, to simplify the task, we have created pre-prepared actions for launching and updating the tool.
|
Manually launching and configuring the tool is quite a challenging task and requires a deep understanding of the AI service being used and the built-in operating rules. Therefore, to simplify the task, we have created pre-prepared actions for launching and updating the tool.
|
||||||
|
|
||||||
## 👤 1. User for review
|
## 👤 1. User for review
|
||||||
|
|
||||||
For the tool to work, you need to add a user who will perform the review. **Add user as the default reviewer for repository** if you want it to be assigned automatically, or add it manually if necessary.
|
For the tool to work, you need to add a user who will perform the review. **Add user as the default reviewer for repository** if you want it to be assigned automatically, or add it manually if necessary.
|
||||||
|
|
||||||
Use this Bitbucket user by default: `@kodobot`.
|
Use this Bitbucket user by default: `@kodobot`.
|
||||||
|
|
||||||
## 📄 2. Prepared step script for Bitbucket
|
## 📄 2. Prepared step script for Bitbucket
|
||||||
|
|
||||||
**Use the following script to integrate the tool into your Bitbucket pipelines.** All necessary improvements and integrations must be performed independently by each team. Consider using [Parallel steps](https://support.atlassian.com/bitbucket-cloud/docs/parallel-steps-in-pipelines/) in pipelines. Update your `bitbucket-pipelines.yml` file by adding the following:
|
**Use the following script to integrate the tool into your Bitbucket pipelines.** All necessary improvements and integrations must be performed independently by each team. Consider using [Parallel steps](https://support.atlassian.com/bitbucket-cloud/docs/parallel-steps-in-pipelines/) in pipelines. Update your `bitbucket-pipelines.yml` file by adding the following:
|
||||||
|
|
||||||
**AR.NET Team**
|
**AR.NET Team**
|
||||||
```yaml
|
```yaml
|
||||||
definitions:
|
definitions:
|
||||||
steps:
|
steps:
|
||||||
- step: &ai-review-step
|
- step: &ai-review-step
|
||||||
clone:
|
clone:
|
||||||
depth: full
|
depth: full
|
||||||
name: AI Code Review
|
name: AI Code Review
|
||||||
max-time: 40
|
max-time: 40
|
||||||
image: code.wynenterprise.io/docker/bitbucket-ai-review:ar
|
image: code.wynenterprise.io/docker/bitbucket-ai-review:ar
|
||||||
runs-on: [kodo]
|
runs-on: [kodo]
|
||||||
script:
|
script:
|
||||||
- |
|
- |
|
||||||
COMMIT_MSG=$(git log --format=%B -n 1 "$BITBUCKET_COMMIT")
|
COMMIT_MSG=$(git log --format=%B -n 1 "$BITBUCKET_COMMIT")
|
||||||
|
|
||||||
if [[ "$COMMIT_MSG" == *"[no ai]"* ]]; then
|
if [[ "$COMMIT_MSG" == *"[no ai]"* ]]; then
|
||||||
echo "Skip pipeline: [no ai] found in commit message."
|
echo "Skip pipeline: [no ai] found in commit message."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export VCS_ACCESS_TOKEN=$CC_KODOTOKEN
|
export VCS_ACCESS_TOKEN=$CC_KODOTOKEN
|
||||||
export ATLASSIAN_USER_EMAIL=$CC_KODOMAIL
|
export ATLASSIAN_USER_EMAIL=$CC_KODOMAIL
|
||||||
export TEAM_NAME=$CC_TEAM
|
export TEAM_NAME=$CC_TEAM
|
||||||
|
|
||||||
/pipe.sh
|
/pipe.sh
|
||||||
|
|
||||||
pipelines:
|
pipelines:
|
||||||
pull-requests:
|
pull-requests:
|
||||||
'**':
|
'**':
|
||||||
- step: *ai-review-step
|
- step: *ai-review-step
|
||||||
|
|
||||||
custom:
|
custom:
|
||||||
ai-review:
|
ai-review:
|
||||||
- step: *ai-review-step
|
- step: *ai-review-step
|
||||||
```
|
```
|
||||||
|
|
||||||
**ARJS Team**
|
**ARJS Team**
|
||||||
```yaml
|
```yaml
|
||||||
definitions:
|
definitions:
|
||||||
steps:
|
steps:
|
||||||
- step: &ai-review-step
|
- step: &ai-review-step
|
||||||
clone:
|
clone:
|
||||||
depth: full
|
depth: full
|
||||||
name: AI Code Review
|
name: AI Code Review
|
||||||
max-time: 40
|
max-time: 40
|
||||||
image: code.wynenterprise.io/docker/bitbucket-ai-review:arjs
|
image: code.wynenterprise.io/docker/bitbucket-ai-review:arjs
|
||||||
runs-on: [kodo]
|
runs-on: [kodo]
|
||||||
script:
|
script:
|
||||||
- |
|
- |
|
||||||
COMMIT_MSG=$(git log --format=%B -n 1 "$BITBUCKET_COMMIT")
|
COMMIT_MSG=$(git log --format=%B -n 1 "$BITBUCKET_COMMIT")
|
||||||
|
|
||||||
if [[ "$COMMIT_MSG" == *"[no ai]"* ]]; then
|
if [[ "$COMMIT_MSG" == *"[no ai]"* ]]; then
|
||||||
echo "Skip pipeline: [no ai] found in commit message."
|
echo "Skip pipeline: [no ai] found in commit message."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export VCS_ACCESS_TOKEN=$CC_KODOTOKEN
|
export VCS_ACCESS_TOKEN=$CC_KODOTOKEN
|
||||||
export ATLASSIAN_USER_EMAIL=$CC_KODOMAIL
|
export ATLASSIAN_USER_EMAIL=$CC_KODOMAIL
|
||||||
export TEAM_NAME=$CC_TEAM
|
export TEAM_NAME=$CC_TEAM
|
||||||
|
|
||||||
/pipe.sh
|
/pipe.sh
|
||||||
|
|
||||||
pipelines:
|
pipelines:
|
||||||
pull-requests:
|
pull-requests:
|
||||||
'**':
|
'**':
|
||||||
- step: *ai-review-step
|
- step: *ai-review-step
|
||||||
|
|
||||||
custom:
|
custom:
|
||||||
ai-review:
|
ai-review:
|
||||||
- step: *ai-review-step
|
- step: *ai-review-step
|
||||||
```
|
```
|
||||||
|
|
||||||
**C1 Team**
|
**C1 Team**
|
||||||
```yaml
|
```yaml
|
||||||
definitions:
|
definitions:
|
||||||
steps:
|
steps:
|
||||||
- step: &ai-review-step
|
- step: &ai-review-step
|
||||||
clone:
|
clone:
|
||||||
depth: full
|
depth: full
|
||||||
name: AI Code Review
|
name: AI Code Review
|
||||||
max-time: 40
|
max-time: 40
|
||||||
image: code.wynenterprise.io/docker/bitbucket-ai-review:c1
|
image: code.wynenterprise.io/docker/bitbucket-ai-review:c1
|
||||||
runs-on: [kodo]
|
runs-on: [kodo]
|
||||||
script:
|
script:
|
||||||
- |
|
- |
|
||||||
COMMIT_MSG=$(git log --format=%B -n 1 "$BITBUCKET_COMMIT")
|
COMMIT_MSG=$(git log --format=%B -n 1 "$BITBUCKET_COMMIT")
|
||||||
|
|
||||||
if [[ "$COMMIT_MSG" == *"[no ai]"* ]]; then
|
if [[ "$COMMIT_MSG" == *"[no ai]"* ]]; then
|
||||||
echo "Skip pipeline: [no ai] found in commit message."
|
echo "Skip pipeline: [no ai] found in commit message."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export VCS_ACCESS_TOKEN=$CC_KODOTOKEN
|
export VCS_ACCESS_TOKEN=$CC_KODOTOKEN
|
||||||
export ATLASSIAN_USER_EMAIL=$CC_KODOMAIL
|
export ATLASSIAN_USER_EMAIL=$CC_KODOMAIL
|
||||||
export TEAM_NAME=$CC_TEAM
|
export TEAM_NAME=$CC_TEAM
|
||||||
|
|
||||||
/pipe.sh
|
/pipe.sh
|
||||||
|
|
||||||
pipelines:
|
pipelines:
|
||||||
pull-requests:
|
pull-requests:
|
||||||
'**':
|
'**':
|
||||||
- step: *ai-review-step
|
- step: *ai-review-step
|
||||||
|
|
||||||
custom:
|
custom:
|
||||||
ai-review:
|
ai-review:
|
||||||
- step: *ai-review-step
|
- step: *ai-review-step
|
||||||
```
|
```
|
||||||
|
|
||||||
This script will run automatically when a Pull Request is created or updated. If necessary, you can start it manually via the Bitbucket interface and add additional conditions required for start.
|
**DocumentSolutions Team**
|
||||||
|
```yaml
|
||||||
> ⚠️ **Important!** All pre-built scripts include a custom `ai-review` step. Do not change this name.
|
definitions:
|
||||||
|
steps:
|
||||||
|
- step: &ai-review-step
|
||||||
|
clone:
|
||||||
|
depth: full
|
||||||
|
name: AI Code Review
|
||||||
|
max-time: 40
|
||||||
|
image: code.wynenterprise.io/docker/bitbucket-ai-review:docsol
|
||||||
|
runs-on: [kodo]
|
||||||
|
script:
|
||||||
|
- |
|
||||||
|
COMMIT_MSG=$(git log --format=%B -n 1 "$BITBUCKET_COMMIT")
|
||||||
|
|
||||||
|
if [[ "$COMMIT_MSG" == *"[no ai]"* ]]; then
|
||||||
|
echo "Skip pipeline: [no ai] found in commit message."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
export VCS_ACCESS_TOKEN=$CC_KODOTOKEN
|
||||||
|
export ATLASSIAN_USER_EMAIL=$CC_KODOMAIL
|
||||||
|
export TEAM_NAME=$CC_TEAM
|
||||||
|
|
||||||
|
/pipe.sh
|
||||||
|
|
||||||
|
pipelines:
|
||||||
|
pull-requests:
|
||||||
|
'**':
|
||||||
|
- step: *ai-review-step
|
||||||
|
|
||||||
|
custom:
|
||||||
|
ai-review:
|
||||||
|
- step: *ai-review-step
|
||||||
|
```
|
||||||
|
**Spread.NET Team**
|
||||||
|
```yaml
|
||||||
|
definitions:
|
||||||
|
steps:
|
||||||
|
- step: &ai-review-step
|
||||||
|
clone:
|
||||||
|
depth: full
|
||||||
|
name: AI Code Review
|
||||||
|
max-time: 40
|
||||||
|
image: code.wynenterprise.io/docker/bitbucket-ai-review:spreadnet
|
||||||
|
runs-on: [kodo]
|
||||||
|
script:
|
||||||
|
- |
|
||||||
|
COMMIT_MSG=$(git log --format=%B -n 1 "$BITBUCKET_COMMIT")
|
||||||
|
|
||||||
|
if [[ "$COMMIT_MSG" == *"[no ai]"* ]]; then
|
||||||
|
echo "Skip pipeline: [no ai] found in commit message."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
export VCS_ACCESS_TOKEN=$CC_KODOTOKEN
|
||||||
|
export ATLASSIAN_USER_EMAIL=$CC_KODOMAIL
|
||||||
|
export TEAM_NAME=$CC_TEAM
|
||||||
|
|
||||||
|
/pipe.sh
|
||||||
|
|
||||||
|
pipelines:
|
||||||
|
pull-requests:
|
||||||
|
'**':
|
||||||
|
- step: *ai-review-step
|
||||||
|
|
||||||
|
custom:
|
||||||
|
ai-review:
|
||||||
|
- step: *ai-review-step
|
||||||
|
```
|
||||||
|
|
||||||
|
This script will run automatically when a Pull Request is created or updated. If necessary, you can start it manually via the Bitbucket interface and add additional conditions required for start.
|
||||||
|
|
||||||
|
> ⚠️ **Important!** All pre-built scripts include a custom `ai-review` step. Do not change this name.
|
||||||
|
|||||||
Reference in New Issue
Block a user