mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-10-31 20:02:17 +08:00
Cross-cutting cleanup that lands alongside the new feature surface: - `--limit / -L` and `--all-pages` on every list command. Default --limit 30 (gh-parity); --all-pages drains every server page client-side, capped by --limit. Closes the audit finding that the old "1000 max per call" implicit cap was undiscoverable. - `auth token` emits a TTY-only stderr advisory when stdout is a terminal (the credential just got displayed in scrollback) plus an api-key-mode rotation hint. - Comment + doc discipline pass: drop external project name references from in-code comments (we reference them in design notes, not inline). - Bump `go` directive to 1.26.0 and CI matrix to 1.26.x to align with the main module's go.mod. - Rename `cli/internal/agent` → `cli/internal/aiclient` to disambiguate from the new `cli/cmd/agent` resource subtree. The package handles AI coding-agent env detection + per-command --help annotations; the new name reflects that more precisely.
67 lines
2.1 KiB
YAML
67 lines
2.1 KiB
YAML
name: CLI E2E
|
|
|
|
# Runs the cli/acceptance/e2e/ suite against a real WeKnora server.
|
|
# Cost-gated so it doesn't fire on every PR:
|
|
# - workflow_dispatch: maintainer can trigger manually
|
|
# - pull_request labeled "acceptance-e2e": adding the label kicks a run
|
|
#
|
|
# Required repo secrets (only set on Tencent/WeKnora; cross-fork PRs have no
|
|
# access and the job exits early via the secrets-present guard):
|
|
# WEKNORA_E2E_HOST - https URL of the test server
|
|
# WEKNORA_E2E_TOKEN - bearer token / API key for that host
|
|
#
|
|
# Mirrors gh acceptance/ trigger pattern: env-gated, opt-in, single matrix.
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
types: [labeled, synchronize]
|
|
paths:
|
|
- 'cli/**'
|
|
- '.github/workflows/cli-e2e.yml'
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: cli
|
|
shell: bash
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
e2e:
|
|
name: rag full loop
|
|
# Skip auto-trigger on label-add unless the label is exactly "acceptance-e2e".
|
|
# Manual workflow_dispatch always runs.
|
|
if: |
|
|
github.event_name == 'workflow_dispatch' ||
|
|
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'acceptance-e2e'))
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version: '1.26'
|
|
cache-dependency-path: cli/go.sum
|
|
|
|
- name: secrets present
|
|
id: secrets
|
|
env:
|
|
E2E_HOST: ${{ secrets.WEKNORA_E2E_HOST }}
|
|
E2E_TOKEN: ${{ secrets.WEKNORA_E2E_TOKEN }}
|
|
run: |
|
|
if [ -z "$E2E_HOST" ] || [ -z "$E2E_TOKEN" ]; then
|
|
echo "::warning::WEKNORA_E2E_HOST or WEKNORA_E2E_TOKEN not set; skipping e2e."
|
|
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "skip=false" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: go test -tags=acceptance_e2e
|
|
if: steps.secrets.outputs.skip == 'false'
|
|
env:
|
|
WEKNORA_E2E_HOST: ${{ secrets.WEKNORA_E2E_HOST }}
|
|
WEKNORA_E2E_TOKEN: ${{ secrets.WEKNORA_E2E_TOKEN }}
|
|
run: go test -tags=acceptance_e2e -v -timeout=8m ./acceptance/e2e/...
|