Repository navigation
Conversation
ianheggie-oaf
left a comment
There was a problem hiding this comment.
The fix works against the current twfy schema. CI only passed on the old regex because spec/fixtures/schema.sql predates the proof column on hansard (twfy af5b87be), so CI never sees a ; inside a comment.
Could you refresh the fixture by re-copying db/schema.sql from an up-to-date twfy checkout? It's the schema CI always uses, and the proof column's comment turns it into a regression test for this fix. The other difference is the new email_suppressions table, which is harmless.
Assisted-by: Claude Code:claude-opus-5-5
| sql = File.read(schema_file) | ||
| TABLES_NEEDED.map do |table| | ||
| sql[/CREATE TABLE `#{table}`.*?;/m] or raise "Table '#{table}' not found in schema.sql" | ||
| sql[/CREATE TABLE `#{table}`.*?;$/m] or raise "Table '#{table}' not found in schema.sql" |
There was a problem hiding this comment.
| sql[/CREATE TABLE `#{table}`.*?;$/m] or raise "Table '#{table}' not found in schema.sql" | |
| sql[/CREATE TABLE `#{table}`.*?;\r?$/m] or raise "Table '#{table}' not found in schema.sql" |
So a checkout with Windows line endings still matches, rather than running on into the next table.
ianheggie-oaf
left a comment
There was a problem hiding this comment.
I like it, but please update spec/fixtures/schema.sql so the CI tests test it, and add the suggested change to regexp in case someone updated schema with MS windows line endings in the future - a simple fix whilst we are here.
What and why
Fixes script for copying data to test, to cope with
;in commentsType of change
Assisted By: My brain