Skip to content

ci: run the upstream SQL tests on a pull request with the tests:run-core-sql label - #749

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, #747) runs nightly, by hand, and on pull requests that change the harness or the workflow. A pull request that changes only a client does not start it. This PR adds the tests:run-core-sql label, which runs the harness on any pull request, 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: $/…, the commit that runs) 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. 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 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 pull request started.
  • README.md (CI) and AGENTS.md (rule 2: check a client fix with the label) document the label.

The label exists in the repository now.

No changelog fragment: CI only, no change to a client.

Checklist

  • actionlint 1.7.12 (on a copy with ./ instead of $/, which actionlint does not know yet; it reports the same for tests-cloud-tcp-label.yml on main) and zizmor 1.29.0 (high severity on the merge tree, as zizmor.yml does: no findings; all severities on the new file: no findings).
  • The label run on this pull request passes and removes the label: run 44555412422 (build, harness tests, {http, tcp} × 8 shards: all passed; then Remove the tests:run-core-sql label). The path-triggered run of the same pull request ran at the same time and was not cancelled.

🤖 Generated with Claude Code


Note

Low Risk
CI-only workflow and documentation changes; no client or harness runtime behavior changes.

Overview
Adds a tests:run-core-sql label path so maintainers can run the upstream SQL harness on pull requests that do not touch the test runner (e.g. client-only fixes).

A new upstream-sql-tests-label.yml listens for pull_request labeled events, reuses upstream-sql-tests.yml via workflow_call, and runs a separate remove-label job so the test job keeps read-only permissions. Fork PRs still run tests but skip automatic label removal.

upstream-sql-tests.yml gains a workflow_call trigger only. README.md (CI) and AGENTS.md (rule 2) document when and how to apply the label.

Reviewed by Cursor Bugbot for commit 6897a75. Bugbot is set up for automated code reviews on this repo. Configure here.

…ore-sql label

upstream-sql-tests.yml runs only for pull requests that change the harness
or the workflow. The paths filter of its pull_request trigger also applies
to a labeled event, so a label cannot start it. The new workflow
upstream-sql-tests-label.yml starts on the labeled event, calls
upstream-sql-tests.yml through a new workflow_call trigger, and removes the
label when the run ends, as the tests:run-cloud label does.

It uses 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 job skips forks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 15:29
@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

The label-triggered SQL test workflow changes have no active review issues.

No open issues 🎉

What changed in this PR

This PR adds an on-demand CI trigger for the upstream SQL test harness, so client-only pull requests can test both the HTTP and native TCP clients. It does not change client code.

Changes:

  • Add a tests:run-core-sql label workflow that calls the existing harness workflow.
  • Enable reusable workflow calls and remove the label after same-repository runs.
  • Document reruns and manual label removal for fork pull requests.
File Description
tests/​clickhouse-test-runner/​README.md Explain label-triggered runs, reruns, and fork handling.
tests/​clickhouse-test-runner/​AGENTS.md Document use of the label to check client fixes.
.github/​workflows/​upstream-sql-tests.yml Add the reusable workflow_call trigger.
.github/​workflows/​upstream-sql-tests-label.yml Add label-triggered harness execution and label cleanup.

Review effort: Balanced

@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
@github-actions

Copy link
Copy Markdown

AI review gate — Human approval in place of AI review

Approved on the head commit by ccoltx (write access, not the author), standing in for the AI review:

  • Cursor Bugbot has not posted a review on this commit yet.

What to do:

  • Nothing to do yet if the review is running. The gate turns green when it finishes clean.
  • No review showing up? Post bugbot run as a new top-level PR comment. If that does nothing, Bugbot is probably not enabled for this repository: ask a repository administrator.

Evaluated at 6897a75d. This required workflow does not re-run on its own once the AI review later concludes — check the Cursor Bugbot check on this commit directly for its current state.

@ccoltx
ccoltx merged commit 9267d72 into main Nov 19, 2026
45 checks passed
ccoltx pushed a commit to ClickHouse/clickhouse-js that referenced this pull request Nov 19, 2026
…bel (#1163)

## 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

- [x] 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).
- [x] The label run on this PR passes and removes the label: [run
44557508132](https://github.com/ClickHouse/clickhouse-js/actions/runs/44557508132)
(`{passthrough, rowbinary} × 10` shards: all passed; then
`remove-label`). The path-triggered run of the same PR ([run
44557496068](https://github.com/ClickHouse/clickhouse-js/actions/runs/44557496068))
ran at the same time, was not cancelled, and passed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Polyglot AI <293096396+polyglotAI-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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