Skip to content

[FEATURE] Add SHOW CONTRIBUTORS method #320

Closed

Description

@jeffreyaven

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: add case "CONTRIBUTORS": (no provider required, as per VERSION)
  • internal/stackql/primitivegenerator/statement_analyzer.go -> analyzeShow: add case "CONTRIBUTORS": (no further analysis required)
  • internal/stackql/primitivebuilder/shortcuts.go -> NewShowInstructionExecutor: add case "CONTRIBUTORS": invoking a new buildContributorsShowOutput(extended), implemented alongside buildVersionShowOutput
  • New leaf package internal/stackql/contributors: contributors.csv compiled in via go:embed, parsed once (sync.Once); embed precedent already exists in pkg/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 the METHODS case) to preserve leaderboard order
  • No changes are required in planbuilder (handleShow falls through to the generic metadata primitive) or in dbmsinternal (the housekeeping show regex does not match contributors); this is why srv (wire protocol clients) and the MCP server work from the single implementation
  • -ldflags (proposed in the original issue body) is not used; go:embed of 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 DESC

Filter rationale:

  • The stargazer join is intentional (the star nudge); it also structurally excludes GitHub App accounts, which cannot star repositories
  • c.type = 'User' and NOT 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 IN denylist 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
    fi

This 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 Version cases in test/robot/functional/stackql_from_cmd_line.robot (and mcp.robot): assert the contributor header renders and known handles are present
  • Go unit test covering the embed/parse in internal/stackql/contributors

Acceptance Criteria

  • SHOW CONTRIBUTORS; returns the contributor column, descending by contributions, in shell, exec, and srv modes
  • SHOW EXTENDED CONTRIBUTORS; additionally returns contributions
  • 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/WHERE filtering on SHOW CONTRIBUTORS (parses today via the catch-all rule; ignored in v1)
  • Aggregating contributions across other stackql org repositories

Activity

  1. yunchengyang515 commented on Oct 27, 2023

    @yunchengyang515
    Contributor

    Will have a look soon

  2. adkol commented on Nov 8, 2023

    @adkol

    Hello, I would like to work on this. Is there a way to claim it?

  3. jeffreyaven commented on Nov 8, 2023

    @jeffreyaven
    MemberAuthor

    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

  4. self-assigned this
    on Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions