Skip to content

Commit 7eb3527

Browse files
committed
different gitstream.cm for github and gitlab (gitlab without triggers)
1 parent 84239ef commit 7eb3527

File tree

2 files changed

+63
-8
lines changed

2 files changed

+63
-8
lines changed

docs/downloads/gitlab/gitstream.cm

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# -*- mode: yaml -*-
2+
# This example configuration for provides basic automations to get started with gitStream.
3+
# View the gitStream quickstart for more examples: https://docs.gitstream.cm/examples/
4+
manifest:
5+
version: 1.0
6+
7+
8+
automations:
9+
# Add a label that indicates how many minutes it will take to review the PR.
10+
estimated_time_to_review:
11+
if:
12+
- true
13+
run:
14+
- action: add-label@v1
15+
args:
16+
label: "{{ calc.etr }} min review"
17+
color: {{ colors.red if (calc.etr >= 20) else ( colors.yellow if (calc.etr >= 5) else colors.green ) }}
18+
# Inform PR authors when they fail to reference Jira tickets in the PR title or description.
19+
label_missing_jira_info:
20+
if:
21+
- {{ not (has.jira_ticket_in_title or has.jira_ticket_in_desc) }}
22+
run:
23+
- action: add-label@v1
24+
args:
25+
label: "missing-jira"
26+
color: {{ colors.red }}
27+
- action: add-comment@v1
28+
args:
29+
comment: |
30+
This PR is missing a Jira ticket reference in the title or description.
31+
Please add a Jira ticket reference to the title or description of this PR.
32+
# Post a comment that lists the best experts for the files that were modified.
33+
explain_code_experts:
34+
if:
35+
- true
36+
run:
37+
- action: explain-code-experts@v1
38+
args:
39+
gt: 10
40+
41+
42+
# +----------------------------------------------------------------------------+
43+
# | Custom Expressions |
44+
# | https://docs.gitstream.cm/how-it-works/#custom-expressions |
45+
# +----------------------------------------------------------------------------+
46+
47+
calc:
48+
etr: {{ branch | estimatedReviewTime }}
49+
50+
has:
51+
jira_ticket_in_title: {{ pr.title | includes(regex=r/\b[A-Za-z]+-\d+\b/) }}
52+
jira_ticket_in_desc: {{ pr.description | includes(regex=r/atlassian.net\/browse\/\w{1,}-\d{3,4}/) }}
53+
54+
colors:
55+
red: 'b60205'
56+
yellow: 'fbca04'
57+
green: '0e8a16'

docs/gitlab-installation.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ GitLab Installation Overview
1515
1. Designate a gitStream user account.
1616
1. Create a CM configuration file.
1717
1. Create a GitLab pipeline.
18-
1. Install the gitStream service.
18+
1. Install the gitStream service.
1919

2020
## Designate a gitStream User Account
2121

22-
gitStream automation rules are executed on behalf of the user account configured when you install the gitStream service. This account must have the `maintainer` or `owner` role to the relevant repos.
22+
gitStream automation rules are executed on behalf of the user account configured when you install the gitStream service. This account must have the `maintainer` or `owner` role to the relevant repos.
2323

2424
We recommend creating a [dedicated service account](https://docs.gitlab.com/ee/user/profile/service_accounts.html){:target="_blank"} to control access to individual repos easily. You can also use your professional or personal GitLab account for this, which would result in all automations being executed under that account, which might also affect LinearB's metrics.
2525

@@ -39,7 +39,7 @@ Create a `cm` project (repository) in your GitLab group, and create a `gitstream
3939
!!! example "Example Configuration"
4040
Here is an example of a gitStream configuration file to set up some basic workflow automations.
4141
```yaml+jinja
42-
--8<-- "docs/downloads/gitstream.cm"
42+
--8<-- "docs/downloads/gitlab/gitstream.cm"
4343
```
4444

4545
## Create a GitLab Pipeline
@@ -49,7 +49,7 @@ Once your gitStream configuration file is set up, you need a GitLab CI configura
4949
=== "GitLab-Hosted runners"
5050

5151
**Gitlab-Hosted Runners**
52-
52+
5353
Use the following `.gitlab-ci.yml`
5454

5555
``` yaml+jinja
@@ -67,7 +67,7 @@ Once your gitStream configuration file is set up, you need a GitLab CI configura
6767
``` yaml+jinja
6868
--8<-- "docs/downloads/gitlab-shell-ci.yml"
6969
```
70-
70+
7171
=== "Self-Managed Runners - Kubernetes"
7272
**Self-Managed Runners**
7373

@@ -91,7 +91,7 @@ Once your gitStream configuration file is set up, you need a GitLab CI configura
9191
- ...
9292
- docker pull YOUR-REGISTRY-URL/gitstream/rules-engine:latest
9393
```
94-
The docker image can be pulled to your private repository from [DockerHub](https://hub.docker.com/r/gitstream/rules-engine){:target=_blank}.
94+
The docker image can be pulled to your private repository from [DockerHub](https://hub.docker.com/r/gitstream/rules-engine){:target=_blank}.
9595
## Next Step
9696
If you successfully complete these instructions, gitStream will now do these two things.
9797

@@ -117,5 +117,3 @@ The required permissions are:
117117
| Read/Write API | To get notified on MR changes and allow gitStream to approve MRs once all conditions are met |
118118
| Read repository | To read and check rules over the code changes on monitored repositories |
119119
| Read user profile | Used to identify users |
120-
121-

0 commit comments

Comments
 (0)