Skip to content

Add --ci flag for headless review in CI/CD pipelines #61

@fuleinist

Description

@fuleinist

Problem

The git lrc review flow is tightly coupled to a browser UI — lrc always opens a web view. Teams using AI-generated code in automated PR workflows (GitHub Actions, GitLab CI, etc.) have no way to integrate git-lrc checks as a CI gate. The review cannot run in a headless context.

Solution

Add a --ci flag to git lrc review that:

  • Runs the review entirely headless — no browser opens, no UI
  • Streams JSON output to stdout with structured results:
    {
      "issues": [
        { "file": "src/utils/auth.go", "line": 42, "severity": "high", "message": "Hardcoded API key detected" }
      ],
      "summary": { "total": 3, "high": 1, "medium": 1, "low": 1 },
      "coverage": 78,
      "iterations": 2
    }
  • Exits with code 0 (clean) or 1 (issues found) for CI script gating
  • --ci --fail-on=high only exits non-zero on high-severity issues (medium/low are warnings only)
  • --ci --connector=openai allows specifying which BYOK connector to use in CI

Example GitHub Actions usage:

- name: Run git-lrc review
  run: |
    git lrc review --ci --fail-on=high > review.json || true
    echo "result=$(cat review.json)" >> $GITHUB_STEP_SUMMARY

Use case

Hooking git lrc review --ci into GitHub Actions or GitLab CI to enforce mandatory review on commits created by AI coding agents in automated PR workflows. Lets teams audit AI-generated diffs in CI without a human in the loop for every commit.

Scope

  • New --ci flag handled in the existing review command handler
  • Output format: JSON to stdout (no UI/web server)
  • Exit codes: 0 = clean, 1 = issues found, 2 = error
  • No new API calls beyond normal review flow
  • Target: small and focused — purely a new output mode for existing logic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions