Skip to content

Downcase emails on write to DDB prod#5098

Merged
lukaszgryglicki merged 2 commits into
mainfrom
unicron-downcase-user-emails-prod
Jun 25, 2026
Merged

Downcase emails on write to DDB prod#5098
lukaszgryglicki merged 2 commits into
mainfrom
unicron-downcase-user-emails-prod

Conversation

@lukaszgryglicki

Copy link
Copy Markdown
Member

Signed-off-by: Lukasz Gryglicki lgryglicki@cncf.io

Assisted by OpenAI

Assisted by GitHub Copilot

Assisted by Claude

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)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_emails in 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.

Comment thread cla-backend-go/users/repository.go
Comment thread cla-backend-go/users/repository.go
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)
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9c2d8579-e835-4f3f-9233-705902607843

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch unicron-downcase-user-emails-prod

Comment @coderabbitai help to get the list of available commands.

@lukaszgryglicki lukaszgryglicki merged commit 04abb7b into main Jun 25, 2026
12 checks passed
@lukaszgryglicki lukaszgryglicki deleted the unicron-downcase-user-emails-prod branch June 25, 2026 10:28
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.

3 participants