SANDBOX-1889: update PhoneLookupMode default fallback to disabled#604
Conversation
Change the runtime nil fallback in PhoneLookupMode() from PhoneLookupModeLog to PhoneLookupModeDisabled, and update the corresponding test assertion. Co-authored-by: Cursor <cursoragent@cursor.com>
WalkthroughThe default return value of ChangesPhoneLookupMode default behavior
Estimated code review effort: 1 (Trivial) | ~3 minutes Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pkg/configuration/configuration.go (1)
332-337: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftKeep the phone lookup default aligned across repos. Changing the nil fallback to
PhoneLookupModeDisablednow disagrees with theapitype comments/OpenAPI/CRD, andtoolchain-e2estill treats an unset value asPhoneLookupModeLog. Update the generated docs/CRD and the e2e wait helper in lockstep, or the default will be documented and tested inconsistently.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/configuration/configuration.go` around lines 332 - 337, The PhoneLookupMode default in VerificationConfig.PhoneLookupMode is now inconsistent with the API docs and toolchain-e2e expectations. Update the nil fallback and keep it aligned with the generated OpenAPI/CRD comments plus the e2e wait helper that currently assumes an unset value maps to PhoneLookupModeLog, so all repos use the same default behavior. Locate the related logic in VerificationConfig.PhoneLookupMode and the corresponding api type definitions/generated docs and toolchain-e2e helper, then change them together.Source: Linked repositories
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@pkg/configuration/configuration.go`:
- Around line 332-337: The PhoneLookupMode default in
VerificationConfig.PhoneLookupMode is now inconsistent with the API docs and
toolchain-e2e expectations. Update the nil fallback and keep it aligned with the
generated OpenAPI/CRD comments plus the e2e wait helper that currently assumes
an unset value maps to PhoneLookupModeLog, so all repos use the same default
behavior. Locate the related logic in VerificationConfig.PhoneLookupMode and the
corresponding api type definitions/generated docs and toolchain-e2e helper, then
change them together.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: de13c309-fd2a-433e-a92d-89978f997541
📒 Files selected for processing (2)
pkg/configuration/configuration.gopkg/configuration/configuration_test.go
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
codeready-toolchain/api(manual)codeready-toolchain/toolchain-common(manual)codeready-toolchain/host-operator(manual)codeready-toolchain/toolchain-e2e(manual)
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
- GitHub Check: GolangCI Lint
- GitHub Check: test
- GitHub Check: govulncheck
- GitHub Check: Build & push operator bundles & dashboard image for e2e tests
🧰 Additional context used
📓 Path-based instructions (1)
**
⚙️ CodeRabbit configuration file
-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.
Files:
pkg/configuration/configuration.gopkg/configuration/configuration_test.go
🔀 Multi-repo context
Linked repositories findings
codeready-toolchain/api
api/v1alpha1/toolchainconfig_types.go:400-405still documentsPhoneLookupModeas defaulting to"log"in the API type comments.api/v1alpha1/zz_generated.openapi.go:2950andapi/v1alpha1/docs/apiref.adoc:2340also describe the default as"log".- This is relevant because the PR changes the runtime nil fallback to
disabled, so API/docs now disagree with behavior.
codeready-toolchain/host-operator
config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml:361-370still hasphoneLookupModedefaultlogwith description saying it defaults to"log".- This CRD default may now conflict with the new nil fallback if consumers rely on the generated schema/defaulting behavior.
codeready-toolchain/toolchain-e2e
testsupport/wait/host.go:1728-1740hardcodesmode := toolchainv1alpha1.PhoneLookupModeLogwhenPhoneLookupModeis nil.- That helper encodes the old assumption that nil means
log, so it may now misreport/expect the wrong value in tests that leave the field unset. test/e2e/parallel/phone_lookup_test.go:40and nearby tests explicitly setPhoneLookupMode(Log|Enabled), so those cases are unaffected.
codeready-toolchain/toolchain-common
pkg/test/config/toolchainconfig.go:508-517only sets explicitPhoneLookupModevalues in test config builders.- No direct breakage found here from the nil-fallback change.
🔇 Additional comments (1)
pkg/configuration/configuration_test.go (1)
72-72: LGTM!
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexeykazakov, fbm3307, MatousJobanek, metlos The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|



Change the runtime nil fallback in PhoneLookupMode() from PhoneLookupModeLog to PhoneLookupModeDisabled, and update the corresponding test assertion.
Related Prs
API: codeready-toolchain/api#515
host-operator: codeready-toolchain/host-operator#1274
Toolchain-e2e: codeready-toolchain/toolchain-e2e#1292
Assisted By : Cursor
Summary by CodeRabbit