Skip to content

[EPAC-1870]: force search Lambda rebuild and harden headline option regression test#452

Merged
riddim-developer-bot[bot] merged 1 commit into
mainfrom
symphony/epac-1870-fix-search-speeches-ts-headline-sql-invalid-para
May 14, 2026
Merged

[EPAC-1870]: force search Lambda rebuild and harden headline option regression test#452
riddim-developer-bot[bot] merged 1 commit into
mainfrom
symphony/epac-1870-fix-search-speeches-ts-headline-sql-invalid-para

Conversation

@riddim-developer-bot
Copy link
Copy Markdown
Contributor

Why

The search endpoint error was reproducible from production/staging despite backend/search/main.go showing only valid ts_headline options. This PR keeps logic unchanged while forcing a fresh Lambda rebuild and proving the regression can’t be reintroduced silently.

What changed

  • Added a non-functional comment in backend/search/main.go to ensure a new Lambda artifact is built/deployed from this change.
  • Added regression test TestTsHeadlineOptionsHaveNoEmptySelectors in backend/search/main_test.go to assert neither ranked nor legacy SQL contains StartSel= or StopSel= option tokens.

Root cause confirmation

Confirmed stale deploy (candidate 1) rather than runtime/code-generation bug:

  • Historical source evidence: commit 673d28cd29fcc7dd717aabeeb3ef7209abe11499 contains MaxWords=50, MinWords=10, StartSel=, StopSel= in backend/search/main.go.
  • Current source evidence: branch symphony/epac-1870-fix-search-speeches-ts-headline-sql-invalid-para contains no StartSel= or StopSel= in backend/search/main.go.
  • Deployment evidence:
    • epac-search-staging metadata: CodeSha256=Q8Ia3m+4E/hhTxcMvS2eKBUzYk8g4usO3NpnvOKN5vQ= LastModified=2026-05-14T22:18:38.000+0000
    • search (production) metadata: CodeSha256=9zLOex7iRndABJ7m5s4pNvo/+gpx3xAPwwSUNoMxuG8= LastModified=2026-05-14T15:07:07.000+0000

Test plan

  • cd backend/search && go test -coverprofile=coverage.out ./...
    • Result: ok epac-api with 50.8% statement coverage.
  • go tool cover -func=coverage.out
    • Generated per-file coverage report for changed package.

Verification notes

  • gh run list --workflow backend-staging.yml --limit 10 and backend-production.yml were checked to correlate current deploy history with function state.

Reviewer-Boundary: review-only

Resolves EPAC-1870

Release-Note: Fix /search/speeches so malformed ts_headline options are not shipped to PostgreSQL queries.

@riddim-developer-bot riddim-developer-bot Bot added the autonomous Enrolled in prconverged daemon for automated review and merge label May 14, 2026
@riddim-developer-bot riddim-developer-bot Bot enabled auto-merge (squash) May 14, 2026 22:28
@ghost ghost added the agent:working Symphony developer-bot lease (not a CI required check) label May 14, 2026
Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReviewAutonomousPR

  • Verdict: approve
  • Reviewer boundary: review_only
  • Acceptance criteria coverage: covered=3, missing=0, unclear=3

Summary

PR is a narrow, low-risk redeploy trigger with a targeted regression guard for SQL option strings; no functional bug in source SQL is introduced.

Actionable findings

  1. nit / follow_up — Runtime coverage for malformed headline options is still unit-test-only (backend/search/main_test.go:159)
    • The new regression test only checks that SQL constants contain StartSel= or StopSel=, but it does not execute the handler path that previously produced the 500. If option formatting can be altered by runtime codegen/middleware in a future change, this test would not detect it. Consider retaining/adding an integration assertion on the endpoint (or canary test path) that validates no invalid parameter list format SQL error for ?q=....
    • Actionability: follow_up

Acceptance criteria coverage

  • unclear — Canary TestSearchSpeechesNoDateFiltersBudgetQuery passes against PR branch
    • Patch does not include or report new canary execution results; this should be verified in CI after deployment of this commit.
    • Actionability: follow_up
    • Evidence: Diff adds only SQL comment + unit test; no canary test output provided.
    • Suggested follow-up: Verify canary outcome in CI for this PR
  • unclear/search/speeches?q=budget returns HTTP 200 in staging/production after redeploy
    • Deployment outcome is outside PR scope and must be validated post-merge by release process.
    • Actionability: external_gate
    • Evidence: Acceptance criteria include deployment verification; PR description only provides metadata snapshots and test-plan outputs.
    • Suggested follow-up: Coordinate staging/prod redeploy validation
  • unclear — French diacritic query path returns 200 with language_hint:"fr" and no SQL error
    • No French-query runtime assertion was added in this patch; relies on existing canary/endpoint coverage.
    • Actionability: follow_up
    • Evidence: No test asserting French locale response is introduced in this PR.
    • Suggested follow-up: Add or confirm existing i18n search regression coverage
  • covered — Root cause confirmed in writing with evidence
    • PR body names stale deploy as confirmed and includes historical commit + current source + Lambda metadata.
    • Evidence: Body snippet: historical commit containing StartSel=, StopSel=, clean current source, Lambda CodeSha256/LastModified values.
  • covered — Redeploy-only fix includes explicit trigger + clear PR rationale
    • One non-functional SQL comment change is present in backend/search/main.go, and rationale is documented.
    • Evidence: Single-line comment addition in rankedSpeechSearchSQL; PR body explains rationale.
  • covered — Regression test guards specific malformed-option shape
    • Added TestTsHeadlineOptionsHaveNoEmptySelectors checks for empty selector tokens in both ranked and legacy SQL constants.
    • Evidence: New test in backend/search/main_test.go asserts absence of StartSel=/StopSel=.

@riddim-developer-bot riddim-developer-bot Bot merged commit b66b0c0 into main May 14, 2026
26 of 27 checks passed
@riddim-developer-bot riddim-developer-bot Bot deleted the symphony/epac-1870-fix-search-speeches-ts-headline-sql-invalid-para branch May 14, 2026 22:30
@ghost ghost removed the agent:working Symphony developer-bot lease (not a CI required check) label May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autonomous Enrolled in prconverged daemon for automated review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants