CI: execute every report view against seeded rows (#1669) - #1677
Merged
Conversation
The SQL-validation workflow checked report.* views by OBJECT_ID only, which let two same-class bugs ship (#1635 Msg 245, #1666 sql_variant boxing) - views that compile and exist but only misbehave when rows flow through the projection. - ci_seed_report_sources.sql: one guarded representative row per collect/config table (generated from the installed schema; NOT NULL columns typed, nullable stay NULL, LOB columns COMPRESS()ed), plus hand-authored correlated pairs in the three change-history tables so the LAG/toggle views produce output rows. Empty-table guards make it inert anywhere data already exists. - ci_execute_report_views.sql: enumerate sys.views in the report schema, materialize each with SELECT * INTO (COUNT(*) would prune the projection and skip the per-row conversions), collect failures, THROW with the list. Dynamic enumeration covers new views on arrival and tolerates the collection-time-built query_snapshots pair. - ci_generate_seed_rows.sql: dev tool that regenerates the seed section after schema changes. - sql-validation.yml: two new steps after installation validation, on the full 2017/2019/2022/2025 matrix; this PR's own run exercises them end-to-end. Validated locally against a full install on SQL Server 2022: 41 views executed clean; a planted per-row Msg 245 poison view flips the sweep red and the THROW propagates through sqlcmd -b. Closes #1669 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
erikdarlingdata
enabled auto-merge
July 26, 2026 14:16
erikdarlingdata
disabled auto-merge
July 26, 2026 14:18
The generated section carried collect.query_stats_old - a leftover from the #1673 validation store the generator ran against, absent on a fresh CI install (Msg 208 across all four matrix legs). Dropped the leftover, cross-checked every seeded table name against install/* (54/54 present), and re-validated locally: seed twice clean, sweep 41 views / 0 failed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
erikdarlingdata
enabled auto-merge
July 26, 2026 14:19
…ew-execution # Conflicts: # CHANGELOG.md
SQL Server on Linux begins at 2017 - no 2016 container image exists - so the minimum-supported version cannot ride this workflow. Validated manually against the local SQL2016 box (13.0.6300) with the exact same sequence: full install surface clean, seeds clean, view execution sweep 41/41 with zero failures. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
Author
|
SQL Server 2016 coverage (the min-supported version the matrix can't include — SQL Server on Linux starts at 2017, so no 2016 container image exists): Ran the identical sequence manually against the local SQL2016 box (13.0.6300), scratch database, fixture
The matrix now carries a comment recording why 2016 is absent and that it's validated manually as part of release testing. |
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 #1669 — the follow-through on the #1635/#1666 bug class: views that compile and exist but only fail (or corrupt) when rows flow through the projection.
ci_validate_installation.sqlchecksreport.*byOBJECT_IDalone.What's added
.github/sql/ci_seed_report_sources.sql— one guarded representative row per collect/config table, generated from the installed schema (NOT NULL/non-identity/non-computed columns get type-appropriate values; nullable columns stay NULL so those branches execute; compressed-LOB columns get realCOMPRESS()payloads; timestamps land 5 minutes back so "today"/"last hour" windows include them). The three change-history tables get hand-authored correlated PAIRS (trace flag OFF→ON, server knob changed, database setting changed) so the LAG/toggle views emit actual rows. Every insert is guarded on the table being empty — re-runnable anywhere, inert on real data..github/sql/ci_execute_report_views.sql— enumeratessys.viewsin the report schema at run time and materializes each withSELECT * INTO—COUNT(*)would let the optimizer prune the projection and skip exactly the per-row conversions this exists to catch. Failures are collected and re-thrown as one error listing every broken view;sqlcmd -bturns that into a red job. Dynamic enumeration covers future views automatically and tolerates the collection-time-builtreport.query_snapshotspair being absent on a fresh install..github/sql/ci_generate_seed_rows.sql— dev tool (not run by CI) to regenerate the seed section after schema changes.sql-validation.yml— two new steps after installation validation, across the full 2017/2019/2022/2025 matrix. The workflow paths-filter includes.github/sql/**and the workflow file, so this PR's own checks run the new sweep end-to-end on all four versions.Validation
Msg 245(CONVERT(int, N'ci')over a seeded column — the [BUG]report.trace_flag_changesfails with bit-to-nvarchar conversion error #1635 shape, invisible over zero rows) flips the sweep to1 failedwith the view named, and the finalTHROWpropagates.report.daily_summary_v2.metric_valuerendersworst_query_hashas garbled text #1666's (valid execution, wrong value) still need targeted checks — this catches the throw-on-execute class.🤖 Generated with Claude Code