Dropstone Docs

GitLab

GitLab 이슈 및 병합 요청에서 Dropstone을 사용합니다.

Dropstone은 GitLab CI/CD 파이프라인 또는 GitLab Duo를 통해 GitLab 워크플로우와 통합됩니다.

두 경우 모두 Dropstone은 GitLab 러너에서 실행됩니다.


GitLab CI

Dropstone은 일반 GitLab 파이프라인에서 작동합니다. CI 컴포넌트로 파이프라인에 빌드할 수 있습니다.

여기서는 Dropstone을 위해 커뮤니티에서 만든 CI/CD 컴포넌트를 사용합니다: nagyv/gitlab-dropstone.


기능

  • 작업별 사용자 정의 구성 사용: 예를 들어 ./config/#custom-directory와 같은 사용자 정의 구성 디렉토리로 Dropstone을 구성하여 각 Dropstone 호출마다 기능을 활성화 또는 비활성화합니다.
  • 최소한의 설정: CI 컴포넌트는 백그라운드에서 Dropstone을 설정하므로 Dropstone 구성과 초기 프롬프트만 생성하면 됩니다.
  • 유연함: CI 컴포넌트는 동작을 사용자 정의하기 위한 여러 입력을 지원합니다.

설정

  1. 설정 > CI/CD > 변수 아래에서 Dropstone 인증 JSON을 파일 유형 CI 환경 변수로 저장합니다. "마스크 및 숨김"으로 표시해야 합니다.

  2. .gitlab-ci.yml 파일에 다음을 추가합니다.

    include:
      - component: $CI_SERVER_FQDN/nagyv/gitlab-dropstone/dropstone@2
        inputs:
          config_dir: ${CI_PROJECT_DIR}/dropstone-config
          auth_json: $DROPSTONE_AUTH_JSON # Dropstone 인증 JSON의 변수 이름
          command: optional-custom-command
          message: "Your prompt here"
    

더 많은 입력 및 사용 사례는 이 컴포넌트의 문서를 확인하세요.


GitLab Duo

Dropstone은 GitLab 워크플로우와 통합됩니다. 댓글에서 @dropstone을 언급하면 Dropstone이 GitLab CI 파이프라인 내에서 작업을 실행합니다.


기능

  • 이슈 분류: Dropstone에 이슈를 살펴보고 설명해달라고 요청합니다.
  • 수정 및 구현: Dropstone에 이슈를 수정하거나 기능을 구현해달라고 요청합니다. 새 브랜치를 생성하고 변경 사항이 포함된 병합 요청을 제출합니다.
  • 보안: Dropstone은 GitLab 러너에서 실행됩니다.

설정

Dropstone은 GitLab CI/CD 파이프라인에서 실행되며, 설정하는 데 필요한 사항은 다음과 같습니다:

:

최신 지침은 GitLab 문서를 확인하세요.

  1. GitLab 환경 구성
  2. CI/CD 설정
  3. Dropstone API 키 가져오기 (빠른 시작 참조)
  4. 서비스 계정 생성
  5. CI/CD 변수 구성
  6. 플로우 구성 파일 생성. 예:
image: node:22-slim
commands:
  - echo "Installing Dropstone"
  - curl -fsSL https://dropstone.io/install | bash
  - echo "Installing glab"
  - export GITLAB_TOKEN=$GITLAB_TOKEN_DROPSTONE
  - apt-get update --quiet && apt-get install --yes curl wget gpg git && rm --recursive --force /var/lib/apt/lists/*
  - curl --silent --show-error --location "https://raw.githubusercontent.com/upciti/wakemeops/main/assets/install_repository" | bash
  - apt-get install --yes glab
  - echo "Configuring glab"
  - echo $GITLAB_HOST
  - echo "Creating Dropstone auth configuration"
  - mkdir --parents ~/.local/share/dropstone
  - |
    cat > ~/.local/share/dropstone/auth.json << EOF
    {
      "dropstone": {
        "type": "api",
        "key": "$DROPSTONE_API_KEY"
      }
    }
    EOF
  - echo "Configuring git"
  - git config --global user.email "dropstone@gitlab.com"
  - git config --global user.name "Dropstone"
  - echo "Testing glab"
  - glab issue list
  - echo "Running Dropstone"
  - |
    dropstone run "
    You are an AI assistant helping with GitLab operations.

    Context: $AI_FLOW_CONTEXT
    Task: $AI_FLOW_INPUT
    Event: $AI_FLOW_EVENT

    Please execute the requested task using the available GitLab tools.
    Be thorough in your analysis and provide clear explanations.

    Use the glab CLI to access data from GitLab. The glab CLI is already authenticated.

    If you are asked to summarize an MR or issue, or provide more information,
    post back a note to the MR/Issue so the user can see it.
    "
  - git checkout --branch $CI_WORKLOAD_REF origin/$CI_WORKLOAD_REF
  - echo "Checking for git changes and pushing if any exist"
  - |
    if ! git diff --quiet || ! git diff --cached --quiet || [ -n "$(git ls-files --others --exclude-standard)" ]; then
      echo "Git changes detected, adding and pushing..."
      git add .
      if git diff --cached --quiet; then
        echo "No staged changes to commit"
      else
        echo "Committing changes to branch: $CI_WORKLOAD_REF"
        git commit --message "Dropstone changes"
        echo "Pushing changes up to $CI_WORKLOAD_REF"
        git push "https://gitlab-ci-token:$GITLAB_TOKEN@$GITLAB_HOST/$CI_PROJECT_PATH.git" $CI_WORKLOAD_REF
        echo "Changes successfully pushed"
      fi
    else
      echo "No git changes detected, skipping push"
    fi
variables:
  - DROPSTONE_API_KEY
  - GITLAB_TOKEN_DROPSTONE
  - GITLAB_HOST

자세한 지침은 GitLab Duo Agent Platform 문서를 참조할 수 있습니다.


예제

GitLab에서 Dropstone을 사용하는 방법의 몇 가지 예제입니다.

:

@dropstone 이외의 다른 트리거 구문을 구성할 수 있습니다.

  • 이슈 설명

    GitLab 이슈에 이 댓글을 추가합니다.

    @dropstone explain this issue
    

    Dropstone이 이슈를 읽고 명확한 설명으로 응답합니다.

  • 이슈 수정

    GitLab 이슈에서 다음과 같이 말합니다:

    @dropstone fix this
    

    Dropstone이 새 브랜치를 생성하고 변경 사항을 구현한 후 변경 사항이 포함된 병합 요청을 엽니다.

  • 병합 요청 검토

    GitLab 병합 요청에 다음 댓글을 남깁니다.

    @dropstone review this merge request
    

    Dropstone이 병합 요청을 검토하고 피드백을 제공합니다.

Ctrl+I