Skip to content

Add PhoneLookupMode config and phone-lookup annotations#509

Open
fbm3307 wants to merge 4 commits into
codeready-toolchain:masterfrom
fbm3307:twilio-la
Open

Add PhoneLookupMode config and phone-lookup annotations#509
fbm3307 wants to merge 4 commits into
codeready-toolchain:masterfrom
fbm3307:twilio-la

Conversation

@fbm3307
Copy link
Copy Markdown
Contributor

@fbm3307 fbm3307 commented Jun 4, 2026

  • Add PhoneLookupMode (disabled/log/enabled) to RegistrationServiceVerificationConfig

related Prs:
Registration-Service: codeready-toolchain/registration-service#595
toolchain-Common: codeready-toolchain/toolchain-common#532
host operator: codeready-toolchain/host-operator#1268
toolchain-e2e: codeready-toolchain/toolchain-e2e#1285

Description

  • Add PhoneLookupMode (disabled/log/enabled) to RegistrationServiceVerificationConfig
  • Add six phone-lookup annotation key constants to UserSignup
  • Regenerate deepcopy, openapi, CRD docs

Part of the Twilio Lookup api feature — see [sandbox-sre#3192]

Checks

  1. Did you run make generate target? yes

  2. Did make generate change anything in other projects (host-operator, member-operator)? yes

  3. In case of new CRD, did you the following? no

  4. In case other projects are changed, please provides PR links.

Assisted by : Cursor

Summary by CodeRabbit

  • New Features

    • Added a phoneLookupMode setting for phone verification with modes: disabled, log, and enabled (default: log).
    • Capture and store phone lookup metadata: lookup result, carrier risk category, number-blocked flag, risk score, carrier name, line type, and a phone hash to optimize retries.
  • Documentation

    • API reference updated to describe the new field, allowed values, and default behavior.

- Add PhoneLookupMode (disabled/log/enabled) to RegistrationServiceVerificationConfig
- Add six phone-lookup annotation key constants to UserSignup
- Regenerate deepcopy, openapi, CRD docs

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Feny Mehta <fbm3307@gmail.com>
@fbm3307 fbm3307 requested review from alexeykazakov and metlos June 4, 2026 07:25
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 4, 2026

Walkthrough

This PR adds a new optional phoneLookupMode field to RegistrationServiceVerificationConfig (with deepcopy, OpenAPI, and docs updates) and adds exported annotation constants to record phone lookup results on UserSignup.

Changes

Phone Lookup Feature

Layer / File(s) Summary
Phone lookup configuration and schema
api/v1alpha1/toolchainconfig_types.go, api/v1alpha1/zz_generated.deepcopy.go, api/v1alpha1/zz_generated.openapi.go, api/v1alpha1/docs/apiref.adoc
New optional PhoneLookupMode *string added to RegistrationServiceVerificationConfig with kubebuilder enum (disabled, log, enabled) and default log. Autogenerated deepcopy updated to copy the new pointer field; OpenAPI schema includes phoneLookupMode; API reference docs document the field and enum.
UserSignup phone lookup annotations
api/v1alpha1/usersignup_types.go
New exported annotation key constants added for phone lookup result and Twilio-derived metadata: result, carrier risk, number blocked flag, risk score, carrier name, line type, and phone MD5 hash.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • codeready-toolchain/api#506: Also modifies api/v1alpha1/usersignup_types.go to add UserSignup annotation key constants for phone lookup outcomes.

Suggested reviewers

  • alexeykazakov
  • metlos
  • MatousJobanek
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main changes: adding PhoneLookupMode config and phone-lookup annotations, which aligns with the file modifications.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description provides all required sections from the template with clear answers to the checklist items and related PR links.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot added the feature New feature or request label Jun 4, 2026
- Add UserSignupPhoneLookupPhoneHashAnnotationKey for retry optimization
  (stores MD5 hash of last looked-up phone to skip redundant Lookup calls)

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Feny Mehta <fbm3307@gmail.com>
- Set default: "log" in CRD schema via +kubebuilder:default marker
- Addresses CodeRabbit review: documented default now enforced in schema

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Feny Mehta <fbm3307@gmail.com>
Comment thread api/v1alpha1/toolchainconfig_types.go Outdated
Signed-off-by: Feny Mehta <fbm3307@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 4, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants