Skip to content

Commit 448087d

Browse files
refactor(gitlab): rename template to droid-review.yml; ship as two-file pattern
Component template renamed from gitlab/templates/review.yml to gitlab/templates/droid-review.yml. Customer drops a self-contained factory/droid-review.yml in their project and adds a single `include: - local:` line to their .gitlab-ci.yml, mirroring the GitHub action's `.github/workflows/droid-review.yml` model. Examples restructured to reflect the two-file layout. Docs + README snippets updated accordingly. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
1 parent 80e6581 commit 448087d

8 files changed

Lines changed: 82 additions & 79 deletions

File tree

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ For GitHub-only setups you can also run `/install-github-app`. See the [Automate
4242

4343
GitLab support ships as a **GitLab CI/CD Component** that delivers automated code review — inline MR comments on every merge request, with optional security review.
4444

45-
Minimal `.gitlab-ci.yml`:
45+
Two files in your project:
46+
47+
`factory/droid-review.yml`:
4648

4749
```yaml
4850
include:
49-
- remote: "https://raw.githubusercontent.com/Factory-AI/droid-action/main/gitlab/templates/review.yml"
51+
- remote: "https://raw.githubusercontent.com/Factory-AI/droid-action/main/gitlab/templates/droid-review.yml"
5052
inputs:
5153
automatic_review: "true"
5254
automatic_security_review: "false"
@@ -58,6 +60,13 @@ droid-review:
5860
GITLAB_TOKEN: $GITLAB_TOKEN
5961
```
6062
63+
`.gitlab-ci.yml` (one include line, append to existing if present):
64+
65+
```yaml
66+
include:
67+
- local: "factory/droid-review.yml"
68+
```
69+
6170
Full setup, available inputs, and troubleshooting live in [`docs/gitlab-setup.md`](docs/gitlab-setup.md).
6271

6372
### Manual Setup

docs/gitlab-setup.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ droid
1717

1818
It detects GitLab, asks which account should be the poster of review
1919
comments (you supply its PAT as `GITLAB_TOKEN`), asks the configuration
20-
questions below, generates the `.gitlab-ci.yml`, and opens an MR /
21-
direct-commits to the target project(s).
20+
questions below, drops `factory/droid-review.yml` in your project, wires
21+
it into `.gitlab-ci.yml`, and opens an MR / direct-commits to the target
22+
project(s).
2223

2324
## Manual installation
2425

@@ -32,16 +33,17 @@ direct-commits to the target project(s).
3233

3334
### 2. Add the CI/CD Component
3435

35-
Drop-in samples live in [`gitlab/examples/`](../gitlab/examples/):
36+
Drop-in samples live in [`gitlab/examples/`](../gitlab/examples/). The
37+
layout is two files:
3638

37-
- [`.gitlab-ci.minimal.yml`](../gitlab/examples/.gitlab-ci.minimal.yml)shortest possible, accepts every default.
38-
- [`.gitlab-ci.example.yml`](../gitlab/examples/.gitlab-ci.example.yml)annotated with every input.
39+
- [`factory/droid-review.yml`](../gitlab/examples/factory/droid-review.yml)self-contained config (include + inputs + variables). Drop verbatim.
40+
- [`.gitlab-ci.yml`](../gitlab/examples/.gitlab-ci.yml)project-root entry point. If you already have one, append the include line below to its `include:` block.
3941

40-
The minimal form looks like this; create or extend `.gitlab-ci.yml` in your project with:
42+
**`factory/droid-review.yml`** (drop into your project):
4143

4244
```yaml
4345
include:
44-
- remote: "https://raw.githubusercontent.com/Factory-AI/droid-action/main/gitlab/templates/review.yml"
46+
- remote: "https://raw.githubusercontent.com/Factory-AI/droid-action/main/gitlab/templates/droid-review.yml"
4547
inputs:
4648
automatic_review: "true"
4749
automatic_security_review: "false"
@@ -56,8 +58,15 @@ droid-review:
5658
GITLAB_TOKEN: $GITLAB_TOKEN
5759
```
5860
59-
> The `include:` URL is pinned to `@main`, which tracks the latest stable
60-
> cut of droid-action.
61+
**`.gitlab-ci.yml`** (project root, just needs the one include line):
62+
63+
```yaml
64+
include:
65+
- local: "factory/droid-review.yml"
66+
```
67+
68+
> The remote `include:` URL is pinned to `@main`, which tracks the
69+
> latest stable cut of droid-action.
6170

6271
### 3. Push an MR
6372

gitlab/examples/.gitlab-ci.example.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

gitlab/examples/.gitlab-ci.minimal.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

gitlab/examples/.gitlab-ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Example project-root .gitlab-ci.yml.
2+
#
3+
# If the project doesn't have a .gitlab-ci.yml yet, create one with at
4+
# minimum the include line below. If it already has one, just append the
5+
# `- local: "factory/droid-review.yml"` entry to its existing `include:`
6+
# block (or add a new `include:` block if there isn't one).
7+
8+
include:
9+
- local: "factory/droid-review.yml"

gitlab/examples/README.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
# GitLab examples
22

3-
Drop-in `.gitlab-ci.yml` samples for consuming the droid-action GitLab
4-
CI/CD Component.
3+
Two-file layout for consuming the droid-action GitLab CI/CD Component:
54

6-
| File | When to use |
7-
| ------------------------ | -------------------------------------------------------------------------------------------------------------- |
8-
| `.gitlab-ci.minimal.yml` | Shortest possible — `include:` the review template, accept every default. Good starting point. |
9-
| `.gitlab-ci.example.yml` | Annotated. Every input spelled out with comments explaining what it does and what the safe defaults look like. |
5+
```
6+
your-project/
7+
├── .gitlab-ci.yml # gains one `include:` line
8+
└── factory/
9+
└── droid-review.yml # self-contained droid-review config
10+
```
1011

11-
Both samples wire the same two required CI/CD variables:
12+
| File | Where it lives in your project | Purpose |
13+
| ----------------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------------- |
14+
| `factory/droid-review.yml` | drop verbatim | Self-contained config: includes the remote Component, sets inputs, wires CI/CD variables. |
15+
| `.gitlab-ci.yml` | append one `include:` line if the file exists | Project-root entry point. Just needs to include `factory/droid-review.yml`. |
1216

13-
- `FACTORY_API_KEY` — get one at <https://app.factory.ai/settings/api-keys>.
14-
- `GITLAB_TOKEN` — a personal access token with `api` scope, owned by
15-
whichever GitLab user/account should be the poster of review comments.
16-
To change the poster later, replace this variable's value.
17+
The two required CI/CD variables (`FACTORY_API_KEY`, `GITLAB_TOKEN`) are set
18+
in the GitLab UI under **Project → Settings → CI/CD → Variables** (or at
19+
the group level for org-wide rollout), masked and unprotected.
1720

18-
Set both as **masked** CI/CD variables at the level you want the review
19-
to apply (project, subgroup, or top-level group).
20-
21-
For the full input reference (model overrides, security review,
22-
suggestion blocks, etc.) see the docs at
23-
[`docs/gitlab-setup.md`](../../docs/gitlab-setup.md).
21+
For the full input reference see the docs at [`docs/gitlab-setup.md`](../../docs/gitlab-setup.md).
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# factory/droid-review.yml
2+
#
3+
# Drop this file at `factory/droid-review.yml` in your project, then
4+
# add a single `include: - local: "factory/droid-review.yml"` line to
5+
# your `.gitlab-ci.yml` (see ../.gitlab-ci.yml for the entry-point
6+
# example).
7+
#
8+
# Prerequisites (one-time, set in Project / Group → Settings → CI/CD):
9+
#
10+
# * FACTORY_API_KEY — masked variable. Get one at
11+
# https://app.factory.ai/settings/api-keys
12+
# * GITLAB_TOKEN — masked variable. A personal access token with
13+
# `api` scope, owned by whichever GitLab account should post review
14+
# comments. The token owner IS the poster.
15+
16+
include:
17+
- remote: "https://raw.githubusercontent.com/Factory-AI/droid-action/main/gitlab/templates/droid-review.yml"
18+
inputs:
19+
automatic_review: "true" # run on every MR event; "false" disables
20+
review_depth: "deep" # "deep" (thorough) or "shallow" (fast)
21+
include_suggestions: "true" # post code-suggestion blocks for high-confidence fixes
22+
automatic_security_review: "false" # enable to flag vulns alongside the regular review
23+
security_block_on_critical: "true" # block merge on CRITICAL findings (when security review is on)
24+
security_block_on_high: "false" # block merge on HIGH findings
25+
26+
droid-review:
27+
variables:
28+
FACTORY_API_KEY: $FACTORY_API_KEY
29+
GITLAB_TOKEN: $GITLAB_TOKEN

0 commit comments

Comments
 (0)