Skip to content

feat(gitlab): CI/CD Catalog packaging (release pipeline + component include)#95

Draft
factory-nizar wants to merge 2 commits into
feat/gitlab-fillfrom
feat/gitlab-catalog
Draft

feat(gitlab): CI/CD Catalog packaging (release pipeline + component include)#95
factory-nizar wants to merge 2 commits into
feat/gitlab-fillfrom
feat/gitlab-catalog

Conversation

@factory-nizar
Copy link
Copy Markdown
Contributor

Stacked on #94 (feat/gitlab-fill).

Summary

Packages the GitLab component for the CI/CD Catalog and wires the gitlab.com mirror.

What ships

  • Root .gitlab-ci.yml on the mirror: validates templates/*.yml and publishes a Catalog release on semver tags (no droid-review job runs here).
  • Example uses the preferred include: component: gitlab.com/factory-components/droid-action/droid-review@<ver> form, keeping the local-copy fallback.
  • Runtime clone (droid_action_repo) now defaults to the GitLab mirror (factory-components/droid-action) so consumer jobs have no github.com dependency.

Infra (done out-of-band)

  • Public group factory-components, project factory-components/droid-action, native Premium pull-mirror from github.com/Factory-AI/droid-action (seeded).

Deferred / gated

Tests

  • typecheck clean; 469 tests pass.

factory-nizar and others added 2 commits June 2, 2026 15:37
Adds GitLab support for `@droid fill` via the three native pipeline-
firing surfaces that don't require a webhook receiver: MR description,
MR title, and labels. Plus an `automatic_fill` always-on mode.

How the trigger works:

  * `automatic_fill: "true"` -> droid-fill runs on every MR event
    and decides to fill based on description content.
  * `@droid fill` in MR title -> matched at rule level via
    $CI_MERGE_REQUEST_TITLE.
  * `droid:fill` label -> matched at rule level via
    $CI_MERGE_REQUEST_LABELS.
  * `@droid fill` in MR description -> not matchable at rule level
    (description isn't in env), so the job runs and exits early via
    state file if no match found in title/labels and the description
    fetched from the API doesn't contain the phrase.

After fill completes the prompt instructs the model to strip the
`@droid fill` token from the new description so the next
`merge_request_event` (fired by our own update) does not re-fire fill.

Discussion-comment triggers (`@droid fill` posted as a note on the
MR) still require a webhook receiver because GitLab does not fire CI
on note events. That subset is deliberately deferred.

Files:

  * `gitlab/templates/fill.yml` — new GitLab CI/CD Component with
    one `droid-fill` job, three trigger rules, MCP registration,
    `.droid-debug/` artifact staging.
  * `src/gitlab/validation/trigger.ts` — port of GitHub's
    `checkContainsTrigger` for the fill path with
    `checkContainsFillTrigger` + `stripFillTrigger`.
  * `src/gitlab/prompts/fill.ts` — fill prompt mirroring the GitHub
    `fill-prompt.ts` but writing back via
    `gitlab_mr___update_mr_description` instead of
    `github_pr___update_pr_description`.
  * `src/entrypoints/gitlab-fill-prepare.ts` — single-pass prepare
    that reads the MR description via API, checks the trigger, and
    writes the fill prompt + state file.
  * `src/gitlab/context.ts` — adds `automaticFill` input and
    `mr.labels` parsed from `CI_MERGE_REQUEST_LABELS`.

Tests: 24 new tests across `fill-trigger.test.ts` and
`fill-prompt.test.ts`. 469 pass, typecheck clean.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Add root .gitlab-ci.yml that validates the component templates and
publishes a CI/CD Catalog release on semver tags (runs only on the
gitlab.com mirror, factory-components/droid-action). Point the runtime
clone (droid_action_repo) at the GitLab mirror so consumer jobs have no
github.com dependency, and show the preferred 'include: component:'
Catalog form in the example, keeping the local-copy fallback.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant