|
| 1 | +# Example .gitlab-ci.yml showcasing the droid-action GitLab CI/CD Component. |
| 2 | +# |
| 3 | +# Drop this file (or its snippets) at the root of your GitLab project. |
| 4 | +# It defines a single `droid-review` job that runs Factory Droid's |
| 5 | +# automated code review on every merge_request_event. |
| 6 | +# |
| 7 | +# Prerequisites (one-time, configured via the GitLab UI or `glab`): |
| 8 | +# |
| 9 | +# * FACTORY_API_KEY — masked CI/CD variable. Get one at |
| 10 | +# https://app.factory.ai/settings/api-keys |
| 11 | +# |
| 12 | +# * GITLAB_TOKEN — masked CI/CD variable. A personal access token |
| 13 | +# with `api` scope, minted by the GitLab user/account you want |
| 14 | +# review comments to be posted from. The poster identity IS the |
| 15 | +# owner of this token; there is no API impersonation. To switch |
| 16 | +# posters later, replace the variable's value. |
| 17 | +# |
| 18 | +# Both variables can be set at the project, subgroup, or top-level |
| 19 | +# group level, depending on how widely you want the review to roll out. |
| 20 | + |
| 21 | +include: |
| 22 | + # Pin to a release tag once droid-action publishes one. Until then, |
| 23 | + # `main` tracks the latest stable cut. `droid_action_ref` below MUST |
| 24 | + # match the ref in this URL so the template and the runtime source |
| 25 | + # stay consistent. |
| 26 | + - remote: "https://raw.githubusercontent.com/Factory-AI/droid-action/main/gitlab/templates/review.yml" |
| 27 | + inputs: |
| 28 | + # ---- core review behavior ---- |
| 29 | + automatic_review: "true" # run on every MR event; "false" disables |
| 30 | + review_depth: "deep" # "deep" (gpt-5.2 / high) or "shallow" (kimi-k2.6 / none) |
| 31 | + include_suggestions: "true" # post code-suggestion blocks for high-confidence fixes |
| 32 | + |
| 33 | + # ---- security review (parallel security-reviewer subagent) ---- |
| 34 | + automatic_security_review: "false" # enable to flag vulns alongside the regular review |
| 35 | + security_block_on_critical: "true" # block merge on CRITICAL findings (when security review is on) |
| 36 | + security_block_on_high: "false" # block merge on HIGH findings (defaults to false) |
| 37 | + |
| 38 | + # ---- runtime source pin ---- |
| 39 | + droid_action_ref: "main" |
| 40 | + |
| 41 | +droid-review: |
| 42 | + variables: |
| 43 | + FACTORY_API_KEY: $FACTORY_API_KEY |
| 44 | + GITLAB_TOKEN: $GITLAB_TOKEN |
| 45 | +# ---- Optional: add @droid fill mode ------------------------------------- |
| 46 | +# |
| 47 | +# Uncomment the include below to also auto-fill new MRs' descriptions |
| 48 | +# from their diffs. The fill job fires on the same `merge_request_event` |
| 49 | +# trigger as the review job; together they form Factory Droid's GA GitLab |
| 50 | +# experience. |
| 51 | +# |
| 52 | +# include: |
| 53 | +# - remote: "https://raw.githubusercontent.com/Factory-AI/droid-action/main/gitlab/templates/fill.yml" |
| 54 | +# inputs: |
| 55 | +# automatic_fill: "false" # true = fill every new MR automatically |
| 56 | +# droid_action_ref: "main" |
| 57 | +# |
| 58 | +# droid-fill: |
| 59 | +# variables: |
| 60 | +# FACTORY_API_KEY: $FACTORY_API_KEY |
| 61 | +# GITLAB_TOKEN: $GITLAB_TOKEN |
| 62 | +# |
| 63 | +# With automatic_fill="false", trigger fill manually per MR by either: |
| 64 | +# - writing "@droid fill" in the MR description, OR |
| 65 | +# - writing "@droid fill" in the MR title, OR |
| 66 | +# - adding the "droid:fill" label to the MR. |
| 67 | +# |
| 68 | +# After Droid fills the description, it strips the @droid fill token so |
| 69 | +# the next merge_request_event doesn't re-trigger. |
| 70 | +# ----------------------------------------------------------------------- |
0 commit comments