Repository navigation
fix(catalog): record a snippet call as a snippet_call edge to the SNIPPET (#2017) - #2018
Merged
Merged
Conversation
…PPET (#2017) A Forms$SnippetCall stores its snippet under "Form", the key a page action uses for its page, and scanWidgetAllRefs read every Form as a page. Every snippet call became a show_page edge to a PAGE and no refs row ever had TargetType SNIPPET: on FactoryManagement (11.16) 311 of them, 22 from layouts, so a query for what uses a snippet by type found nothing. widgets gains SnippetRef (snippet_ref in Starlark), refs gains the snippet_call kind, and LAYOUT joins RefSourceObjectTypes now that layouts make edges (#1302). show callers counts the new kind and SEC012 walks it, both of which had relied on the show_page mislabel. Schema 35. Co-Authored-By: Claude Opus 5.5 <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.
Closes #2017.
Problem
A
Forms$SnippetCallstores its snippet underForm, the same key a page action uses for its page.scanWidgetAllRefsreads everyFormas a page, so each snippet call was recorded as ashow_pageedge to aPAGE. Norefsrow ever hadTargetType = 'SNIPPET'. As a result, an architecture report concluded that the catalog records no references from layouts.Change
widgets_data.SnippetRef: new column, also exposed assnippet_refin Starlark.snippet_calledges: each snippet call is now asnippet_calledge withTargetType = 'SNIPPET', from a page, a snippet or a layout. The new kind is inRefKinds, and SNIPPET is inRefTargetObjectTypes.RefSourceObjectTypes: layouts have made edges since [up#1311] Catalog: the page's own Class/Style and the widgets of layouts are missing (widgets() covers pages and snippets only) #1302.show callersnow countssnippet_call. Without that, every snippet would read as uncalled.snippet_call. Its test fixture encoded the oldshow_page/PAGEshape.Evidence
TestSnippetCallIsASnippetEdge_Issue2017covers a layout and a page that each call a snippet. A button that opens a real page is the control and staysshow_page. Before the fix the test failed with the reported symptom:kind:show_page targetType:PAGEandPageRef = "L.SNIP_Tabbar".Formrouting makes the catalog test fail again. Reverting SEC012's traversal makesTestReachablePageRead_ReachabilityMatchesMxbuildfail, becauseP_FromSnippetis no longer reached.Snippet calls recorded as
snippet_calledges to a SNIPPET:show_pageedges that point at a snippet: 0. Every othershow_pagecount is unchanged.Snippets with no inbound edge of any kind: 35 on both builds, so no snippet lost its references.
mxcli refsandshow callersonEvora_UI.SNIP_FeedbackWidgetlist its six layouts assnippet_call.Lint output is identical: 254 findings with the built-in rules and 1834 with the 31 bundled Starlark rules.
make ci-localpasses exceptcheck-skill-pack-js, which needsnode, andnodeisn't installed in this container. The targets after it pass when run on their own.🤖 Generated with Claude Code