feat(ci): add staging cloud smoke test#1310
Conversation
Add daily scheduled staging cloud smoke test that runs after the nightly build. Uses resolve-environment job to cleanly route between production and staging based on trigger type (push/PR → production, schedule → staging, manual dispatch → user choice). Resolves: DRC-3244 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Kent Huang <kent@infuseai.io>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Kent Huang <kent@infuseai.io>
There was a problem hiding this comment.
Pull request overview
Adds a scheduled and manually selectable staging cloud smoke test while preserving existing production behavior for push/PR events by routing runs through a single environment-resolution job.
Changes:
- Added a weekday (UTC+8) scheduled trigger intended to run against the staging cloud after the nightly build.
- Added
workflow_dispatchwith anenvironmentinput (production/staging) and aresolve-environmentjob to route execution. - Introduced a dedicated staging smoke test job using staging-specific secret/variable wiring.
| # Explicitly limit permissions for pull_request_target | ||
| permissions: | ||
| contents: read | ||
| pull-requests: read |
There was a problem hiding this comment.
The comment says this workflow limits permissions for pull_request_target, but the workflow is triggered by pull_request (and push/schedule/workflow_dispatch). Please update the comment to match the actual trigger so readers don’t assume pull_request_target semantics/risks.
There was a problem hiding this comment.
Fixed — updated the comment to remove the stale pull_request_target reference.
| # Staging cloud smoke test - runs daily after nightly build | ||
| smoke-test-cloud-staging: | ||
| needs: resolve-environment | ||
| if: needs.resolve-environment.outputs.environment == 'staging' | ||
| concurrency: | ||
| group: smoke-test-cloud-staging | ||
| cancel-in-progress: false | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| max-parallel: 1 | ||
| matrix: | ||
| include: | ||
| - python-version: "3.11" | ||
| dbt-version: "1.8" | ||
| - python-version: "3.13" | ||
| dbt-version: "latest" | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v4 | ||
| with: | ||
| version: "latest" | ||
|
|
||
| - name: Install Recce and dbt | ||
| run: | | ||
| uv venv | ||
| uv sync --no-dev --python ${{ matrix.python-version }} | ||
| if [ "${{ matrix.dbt-version }}" == "latest" ]; then | ||
| uv pip install dbt-core dbt-duckdb | ||
| else | ||
| uv pip install dbt-core~=${{ matrix.dbt-version }}.0 dbt-duckdb~=${{ matrix.dbt-version }}.0 | ||
| fi | ||
|
|
||
| - name: Run smoke test - dbt (staging) | ||
| run: | | ||
| source .venv/bin/activate | ||
| ./integration_tests/dbt/smoke_test_cloud.sh | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.RECCE_CLOUD_TOKEN_STAGING }} | ||
| RECCE_STATE_PASSWORD: ${{ vars.RECCE_STATE_PASSWORD }} | ||
| RECCE_CLOUD_API_HOST: ${{ vars.RECCE_CLOUD_API_HOST_STAGING }} |
There was a problem hiding this comment.
smoke-test-cloud and smoke-test-cloud-staging are nearly identical (same matrix and steps) and may drift over time. Consider factoring into a single job with an environment matrix/conditional env vars, or extracting a reusable workflow/composite action to keep production/staging behavior in sync.
There was a problem hiding this comment.
Acknowledged. The two jobs only differ in env vars (secrets/API host), so the duplication is minimal. Merging them into one job with conditional env vars would add complexity to the conditions we just simplified. Keeping them separate for now — we can extract a reusable workflow if we add more environments later.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Kent Huang <kent@infuseai.io>
Code Review: PR #1310Files reviewed: 1 Validation ResultsPass A: Correctness & Logic — PASS
Pass B: Security — PASS
Pass D: Error Handling & Edge Cases — PASSOne note below regarding Slack notification resilience. Pass F: Diff-Specific Checks — PASS
Verification ResultsYAML syntax valid. No linting issues in the workflow diff. Verdict: GONo blockers or issues found. Clean, well-structured addition. Notes
🤖 Reviewed by Claude Code |
even-wei
left a comment
There was a problem hiding this comment.
Claude Code Review: No critical issues found. Clean CI workflow addition with correct environment routing logic.
Summary
workflow_dispatchtrigger with environment selector (production/staging) for manual runsresolve-environmentjob to cleanly route between production and staging testsRequired GitHub Settings
RECCE_CLOUD_TOKEN_STAGING— auth token for staging cloudRECCE_CLOUD_API_HOST_STAGING— staging cloud API URLTest plan
RECCE_CLOUD_TOKEN_STAGINGsecret andRECCE_CLOUD_API_HOST_STAGINGvariable in repo settingsResolves: DRC-3244
🤖 Generated with Claude Code