Skip to content

Retitle two survey sections - #127

Merged
mikaalnaik merged 2 commits into
mainfrom
mikaal/survey-section-titles
Sep 8, 2026
Merged

mikaalnaik merged 2 commits into
mainfrom
mikaal/survey-section-titles

Conversation

@mikaalnaik

Copy link
Copy Markdown
Contributor

Two section titles, in both surveys where they appear.

was now where
Five direct questions Five decisions facing the next council candidate questionnaire
A few more, if you have time Priorities and trade-offs candidate questionnaire + resident survey

"Five direct questions" described the form's shape rather than its subject. "A few more, if you have time" framed a third of the questionnaire as optional filler when it actually carries the trade-off questions.

The second title appears in both surveys — the resident set asks the same block — so both are renamed. Leaving them apart would put two names on one section across a pair meant to be read against each other. Say the word if you'd rather the live resident survey kept its old title.

Scope

Section titles are denormalized onto every question in the step, so this is 25 rows' worth of JSON across two files and no other field — verified: zero changed lines that aren't step_title.

The first pass at this escaped every non-ASCII character (), which parses identically but wrecks the file; redone with ensure_ascii=False.

Applied

Re-seeded locally: titles correct, and all 58 candidate responses came through still published, confirming the seed's status-preservation rule.

1295 tests, 0 failures.

Nothing poll-related is touched.

"Five direct questions" describes the form's shape rather than what it
asks about; "Five decisions facing the next council" says the subject.
"A few more, if you have time" framed a third of the questionnaire as
optional filler when it carries the trade-off questions, so it becomes
"Priorities and trade-offs".

The second title appears in both surveys — the resident set asks the
same block — and both are renamed, since leaving them apart would put
two names on one section across the pair they are meant to be read
against each other.

Titles are denormalized onto every question in the step, so this touches
25 rows' worth of JSON and no other field.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown

Greptile Summary

Retitles two questionnaire sections while preserving the surveys’ existing structure and question data. The accompanying test change isolates response-seed files during parallel test execution.

  • Renames the candidate questionnaire’s direct-questions section.
  • Applies the shared priorities-and-trade-offs title consistently across candidate and resident surveys.
  • Uses a per-test temporary directory for candidate-response seed fixtures and removes it during teardown.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
db/seeds/elections/toronto_2026_candidate_questionnaire.json Consistently updates the denormalized titles for both affected candidate-questionnaire sections without changing other question fields.
db/seeds/elections/toronto_2026_city_priorities.json Consistently renames the shared resident-survey section across all ten questions in that step.
test/tasks/elections_seed_test.rb Replaces a shared seed-fixture path with a unique per-test temporary directory and guarded teardown cleanup.

Reviews (2): Last reviewed commit: "Give each seed test its own fixture dire..." | Re-trigger Greptile

greptile-apps[bot]
greptile-apps Bot previously approved these changes Sep 8, 2026
The seed tests all wrote to one fixed path, tmp/test_candidate_responses
.json, while the suite runs across 14 processes. Tests raced to overwrite
the file another was about to read, so a case asserting on an off-roster
candidate saw a different test's payload instead.

It surfaced as a wrong assertion rather than an obvious collision, and
only sometimes — three green local runs said flake, CI said otherwise.
The varying assertion count across runs (4947, 4950, 4953) was the tell.

Dir.mktmpdir per test, removed in teardown. Repeated writes inside one
test still reuse the file, which the re-seed cases depend on. Six full
parallel runs now sit at 4953 assertions.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@greptile-apps
greptile-apps Bot dismissed their stale review September 8, 2026 20:54

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

@mikaalnaik
mikaalnaik merged commit f816c32 into main Sep 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant