fix: minor improvements to the lint manifest build - #188
Closed
utkarash2991 wants to merge 1 commit into
Closed
Conversation
The categories regex used a lazy `.*?` under DOTALL, so in a lint with an earlier `array[...]` the capture ran across it to the trailing `as categories` and returned the whole span as garbage categories. This hit 0023/0024/0025, whose SECURITY category came out as dozens of junk strings, which then dropped them from category-filtered Advisor runs. Match a single `array[...]` with `[^\]]*` and validate the result against the known category set so a malformed lint fails the build instead of shipping.
Contributor
Author
|
Folded into #187 as a single PR of minor build/CI fixes. |
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.
bin/compile_json.pypulls each lint'scategoriesout of its SQL with a greedyarray\[(.*?)\] ... as categoriesregex underre.DOTALL. In a lint that contains an earlierarray[...](a data array, not the categories projection), the lazy capture spans across it to the trailingas categoriesand returns the whole run as "categories".Three lints are affected because they have a data array above the projection:
0023_sensitive_columns_exposed,0024_rls_policy_always_true,0025_public_bucket_allows_listing. Instead of['SECURITY']they emit dozens of SQL fragments. Since consumers filter by category (mgmt-api doeslint.categories.includes(category)), a Security Advisor run requested by category through the Management API or MCP silently omits those three. Running all lints, as Studio does, is unaffected. This is in the 2026.08.0 and 2026.09.0 manifests.This matches a single
array[...]with[^\]]*(and dropsDOTALL), so the capture can't leave its own array, and validates every extracted category against the known set so a malformed lint fails the build loudly rather than shipping bad metadata — the behaviour the module docstring already describes.Verified by running
bin/compile_json.pyover all 29 lints: every lint now resolves toSECURITY/PERFORMANCE, and 0023/0024/0025 come out as['SECURITY'].Tracking: PSQL-1655