diff --git a/.droid.yaml b/.droid.yaml new file mode 100644 index 0000000000..886231c61a --- /dev/null +++ b/.droid.yaml @@ -0,0 +1,26 @@ +review: + # --- Auto-review settings --- + auto_review: + enabled: false + draft: false + bot: false + ignore_title_keywords: + - "WIP" + - "DO NOT MERGE" + ignore_labels: + - "droid-skip" + - "Abandoned" + excluded_base_branches: + - "main" + + # --- Output settings --- + pr_summary: true + file_summaries: true + tips: true + github_action_repair: true + enable_skip_reason_comments: true + + guidelines: + - path: "*" + guideline: "Follow our copilot-instructions.md style guide." + context_document_path: ".github/copilot-instructions.md" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 9342b4d0aa..0000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,360 +0,0 @@ -# Copyright 2021-Present Couchbase, Inc. -# -# Use of this software is governed by the Business Source License included in -# the file licenses/BSL-Couchbase.txt. As of the Change Date specified in that -# file, in accordance with the Business Source License, use of this software -# will be governed by the Apache License, Version 2.0, included in the file -# licenses/APL2.txt. - -name: ci -permissions: - contents: read - -on: - push: - branches: - - 'master' - - 'main' - - 'release/*' - - 'feature/*' - - 'beryllium' - - 'CBG*' - - 'ci-*' - pull_request: - branches: - - 'master' - - 'main' - - 'release/*' - - 'beryllium' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: ${{ !contains(github.ref, 'release/') && !contains(github.ref, 'main') }} - -env: - ACTIONS_CHECKOUT_VERSION: &actions_checkout_version actions/checkout@v6 - ACTIONS_SETUP_GO_VERSION: &actions_setup_go_version actions/setup-go@v6 - ACTIONS_RUFF_VERSION: &actions_ruff_version astral-sh/ruff-action@v4.0.0 - GO_VERSION: &go_version 1.26.4 - GOTESTSUM_VERSION: 1.13.0 - GO_TEST_ANNOTATIONS_VERSION: &go_test_annotations_version guyarb/golang-test-annotations@v0.9.0 - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: *actions_checkout_version - - uses: *actions_setup_go_version - with: - go-version: *go_version - - name: go-build - run: go build "./..." - - addlicense: - name: addlicense - runs-on: ubuntu-latest - steps: - - uses: *actions_checkout_version - - uses: *actions_setup_go_version - with: - go-version: *go_version - - run: go install github.com/google/addlicense@latest - - run: addlicense -check -f licenses/addlicense.tmpl . - - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: *actions_checkout_version - - uses: *actions_setup_go_version - with: - go-version: *go_version - - name: golangci-lint - uses: golangci/golangci-lint-action@v9 - with: - version: v2.12.2 - args: --config=.golangci-strict.yml - - test: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - os: macos-latest - name: macos - - os: windows-latest - name: windows - - os: ubuntu-latest - name: ubuntu - env: - GOPRIVATE: github.com/couchbaselabs - MallocNanoZone: 0 - name: test (${{ matrix.name }}) - steps: - - uses: *actions_checkout_version - - uses: *actions_setup_go_version - with: - go-version: *go_version - - name: Install gotestsum - run: go install gotest.tools/gotestsum@v${{ env.GOTESTSUM_VERSION }} - - name: Build - run: go build -v "./..." - - name: Run Tests - run: gotestsum --format pkgname-and-test-fails --hide-summary=skipped --hide-summary=output --jsonfile test.json -- -tags cb_sg_devmode -shuffle=on -timeout=30m -count=1 "./..." - shell: bash - - name: Test Summary - if: always() - shell: bash - run: .github/scripts/test-summary.sh - - name: Annotate Failures - if: always() - uses: *go_test_annotations_version - with: - test-results: test.json - - name: Render test log - if: failure() - shell: bash - run: gotestsum --format standard-verbose --raw-command -- cat test.json > test.log 2>&1 || true - - name: Upload test logs artifact - if: failure() - uses: actions/upload-artifact@v7 - with: - name: test-logs-${{ github.job }}-${{ matrix.name || matrix.os || 'default' }} - path: test.log - retention-days: 7 - if-no-files-found: warn - - test-race: - runs-on: ubuntu-latest - env: - GOPRIVATE: github.com/couchbaselabs - steps: - - uses: *actions_checkout_version - - uses: *actions_setup_go_version - with: - go-version: *go_version - - name: Install gotestsum - run: go install gotest.tools/gotestsum@v${{ env.GOTESTSUM_VERSION }} - - name: Run Tests - run: gotestsum --format pkgname-and-test-fails --hide-summary=skipped --hide-summary=output --jsonfile test.json -- -tags cb_sg_devmode -race -shuffle=on -timeout=30m -count=1 "./..." - shell: bash - - name: Test Summary - if: always() - shell: bash - run: .github/scripts/test-summary.sh - - name: Annotate Failures - if: always() - uses: *go_test_annotations_version - with: - test-results: test.json - - name: Render test log - if: failure() - shell: bash - run: gotestsum --format standard-verbose --raw-command -- cat test.json > test.log 2>&1 || true - - name: Upload test logs artifact - if: failure() - uses: actions/upload-artifact@v7 - with: - name: test-logs-${{ github.job }} - path: test.log - retention-days: 7 - if-no-files-found: warn - - test-default-collection: - runs-on: ubuntu-latest - env: - GOPRIVATE: github.com/couchbaselabs - SG_TEST_USE_DEFAULT_COLLECTION: true - steps: - - uses: *actions_checkout_version - - uses: *actions_setup_go_version - with: - go-version: *go_version - - name: Install gotestsum - run: go install gotest.tools/gotestsum@v${{ env.GOTESTSUM_VERSION }} - - name: Run Tests - run: gotestsum --format pkgname-and-test-fails --hide-summary=skipped --hide-summary=output --jsonfile test.json -- -tags cb_sg_devmode -shuffle=on -timeout=30m -count=1 "./..." - shell: bash - - name: Test Summary - if: always() - shell: bash - run: .github/scripts/test-summary.sh - - name: Annotate Failures - if: always() - uses: *go_test_annotations_version - with: - test-results: test.json - - name: Render test log - if: failure() - shell: bash - run: gotestsum --format standard-verbose --raw-command -- cat test.json > test.log 2>&1 || true - - name: Upload test logs artifact - if: failure() - uses: actions/upload-artifact@v7 - with: - name: test-logs-${{ github.job }} - path: test.log - retention-days: 7 - if-no-files-found: warn - test-benchmark-compile: - runs-on: ubuntu-latest - env: - GOPRIVATE: github.com/couchbaselabs - steps: - - uses: *actions_checkout_version - - uses: *actions_setup_go_version - with: - go-version: *go_version - - name: Install gotestsum - run: go install gotest.tools/gotestsum@v${{ env.GOTESTSUM_VERSION }} - - name: Run Tests - run: gotestsum --format pkgname-and-test-fails --hide-summary=skipped --hide-summary=output --jsonfile test.json -- -tags cb_sg_devmode -shuffle=on -timeout=30m -count=1 -short -bench=. -benchtime=1x -run '!' "./..." - shell: bash - - name: Test Summary - if: always() - shell: bash - run: .github/scripts/test-summary.sh - - name: Annotate Failures - if: always() - uses: *go_test_annotations_version - with: - test-results: test.json - - name: Render test log - if: failure() - shell: bash - run: gotestsum --format standard-verbose --raw-command -- cat test.json > test.log 2>&1 || true - - name: Upload test logs artifact - if: failure() - uses: actions/upload-artifact@v7 - with: - name: test-logs-${{ github.job }} - path: test.log - retention-days: 7 - if-no-files-found: warn - - - test-disable-rev-cache: - runs-on: ubuntu-latest - env: - GOPRIVATE: github.com/couchbaselabs - SG_TEST_DISABLE_REV_CACHE: true - steps: - - uses: *actions_checkout_version - - uses: *actions_setup_go_version - with: - go-version: *go_version - - name: Install gotestsum - run: go install gotest.tools/gotestsum@v${{ env.GOTESTSUM_VERSION }} - - name: Run Tests - run: gotestsum --format pkgname-and-test-fails --hide-summary=skipped --hide-summary=output --jsonfile test.json -- -tags cb_sg_devmode -shuffle=on -timeout=30m -count=1 "./..." - shell: bash - - name: Test Summary - if: always() - shell: bash - run: .github/scripts/test-summary.sh - - name: Annotate Failures - if: always() - uses: *go_test_annotations_version - with: - test-results: test.json - - name: Render test log - if: failure() - shell: bash - run: gotestsum --format standard-verbose --raw-command -- cat test.json > test.log 2>&1 || true - - name: Upload test logs artifact - if: failure() - uses: actions/upload-artifact@v7 - with: - name: test-logs-${{ github.job }} - path: test.log - retention-days: 7 - if-no-files-found: warn - - python-format: - runs-on: ubuntu-latest - steps: - - uses: *actions_checkout_version - - uses: *actions_ruff_version - with: - args: 'format --check' - python-lint: - runs-on: ubuntu-latest - steps: - - uses: *actions_checkout_version - - uses: *actions_ruff_version - test-sgcollect: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-latest, windows-latest, ubuntu-latest] - steps: - - uses: *actions_checkout_version - - uses: astral-sh/setup-uv@v7 - - name: Run test - run: | - uv run -- pytest - - name: Run mypy - run: | - uv run -- mypy - - test-stats-definition-exporter: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-latest, windows-latest, ubuntu-latest] - steps: - - uses: *actions_checkout_version - - uses: *actions_setup_go_version - with: - go-version: *go_version - - name: Build - run: go build -v "./tools/stats-definition-exporter" - - name: Install gotestsum - run: go install gotest.tools/gotestsum@v${{ env.GOTESTSUM_VERSION }} - - name: Run Tests - run: gotestsum --format pkgname-and-test-fails --hide-summary=skipped --hide-summary=output --jsonfile test.json -- -shuffle=on -timeout=5m -count=1 "./tools/stats-definition-exporter" - shell: bash - - name: Test Summary - if: always() - shell: bash - run: .github/scripts/test-summary.sh - - name: Annotate Failures - if: always() - uses: *go_test_annotations_version - with: - test-results: test.json - - name: Render test log - if: failure() - shell: bash - run: gotestsum --format standard-verbose --raw-command -- cat test.json > test.log 2>&1 || true - - name: Upload test logs artifact - if: failure() - uses: actions/upload-artifact@v7 - with: - name: test-logs-${{ github.job }}-${{ matrix.name || matrix.os || 'default' }} - path: test.log - retention-days: 7 - if-no-files-found: warn - cache_perf_tool_build: - runs-on: ubuntu-latest - name: build cache perf tool - steps: - - uses: *actions_checkout_version - - uses: *actions_setup_go_version - with: - go-version: *go_version - - name: Build - run: go build "./tools/cache_perf_tool" - govulncheck: - runs-on: ubuntu-latest - name: Run govulncheck - steps: - - id: govulncheck - # tag for repo at v1 is not updated - uses: golang/govulncheck-action@31f7c5463448f83528bd771c2d978d940080c9fd - with: - go-version-input: *go_version - go-package: ./... diff --git a/.github/workflows/droid.yml b/.github/workflows/droid.yml new file mode 100644 index 0000000000..8649e53633 --- /dev/null +++ b/.github/workflows/droid.yml @@ -0,0 +1,62 @@ +name: Droid + +on: + issue_comment: + types: [created, edited] + pull_request_review_comment: + types: [created, edited] + issues: + types: [opened, assigned] + pull_request_review: + types: [submitted] + pull_request: + types: [opened, edited] + workflow_dispatch: + +concurrency: + # factory-droid[bot] dispatches get a unique per-run suffix so the bot's own status comments cannot cancel an in-flight @droid run. + group: >- + ${{ github.workflow }}-${{ + github.event.pull_request.number || + github.event.issue.number || + github.ref + }}${{ + github.actor == 'factory-droid[bot]' && + format('-bot-{0}', github.run_id) || '' + }} + cancel-in-progress: true + +jobs: + droid: +# if: | +# ( +# (github.event_name == 'issue_comment' +# && contains(github.event.comment.body, '@droid')) || +# (github.event_name == 'pull_request_review_comment' +# && contains(github.event.comment.body, '@droid')) || +# (github.event_name == 'pull_request_review' +# && contains(github.event.review.body, '@droid')) || +# (github.event_name == 'issues' +# && (contains(github.event.issue.body, '@droid') +# || contains(github.event.issue.title, '@droid'))) #|| +# (github.event_name == 'pull_request' +# && (contains(github.event.pull_request.body, '@#droid') +# || contains(github.event.pull_request.title, '@#droid'))) +# ) + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + issues: write + id-token: write + actions: read + steps: + - name: Checkout repository + uses: actions/checkout@v5 + with: + fetch-depth: 1 + - name: Run Droid Exec + uses: Factory-AI/droid-action@e3d1f5e7861c36fe4a9c4dca3edec87b964b2bc4 #v5.0.0 + with: + factory_api_key: ${{ secrets.FACTORY_API_KEY }} + review_model: gpt-5.3-codex diff --git a/.github/workflows/service.yml b/.github/workflows/service.yml deleted file mode 100644 index 97ef6a1f51..0000000000 --- a/.github/workflows/service.yml +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright 2022-Present Couchbase, Inc. -# -# Use of this software is governed by the Business Source License included in -# the file licenses/BSL-Couchbase.txt. As of the Change Date specified in that -# file, in accordance with the Business Source License, use of this software -# will be governed by the Apache License, Version 2.0, included in the file -# licenses/APL2.txt. - -name: service -permissions: - contents: read - -on: - push: - # Only run when we modify service files - paths: - - 'service/**' - - 'integration-test/**' - - '.github/workflows/service.yml' - branches: - - 'main' - - 'release/*' - - 'feature/*' - - 'beryllium' - - 'CBG*' - - 'ci-*' - - 'api-ci-*' - pull_request: - # Only run when we modify service files - paths: - - 'service/**' - - 'integration-test/**' - branches: - - 'main' - - 'release/*' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: ${{ !contains(github.ref, 'release/')}} - -jobs: - scripts: - runs-on: ubuntu-latest - name: Verify service script installation. - steps: - - uses: actions/checkout@v6 - # build sync gateway since the executable is needed for service installation - - uses: actions/setup-go@v6 - with: - go-version: 1.26.4 - - name: "Build Sync Gateway" - run: mkdir -p ./bin && go build -o ./bin ./... - - name: "Run test scripts" - run: ./integration-test/service-install-tests.sh