Skip to content

[EPAC-2062]: build Hansard search index Lambda#600

Merged
riddim-developer-bot[bot] merged 1 commit into
mainfrom
symphony/epac-2062-build-hansard-search-index-lambda-for-one-time-c
May 25, 2026
Merged

[EPAC-2062]: build Hansard search index Lambda#600
riddim-developer-bot[bot] merged 1 commit into
mainfrom
symphony/epac-2062-build-hansard-search-index-lambda-for-one-time-c

Conversation

@riddim-developer-bot

Copy link
Copy Markdown
Contributor

Reviewer-Boundary: review-only

Resolves EPAC-2062

Why

Hansard search needs a v1 SQLite FTS5 artifact that can be generated on demand for the current parliamentary session and published to S3 for the search Lambda to consume.

What Changed

  • Added backend/hansard-search-index, a manually-invoked Go Lambda with Clean Architecture use case, domain values, and adapters for ourcommons.ca XML fetch/parse, SQLite FTS5 build, and S3 artifact publishing.
  • Registered the service in the backend manifest, deploy/test matrices, Terraform Lambda config, artifact env sync, and S3 IAM policy.
  • Added hansard-search-reindex.yml workflow dispatch for staging/production reindex runs with optional parliament/session overrides.
  • Added parser, source, S3, FTS5, use-case, and fixture integration tests; added the BuildIndex use case to the architecture catalog.
  • Extended staging smoke coverage to validate hansard-search/v1/manifest.json from S3 when present and skip with evidence before the first operator backfill.

Notes / Trade-offs

  • Session selection uses PARLIAMENT_NUMBER and SESSION_NUMBER environment variables, defaulting to 45/1. The manual workflow temporarily applies override inputs before invoking the Lambda and restores the prior environment afterward.
  • I verified the current ourcommons.ca convention against the existing downloader: https://www.ourcommons.ca/Content/House/451/Debates/001/HAN001-E.XML returns XML, while the issue example with HAN451-001-E.XML returns 404.
  • The IAM policy includes s3:GetObject and s3:PutObject; AWS authorizes HeadObject through s3:GetObject and does not expose a separate s3:HeadObject action.
  • This is larger than the usual preferred PR size because the Linear issue explicitly bundles the Lambda, schema contract, Terraform, workflow dispatch, smoke coverage, tests, README, and catalog entry into one one-repo change.

Verification

  • cd backend/hansard-search-index && go test ./...
  • cd backend/hansard-search-index && go test -tags=integration ./...
  • cd backend && make test package SERVICE=hansard-search-index
  • GOWORK=$PWD/backend/go.work go test ./backend/hansard-search-index/...
  • scripts/ci/check_go_dependency_rule.sh && scripts/ci/check_catalog_drift.sh
  • actionlint .github/workflows/backend-staging.yml .github/workflows/backend-production.yml .github/workflows/backend-tests.yml .github/workflows/backend-pr.yml .github/workflows/hansard-search-reindex.yml
  • terraform fmt -check -recursive infra/terraform
  • python3 -m py_compile scripts/ci/backend_staging_smoke.py
  • python3 scripts/ci/backend_staging_smoke.py --list | rg -n "hansard-search-manifest|health:default"
  • Coverage check before rebase: cd backend/hansard-search-index && go test -coverprofile=coverage.out ./... && go tool cover -func=coverage.out reported 68.3% total coverage.

Release note: None; backend/infrastructure only.

@riddim-developer-bot riddim-developer-bot Bot added the autonomous Enrolled in prconverged daemon for automated review and merge label May 25, 2026
@riddim-developer-bot
riddim-developer-bot Bot enabled auto-merge (squash) May 25, 2026 19:06
@riddim-developer-bot
riddim-developer-bot Bot merged commit 7d476db into main May 25, 2026
53 of 54 checks passed
@riddim-developer-bot
riddim-developer-bot Bot deleted the symphony/epac-2062-build-hansard-search-index-lambda-for-one-time-c branch May 25, 2026 19:09
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