Repository navigation
[FEATURE] Add SHOW CONTRIBUTORS method #320
Description
Feature Description
Add a hidden method in stackql to credit contributors to the project - a nod to the easter-egg credits embedded in old-school software (WordPerfect, Lotus 1-2-3, dBase IV). The command doubles as a contribution leaderboard: star the repo, contribute to it, get on the leaderboard.
Credits are limited to human contributors who have starred the repository; automated accounts (dependency bots, CI identities, and AI coding agents) are excluded.
Expected Behaviour
Available through all invocation mechanisms (shell, exec, srv, and the MCP server), intentionally undocumented (it is an easter egg):
SHOW CONTRIBUTORS;returns a single contributor column, ordered by number of contributions descending:
+----------------------+
| contributor |
+----------------------+
| general-kroll-4-life |
| jeffreyaven |
| yunchengyang515 |
| jthegedus |
| ... |
+----------------------+
Optionally:
SHOW EXTENDED CONTRIBUTORS;additionally returns a contributions count column, consistent with the existing plain-vs-EXTENDED convention on other SHOW methods.
Design Notes
No changes to stackql-parser are required. The grammar (go/vt/sqlparser/sql.y, verified at v0.0.16-alpha02) retains the vitess catch-all show rule:
| SHOW extended_opt id_or_var like_or_where_opt
CONTRIBUTORS lexes as an identifier, so SHOW CONTRIBUTORS;, SHOW EXTENDED CONTRIBUTORS;, and SHOW CONTRIBUTORS LIKE ...; all parse today, producing &Show{Type: "contributors"}. The statement currently fails in analysis with unsuported node type: 'contributors'.
Implementation is modeled on the existing SHOW VERSION, which is provider-less and statically sourced. Touch points in stackql/stackql:
internal/stackql/primitivegenerator/primitive_generator.go->inferProviderForShow: addcase "CONTRIBUTORS":(no provider required, as perVERSION)internal/stackql/primitivegenerator/statement_analyzer.go->analyzeShow: addcase "CONTRIBUTORS":(no further analysis required)internal/stackql/primitivebuilder/shortcuts.go->NewShowInstructionExecutor: addcase "CONTRIBUTORS":invoking a newbuildContributorsShowOutput(extended), implemented alongsidebuildVersionShowOutput- New leaf package
internal/stackql/contributors:contributors.csvcompiled in viago:embed, parsed once (sync.Once); embed precedent already exists inpkg/mcp_server/embedded_content.go([FEATURE] Add embedded content framework for MCP server instructions, prompts and resources #696)
Additional implementation notes:
- Result row order follows sorted result-set keys in
util.PrepareResultSet, so rows must be keyed with zero-padded indices (fmt.Sprintf("%06d", i), as per theMETHODScase) to preserve leaderboard order - No changes are required in
planbuilder(handleShowfalls through to the generic metadata primitive) or indbmsinternal(the housekeeping show regex does not matchcontributors); this is whysrv(wire protocol clients) and the MCP server work from the single implementation -ldflags(proposed in the original issue body) is not used;go:embedof a vendored CSV is the delivery mechanism, and the build remains hermetic (no network access at build time)
Data Pipeline
contributors.csv is generated by a scheduled workflow (plus workflow_dispatch, optionally also as a release-prep step) which dogfoods stackql via the stackql-exec GitHub Action, authenticated with the workflow token:
SELECT c.login AS contributor, c.contributions
FROM github.repos.contributors c
INNER JOIN github.activity.repo_stargazers s
ON s.login = c.login
WHERE c.owner = 'stackql' AND c.repo = 'stackql'
AND s.owner = 'stackql' AND s.repo = 'stackql'
AND c.type = 'User'
AND c.login NOT LIKE '%[bot]'
AND c.login NOT IN ('<machine-user-denylist>')
ORDER BY c.contributions DESCFilter rationale:
- The stargazer join is intentional (the star nudge); it also structurally excludes GitHub App accounts, which cannot star repositories
c.type = 'User'andNOT LIKE '%[bot]'exclude app-based automation generically; GitHub Apps (including AI coding agents - Claude, Codex, Copilot, Cursor, Devin, Jules, and whatever comes next) authenticate as<app-slug>[bot], so agent accounts are excluded without maintaining per-vendor slugs- The
NOT INdenylist covers machine accounts operating as regular user accounts (e.g. PAT-driven CI identities); it lives in the workflow, so additions do not require a code change
The workflow applies a guard after stackql-exec and before committing:
- name: Guard contributor count
run: |
count=$(tail -n +2 contributors.csv | wc -l)
if [ "$count" -le 20 ]; then
echo "::error::contributor query returned ${count} rows (<= 20), refusing to update contributors.csv"
exit 1
fiThis protects against an API failure or truncated result set replacing a healthy credit list with an empty or partial one. On success, the workflow opens a PR updating contributors.csv, so every change to the credit list is auditable via normal review. Each release snapshots the leaderboard at build time - frozen credits, in the spirit of the original easter eggs.
The single CSV (contributor,contributions) serves both the plain and EXTENDED forms.
Testing
- Robot functional tests alongside the existing
Show Versioncases intest/robot/functional/stackql_from_cmd_line.robot(andmcp.robot): assert thecontributorheader renders and known handles are present - Go unit test covering the embed/parse in
internal/stackql/contributors
Acceptance Criteria
-
SHOW CONTRIBUTORS;returns thecontributorcolumn, descending by contributions, inshell,exec, andsrvmodes -
SHOW EXTENDED CONTRIBUTORS;additionally returnscontributions - Contributor list is vendored as CSV and compiled in via
go:embed; no network access at build time - Generation workflow dogfoods
stackql-exec, restricts results to human contributors who have starred the repo, and fails if 20 or fewer rows are returned - Robot functional coverage added
- Not documented in
stackql-docs(easter egg)
Out of Scope (for now)
LIKE/WHEREfiltering onSHOW CONTRIBUTORS(parses today via the catch-all rule; ignored in v1)- Aggregating contributions across other
stackqlorg repositories
Activity
yunchengyang515 commentedon Oct 27, 2023
Will have a look soon
adkol commentedon Nov 8, 2023
Hello, I would like to work on this. Is there a way to claim it?
jeffreyaven commentedon Nov 8, 2023
Hi @adkol had another dev working on this one, would you be able to pick up one of the other ones, a bunch of unit tests which would be easier to get started with, let us know
v0.11 release prep: --output otel inventory snapshots (#738), SHOW CO…