Downcase emails on write to DDB prod#5098
Conversation
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot) Assisted by [Claude](https://claude.ai)
There was a problem hiding this comment.
Pull request overview
This PR standardizes email casing/formatting by lowercasing (and trimming in several call sites) before persisting or querying user_emails in DynamoDB, and adds/updates utility scripts to help investigate logs and normalize existing stored emails.
Changes:
- Normalize emails (lowercase/trim/dedupe) before writing
user_emailsin the Go backend, and normalize lookup inputs for email-based queries. - Apply email normalization in additional write paths (legacy handlers, approval list, signature approval removal).
- Improve log lookup helper robustness and add a utility script to downcase existing emails in DynamoDB.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/search_aws_log_group.sh | Captures AWS CLI output to a temp file to correctly distinguish aws failures from jq failures. |
| utils/lookup_all_logs.sh | Enables set -euo pipefail so helper failures abort instead of being masked. |
| utils/downcase_emails.sh | New script to scan cla-*-users and update user_emails with normalized values (optionally applied). |
| cla-backend-legacy/internal/api/handlers.go | Lowercases/trims email values before writing user_emails in legacy v2 handlers. |
| cla-backend-go/users/repository.go | Adds centralized email normalization on create/update, and normalizes email input for lookup. |
| cla-backend-go/signatures/repository.go | Normalizes emails before using them in approval-list removal flows. |
| cla-backend-go/approval_list/repository.go | Normalizes requester email before storing user_emails on approval requests. |
| .gitignore | Ignores *user_emails.json artifacts generated by the new normalization script. |
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot) Assisted by [Claude](https://claude.ai)
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Signed-off-by: Lukasz Gryglicki lgryglicki@cncf.io
Assisted by OpenAI
Assisted by GitHub Copilot
Assisted by Claude