Skip to content

ci: run the upstream SQL tests on a PR with the tests:run-core-sql label - #1163

Merged
ccoltx merged 1 commit into
mainfrom
polyglot/core-sql-tests-label
Nov 19, 2026
Merged

ccoltx merged 1 commit into
mainfrom
polyglot/core-sql-tests-label

Conversation

@polyglotAI-bot

@polyglotAI-bot polyglotAI-bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

upstream-sql-tests.yml (the core SQL test harness) runs nightly, by hand, and on pushes and PRs that change tests/clickhouse-test-runner/** or the workflow. A PR that changes only a client does not start it. This PR adds the tests:run-core-sql label, which runs the harness on any PR, as tests:run-cloud does for the Cloud tests.

  • New workflow upstream-sql-tests-label.yml: it starts on pull_request labeled, calls upstream-sql-tests.yml (uses: ./.github/workflows/upstream-sql-tests.yml) when the label is tests:run-core-sql, and then removes the label. To run the tests again, add the label again.
  • upstream-sql-tests.yml gets a workflow_call: trigger and one header comment. Nothing else changes in it. A second workflow is necessary because the paths filter of the pull_request trigger also applies to a labeled event.
  • The trigger is pull_request, not pull_request_target: the tests need no secrets, and the code of a fork runs with a read-only token. That token cannot remove the label, so the remove-label job skips forks (the README says to remove the label by hand there).
  • The calling job has permissions: {}, the same as the top-level permissions of upstream-sql-tests.yml. Only the separate remove-label job gets pull-requests: write, so the PR code never runs with a token that can write.
  • In a called run, github.event.inputs.upstream_ref is empty, so the pinned UPSTREAM_REF applies.
  • The label run has its own concurrency group (github.workflow is the name of the calling workflow), so it does not cancel a run that a push to the same PR started.
  • The harness README.md (CI) documents the label.

The label exists in the repository now. The same label and workflow are in ClickHouse/clickhouse-cs#749.

No changelog entry: CI only, no change to a package.

Checklist

  • Prettier 3.9.10 (prettier --check on the changed files), actionlint 1.7.12 (both workflows: no findings), zizmor 1.29.0 (new workflow: no findings).
  • The label run on this PR passes and removes the label: run 44557508132 ({passthrough, rowbinary} × 10 shards: all passed; then remove-label). The path-triggered run of the same PR (run 44557496068) ran at the same time, was not cancelled, and passed.

🤖 Generated with Claude Code

The `paths` filter of the pull_request trigger of upstream-sql-tests.yml also
applies to a `labeled` event, so a PR that changes only a client cannot start
the harness. Add upstream-sql-tests-label.yml: on `pull_request` `labeled`, it
calls upstream-sql-tests.yml (new `workflow_call:` trigger) when the label is
`tests:run-core-sql`, and then removes the label, as `tests:run-cloud` does for
the Cloud tests. Document the label in the harness README (CI).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@polyglotAI-bot
polyglotAI-bot requested review from a team, kavirajk and mshustov as code owners November 19, 2026 15:40
Copilot AI balanced review requested due to automatic review settings November 19, 2026 15:40
@polyglotAI-bot polyglotAI-bot added the tests:run-core-sql Run the ClickHouse core SQL tests (upstream-sql-tests.yml) on this PR (removed after the run) label Nov 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the changes enabling label-triggered SQL test runs.

No open issues 🎉

What changed in this PR

Adds label-triggered runs of the upstream SQL test harness for PRs that do not match its existing path filters. Changes are limited to CI and documentation; package behavior and public APIs are unchanged.

Changes:

  • Adds a tests:run-core-sql label workflow that calls the existing harness.
  • Keeps test jobs without write permissions and isolates label removal in a separate job that skips fork PRs.
  • Documents how to trigger runs again, including manual label removal for forks.
File Description
tests/​clickhouse-test-runner/​README.md Documents label-triggered runs and fork handling.
.github/​workflows/​upstream-sql-tests.yml Adds a reusable-workflow trigger and explanatory comment.
.github/​workflows/​upstream-sql-tests-label.yml Adds the label trigger, harness call, and label cleanup job.

Review effort: Balanced

@codecov

codecov Bot commented Nov 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot removed the tests:run-core-sql Run the ClickHouse core SQL tests (upstream-sql-tests.yml) on this PR (removed after the run) label Nov 19, 2026
@security-ai-gate-reviewer

Copy link
Copy Markdown

AI review gate — auto-approval withheld

The AI review gate is green, but the approver did not approve 210999c0: it changes paths that always require a human reviewer: .github/workflows/upstream-sql-tests-label.yml, .github/workflows/upstream-sql-tests.yml (commit 210999c has no verified signature; commit 210999c has no verified signature).

What to do: ask someone with write access who is not the PR author to approve this pull request.

History (latest 5 heads, newest first)

  • 210999c01fdd withheld — it changes paths that always require a human reviewer: .github/workflows/upstream-sql-tests-label.yml, .github/workflows/upstream-sql-tests.yml (commit 210999c has no verified signature; commit 210999c has no verified signature)

@ccoltx
ccoltx merged commit a6c1319 into main Nov 19, 2026
106 of 107 checks passed
@ccoltx
ccoltx deleted the polyglot/core-sql-tests-label branch November 19, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants