Conversation
2984fc0 to
cda1cd1
Compare
There was a problem hiding this comment.
Pull request overview
Adds a canonical skill library under .github/skills/ for multiple coding agents, plus local developer-experience improvements (macOS test runner behavior, CPython interpreter discovery, local helper scripts, and ignore patterns).
Changes:
- Introduce shared agent “skills” docs under
.github/skills/and wire them into Claude/Codex/Copilot instruction entrypoints. - Improve local testing on macOS by avoiding
fork()-heavy multiprocessing in the SQL test runner. - Add local helper scripts (
start-local-proton.sh,local_coverage.sh) and related.gitignoreentries; improve CPython test setup to skip when Python 3.10 isn’t available.
Reviewed changes
Copilot reviewed 40 out of 41 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| utils/c++expr | Broaden root detection to include Proton and improve error text. |
| tests/queries_ported/shell_config.sh | Make --host stripping regex safer by switching to a raw string. |
| tests/queries_ported/0_stateless/00534_functions_bad_arguments.lib | Use $CLICKHOUSE_CLIENT for function list query generation. |
| tests/ported-clickhouse-test.py | Use threads on macOS to avoid fork-related failures; update Proton naming. |
| start-local-proton.sh | Add local Proton launcher with port auto-selection and log/runtime directory management. |
| src/CPython/tests/CPythonTest.h | Auto-discover Python 3.10 and skip CPython tests when missing. |
| src/Bootstrap/ServerDescriptor.cpp | Switch server port config keys to node.* namespace. |
| local_coverage.sh | Add local LLVM coverage build/test/report workflow script. |
| base/base/coverage.cpp | Silence Clang reserved-identifier warning around __llvm_profile_dump. |
| AGENTS.md | Add agent entrypoint reference. |
| .gitignore | Ignore coverage outputs and local runtime/worktree directories. |
| .github/skills/sql-usage/references/udf.md | Add SQL UDF/UDAF reference doc. |
| .github/skills/sql-usage/references/stream-types.md | Add stream types reference doc. |
| .github/skills/sql-usage/references/mv-production.md | Add production MV configuration reference doc. |
| .github/skills/sql-usage/references/join-patterns.md | Add JOIN patterns reference doc. |
| .github/skills/sql-usage/references/external-streams.md | Add external streams reference doc. |
| .github/skills/sql-usage/references/emit-policies.md | Add EMIT policy reference doc. |
| .github/skills/sql-usage/SKILL.md | Add SQL skill overview and routing rules. |
| .github/skills/review/SKILL.md | Add PR review skill checklist and workflow. |
| .github/skills/issue-workflow/references/workflow-detail.md | Add detailed issue workflow reference. |
| .github/skills/issue-workflow/SKILL.md | Add issue workflow skill overview. |
| .github/skills/create-worktree/SKILL.md | Add worktree creation skill with submodule reuse procedure. |
| .github/skills/cpp-coding/SKILL.md | Add C++ coding conventions and Proton-specific review checklist. |
| .github/skills/ci-diagnostics/SKILL.md | Add CI diagnostics skill and artifact navigation notes. |
| .github/skills/build-and-verify/references/streaming-verify.md | Add streaming verification testing pattern doc. |
| .github/skills/build-and-verify/references/mv-testing.md | Add MV testing pattern doc. |
| .github/skills/build-and-verify/references/join-testing.md | Add JOIN testing pattern doc. |
| .github/skills/build-and-verify/SKILL.md | Add build/test commands and pre-commit checklist. |
| .github/skills/architecture/references/stream-internals.md | Add stream internals architecture reference. |
| .github/skills/architecture/references/source-layout.md | Add source layout overview. |
| .github/skills/architecture/references/doc-links.md | Add primary documentation links. |
| .github/skills/architecture/references/cluster-deps.md | Add cluster dependency hierarchy reference. |
| .github/skills/architecture/SKILL.md | Add architecture skill overview and routing notes. |
| .github/skills/alloc-profile/scripts/analyze_alloc_profile.py | Add script to summarize collapsed allocation profiles. |
| .github/skills/alloc-profile/SKILL.md | Add allocation profiling skill overview. |
| .github/skills/.gitattributes | Add linguist attributes for skill docs. |
| .github/copilot-instructions.md | Point Copilot to the canonical skills and routing table. |
| .codex/skills | Link Codex skills directory to canonical .github/skills. |
| .codex/config.toml | Ensure Codex picks up the .codex/skills path. |
| .claude/skills | Link Claude skills directory to canonical .github/skills. |
| .claude/CLAUDE.md | Add Claude Code instructions and skill routing pointing at canonical skills. |
Comments suppressed due to low confidence (6)
tests/ported-clickhouse-test.py:1
pool.join()is called after the pool has gone out of scope in thewith closing(...)block in the new structure (and, importantly,closingonly callspool.close()on__exit__). As written,pool.join()is also effectively associated with a pool that may not have been properly closed before joining, which can raiseValueError: Pool is still runningdepending on execution flow. The simplest fix is to movepool.join()back outside thewith(like the previous version) soclosingcloses the pool first, or explicitly callpool.close()beforepool.join()while still inside thewith.
tests/ported-clickhouse-test.py:1- In the macOS thread-based path, submitted tasks' exceptions will be silently stored in their
Futures and never surfaced because the futures are not collected/awaited. This can lead to false-green runs where workers fail early but the main thread never sees the error. Preferexecutor.map(...)or store the returned futures and callfuture.result()(orconcurrent.futures.wait(...)+result()) to propagate exceptions.
src/Bootstrap/ServerDescriptor.cpp:1 - This change drops support for the legacy keys (
tcp.port,tcp_secure.port,http.port,https.port, etc.) that were previously accepted. If existing deployments/configs still use the legacy layout, they will now silently fall back to the defaults (8463/3218/...) and effectively ignore the configured ports. Consider keeping backward-compatible reads (e.g., checknode.*first, then fall back to the prior keys) so this isn’t a breaking config change.
src/CPython/tests/CPythonTest.h:1 - The buffer returned by
Py_DecodeLocalemust remain valid for the lifetime of the interpreter (Python expects the program name string to outlive initialization), but it also must be freed (typically withPyMem_RawFree) afterPy_Finalize(). The current code sets the program name and then discards the pointer, which causes a leak and makes it impossible to clean up correctly. Store the decodedwchar_t*in a static and free it inTearDownTestSuite()afterPy_Finalize(), or avoidPy_DecodeLocaleand use a managed lifetime approach consistent with the embedded-Python guidance.
tests/queries_ported/0_stateless/00534_functions_bad_arguments.lib:1 - Executing
$CLICKHOUSE_CLIENTinside Perlqx{...}runs via a shell command string; if$CLICKHOUSE_CLIENTcontains spaces/flags or unexpected characters, this can break the command or become a shell-injection vector in test environments. Prefer invoking a known-safe client binary (as before) or ensure$CLICKHOUSE_CLIENTis a single executable path and pass arguments safely (e.g., by avoidingqx{...}with interpolated shell strings).
local_coverage.sh:1 || trueforces_run_unit_teststo always succeed, which makes it impossible for callers to detect unit test failures (even if they try to capture$?). If you want to keep collecting coverage without aborting, capture the exit code into a variable and return it explicitly (or record it for the final summary) instead of unconditionally masking failures.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add .github/skills/ with 10 skills shared by all three agent platforms: alloc-profile, architecture, build-and-verify, ci-diagnostics, cpp-coding, create-worktree, issue-workflow, review, sql-usage Each skill has a SKILL.md and optional references/ for deep context. Entry-points per platform (single source of truth, no duplication): .claude/CLAUDE.md + .claude/skills -> .github/skills/ (Claude Code) .github/copilot-instructions.md (Copilot) .codex/config.toml + .codex/skills -> .github/skills/ (Codex) Also: fix ported-clickhouse-test.py on macOS, CPython auto-discovery, local_coverage.sh LLVM helper, minor .gitignore and shell fixes. Co-Authored-By: Claude <[email protected]>
cda1cd1 to
584b095
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 40 out of 41 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (4)
tests/queries_ported/0_stateless/00534_functions_bad_arguments.lib:1
qx{...}is executed by Perl, so$CLICKHOUSE_CLIENTis interpreted as a Perl scalar (likely empty), not the shell environment variable. This will run an invalid command and can cause the test to fail. Use a literal client binary (as before), or reference the environment explicitly via$ENV{CLICKHOUSE_CLIENT}/$ENV{...}(with appropriate quoting/escaping for spaces).
tests/ported-clickhouse-test.py:1- In non-main threads,
signal.signal(...)raisesValueError, which means theos.killpg(...)line is never reached (the exception happens before it). This can preventstop_tests()from actually terminating the test process group when running under the macOS thread executor. A minimal fix is to only callsignal.signal(...)in the main thread (or moveos.killpg(...)before those calls), so the process group termination still happens in worker threads.
src/Bootstrap/ServerDescriptor.cpp:1 - This removes support for the prior config keys (
tcp.port,tcp_secure.port,http.port,https.port, etc.). If existing deployments still use the legacy keys, they will silently fall back to defaults (or ignore configured secure ports), which is a breaking configuration change. Consider supporting both schemas (prefernode.*, fallback to legacy keys) or emitting a clear error/warning when legacy keys are detected.
src/CPython/tests/CPythonTest.h:1 Py_DecodeLocale()allocates memory that should be released withPyMem_RawFree()at teardown (and Python expects the program name buffer to remain valid for the interpreter lifetime). Right now the pointer is not stored anywhere, so it can’t be freed and will leak for the duration of the test process. Store the decoded pointer in a static and free it inTearDownTestSuite()afterPy_Finalize().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
- Fix gRPC config key in ServerDescriptor to match Server.cpp - Fix CPython Py_DecodeLocale memory leak with proper lifetime management - Fix macOS thread safety in stop_tests() by avoiding signal.signal() from worker threads - Rewrite 00534_functions_bad_arguments.lib from Perl to Bash to fix password @ interpolation bug - Add graceful skip for 99056 when external MySQL endpoint is unreachable Co-authored-by: Copilot <[email protected]>
Summary
Add a single canonical skill library under
.github/skills/so Claude Code, GitHub Copilot, and Codex all share the same expertise — no duplication.Skills:
alloc-profile·architecture·build-and-verify·ci-diagnostics·cpp-coding·create-worktree·issue-workflow·review·sql-usageAlso includes minor dev-experience fixes found during macOS local development (macOS test runner, CPython auto-discovery,
.gitignore, local helper scripts).Test plan
/skill-nametests/ported-clickhouse-test.pyruns parallel tests on macOS without fork errorsCloses #1125
🤖 Generated with Claude Code