Repository navigation
feat(comment): name a query by its call site - #202
Merged
Merged
Conversation
There was a problem hiding this comment.
6 successful checks
Cost regression — No query got more expensive than the threshold allows
Untested data access — No changed data-access file without a test
New query — No new queries
New query with index recommendation — No new query ships an index recommendation
Schema drift — No schema changes
High-value nudge — No index or rewrite past the threshold
More details via MCP → get_ci_run({ runId: "019fb8ef-45ee-7606-9012-28e870912337" }) · view run · docs
3 queries read against main on assumed statistics of 10,000,000 rows per table. Sync production stats for costs measured against your real data.
veksen
force-pushed
the
feat-carry-tags-into-comment
branch
from
July 31, 2026 14:55
d600200 to
58a452c
Compare
veksen
force-pushed
the
feat-gates-first-comment
branch
from
July 31, 2026 14:59
8faddc0 to
c487582
Compare
veksen
force-pushed
the
feat-carry-tags-into-comment
branch
from
July 31, 2026 15:06
58a452c to
1988f84
Compare
veksen
force-pushed
the
feat-gates-first-comment
branch
from
July 31, 2026 15:27
c487582 to
ede76d2
Compare
veksen
force-pushed
the
feat-carry-tags-into-comment
branch
from
July 31, 2026 15:28
1988f84 to
a5f72e2
Compare
veksen
force-pushed
the
feat-gates-first-comment
branch
from
July 31, 2026 15:52
ede76d2 to
0326958
Compare
veksen
force-pushed
the
feat-carry-tags-into-comment
branch
from
July 31, 2026 15:53
a5f72e2 to
15d8a9f
Compare
compareRuns narrowed each query to a shape without tags, so the comment could only identify a query by hash. The run payload has carried func_name and file for every query all along. Carry the tags through the comparison and render them: a row reads CiRepository.findLatest with its file:line, not 9e545998. Co-Authored-By: Claude <noreply@anthropic.com>
veksen
force-pushed
the
feat-carry-tags-into-comment
branch
from
July 31, 2026 16:07
15d8a9f to
349fec3
Compare
veksen
added a commit
that referenced
this pull request
Jul 31, 2026
The gate roster expanded new-query-index and schema-drift but not regression-beyond-threshold, so a run blocked by regressions reported the count and none of the queries. The first live run hit exactly that: 9 queries got more expensive, nine rows missing. Regression rows also went through a preview builder that never attached the call site added in #202, so they would have named the SQL instead of the function. Co-Authored-By: Claude <noreply@anthropic.com>
veksen
added a commit
that referenced
this pull request
Jul 31, 2026
The gate roster expanded new-query-index and schema-drift but not regression-beyond-threshold, so a run blocked by regressions reported the count and none of the queries. The first live run hit exactly that: 9 queries got more expensive, nine rows missing. Regression rows also went through a preview builder that never attached the call site added in #202, so they would have named the SQL instead of the function. Co-Authored-By: Claude <noreply@anthropic.com>
veksen
added a commit
that referenced
this pull request
Jul 31, 2026
The gate roster expanded new-query-index and schema-drift but not regression-beyond-threshold, so a run blocked by regressions reported the count and none of the queries. The first live run hit exactly that: 9 queries got more expensive, nine rows missing. Regression rows also went through a preview builder that never attached the call site added in #202, so they would have named the SQL instead of the function. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
A comment row should tell you which code to open. Follow-up to #201, which built the gates-first layout but could only identify a query by hash.
What
Before:
9e545998 plans at 1,230, or 346 with these indexesAfter:
CiRepository.findLatest, withapps/api/src/ci/ci.repository.ts:210:8underneath.Every query in a run already carries SQLCommenter tags:
func_name,file,db_driver.GET /ci/runs/:idreturns them for all 101 queries on a recent run.compareRunsnarrowed each query to a shape that dropped them, so the surface where naming matters most was the one surface without a name.How
Read
compareRunsinsrc/reporters/site-api.tsfirst:RegressedQueryandImprovedQuerygaintags, copied from the current run's payload.newQueriesalready kept the full payload, so it needed nothing.callSiteingithub.tsturns those tags into a name and a file. Thefiletag arrives absolute from the runner (/home/runner/work/Site/Site/apps/...), so it is trimmed to a repo-relative path. A query with nofunc_namefalls back to its file, and one with no tags falls back to the SQL preview, which is what the comment showed before.Two limits worth knowing.
func_nameis not unique:CiRepository.findAllcovered 8 hashes on the run I checked, so two rows can share a label and differ; the link disambiguates. About 8 of 101 queries carry nofunc_nameat all.Tests
site-api.test.tscovers a regressed and an improved query keeping their tags.github.test.tscoverscallSitenaming a query, falling back to the file, and returning nothing when a run carries no tags. Full suite: 385 passing, 39 files, typecheck clean.