Skip to content

Add PhoneLookupMode config and phone-lookup annotations#509

Merged
fbm3307 merged 6 commits into
codeready-toolchain:masterfrom
fbm3307:twilio-la
Jun 9, 2026
Merged

Add PhoneLookupMode config and phone-lookup annotations#509
fbm3307 merged 6 commits into
codeready-toolchain:masterfrom
fbm3307:twilio-la

Conversation

@fbm3307

@fbm3307 fbm3307 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor
  • 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 configurable phoneLookupMode for phone verification (disabled, log, enabled; default: log).
    • Option to exclude specific countries from phone lookup checks.
    • Capture phone lookup metadata on signups: carrier risk category, number-blocked flag, and combined lookup details.
  • Documentation

    • API reference updated to describe the new setting, allowed values, default, and exclusion 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

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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
PhoneLookupMode type and docs
api/v1alpha1/toolchainconfig_types.go, api/v1alpha1/docs/apiref.adoc
Adds PhoneLookupMode string type and constants (disabled, log, enabled); documents the enum in the API reference.
RegistrationServiceVerificationConfig fields, deepcopy & OpenAPI
api/v1alpha1/toolchainconfig_types.go, api/v1alpha1/zz_generated.deepcopy.go, api/v1alpha1/zz_generated.openapi.go, api/v1alpha1/docs/apiref.adoc
Adds phoneLookupMode *PhoneLookupMode (kubebuilder enum, default log) and phoneLookupExcludedCountries []string to RegistrationServiceVerificationConfig; updates autogenerated deepcopy to copy the new pointer field; OpenAPI schema includes phoneLookupMode; API reference adds the field row.
UserSignup phone lookup annotations
api/v1alpha1/usersignup_types.go
Adds exported annotation key constants for phone lookup outcomes and Twilio-derived metadata on UserSignup.

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 accurately describes the main changes: adding PhoneLookupMode configuration and phone-lookup annotation constants to the codebase.
Description check ✅ Passed The description covers the main changes, includes answers to all required template questions, and provides links to related PRs in other projects.
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.

✏️ 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>
Comment thread api/v1alpha1/usersignup_types.go Outdated
Comment thread api/v1alpha1/toolchainconfig_types.go
- Replace 7 individual phone-lookup annotations with 3: carrier-risk,
  number-blocked, and a JSON details blob for supplementary data
- Add PhoneLookupExcludedCountries field (ISO 3166-1 alpha-2 codes)
  for configurable country exclusion from Twilio Lookup
- Regenerate deepcopy, openapi, and CRD reference docs

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Feny Mehta <fbm3307@gmail.com>
Comment thread api/v1alpha1/toolchainconfig_types.go
Comment thread api/v1alpha1/toolchainconfig_types.go Outdated
Comment thread api/v1alpha1/toolchainconfig_types.go Outdated
Comment thread api/v1alpha1/usersignup_types.go Outdated
- Remove unnecessary implementation detail comment from details annotation
- Simplify PhoneLookupExcludedCountries comment per reviewer suggestion
- Change listType from atomic to set for PhoneLookupExcludedCountries
- Regenerate openapi and docs

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Feny Mehta <fbm3307@gmail.com>
@sonarqubecloud

sonarqubecloud Bot commented Jun 8, 2026

Copy link
Copy Markdown

@fbm3307 fbm3307 merged commit c8f486b into codeready-toolchain:master Jun 9, 2026
5 of 6 checks passed
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.

3 participants