Repository navigation
Live Account lens rule, lens route, import tool create route and retry - prod - #5337
Conversation
…y - prod Signed-off-by: Łukasz 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
|
|
@lukaszgryglicki I'm starting review 1 of this pull request now (started 2026-11-26 11:30 UTC using review agent v0.1.34). This usually takes a few minutes. I'll update this comment with the summary when I'm done. If there's no summary here after about 45 minutes, the review stopped: push a new commit, or post a comment that begins with a mention of me followed by Hi Łukasz, SummaryThis pull request makes the Organization lens link depend on a live Account check against member-service, adds the public Decision✅ Approved with minor comments ⚪ 2 nit DetailsOverall impression: The change is large (31 files, about 1,860 added lines) but split cleanly. The Go and legacy backends each answer "is this Account live" with a short-lived cache, and a missing or unconfigured member-service keeps the Corporate Console link. The import tool's create path never creates anything on a dry run, journals the new Account id before the copy, and stops when an existing Account already matches the website. I traced the new journal records in ⚪ Nit: 2 issues: Cancelled caller context is cached as "not live" in the legacy backend, Ambiguous domain on a create row reports a dry-run mismatch that never happened Other reviewers and CI checks: CodeRabbit skipped this review (the base is not the default branch). The required Documentation reminder: changed Rule files: read Questions, problems, or feedback: https://github.com/linuxfoundation/lfx-review-agent/issues |
lfx-one
left a comment
There was a problem hiding this comment.
The live-Account lens rule, the new /v3 org-lens route and the import tool changes (create rows, in-cleanup journal, gateway retry) are consistent and well tested. I found only two nits, left inline.
Documentation
This pull request changes behavior that may also be described outside this repository, such as product pages or an external docs site. I can't read those, so please check them; the author and maintainers own those updates. Changed here:
/v3/company/{companyID}/cla-group/{claGroupID}/org-lens(new public route)create(new mapping row action of the import tool)Organization lens link in e-mails(now only for a live Account)
There was a problem hiding this comment.
🟡 Changes recommended
Critical org-import recovery and audit gaps can leave deleted grants unrecoverable after interruptions and omit those losses from reports.
8 open issues
Report confirmed deletions during unfinished cleanup · New Persist pending moves and retry transient final-transfer errors · New Use a metadata-only lookup for public hand-offs · New Reconcile pending destination grants on replay · New Canonicalize Salesforce IDs before checks and URL construction · New Prevent canceled lookup leaders from failing healthy waiters · New Avoid caching failed lookups when the caller is canceled · New Normalize case-folded Salesforce IDs before lookup and linking · New
What changed in this PR
Ports #5336 to production, supporting EasyCLA’s transition to the Organization lens and improving Account creation and recovery in the organization import tool.
Changes:
- Adds cached live-Account checks and a public
/v3lens hand-off route, with Corporate Console fallback. - Adds approved Account-creation mappings, cleanup journaling, and retries for deferred roles and gateway errors.
- Extends Go and end-to-end coverage and corrects the placement of the
Configuredoc comment.
| File | Description |
|---|---|
tests/e2e/browser/m3_org_lens.mjs |
Passes the actor identity to the acknowledgment invalidation probe. |
tests/e2e/api/read_matrix.py |
Checks the public lens response and unknown-company handling. |
cla-backend-legacy/internal/legacy/userservice/audience.go |
Exposes audience-specific token creation for member-service. |
cla-backend-legacy/internal/api/org_lens_live.go |
Adds cached live-Account checks for legacy emails. |
cla-backend-legacy/internal/api/org_lens_live_test.go |
Covers lookup results, expiry, configuration, and fallback. |
cla-backend-legacy/internal/api/handlers.go |
Applies live-Account gating to the legacy approval-request email. |
cla-backend-go/v2/member-service/live_accounts.go |
Caches and shares concurrent Account lookups. |
cla-backend-go/v2/member-service/live_accounts_test.go |
Covers lookup results, expiry, cancellation, and shared requests. |
cla-backend-go/v2/company/handlers.go |
Moves the Configure doc comment onto its function. |
cla-backend-go/v2/cla_manager/notify_company_sfid_test.go |
Supplies a live-Account stub for notification tests. |
cla-backend-go/utils/org_lens_url.go |
Gates lens URLs on live Accounts and adds context-aware variants. |
cla-backend-go/utils/org_lens_url_test.go |
Tests gating, fallback, and context propagation. |
cla-backend-go/swagger/cla.v1.yaml |
Defines the public lens route and response schema. |
cla-backend-go/orgimport/steps.go |
Adds cleanup journaling and deferred-role and gateway retries. |
cla-backend-go/orgimport/step_retry_test.go |
Covers bounded retries and non-retryable errors. |
cla-backend-go/orgimport/run.go |
Plans creation mappings, resolves Accounts at apply, and invokes final retries. |
cla-backend-go/orgimport/orgimport.go |
Adds creation dependencies and deferred-grant tracking. |
cla-backend-go/orgimport/mapping.go |
Parses and validates approved create mappings. |
cla-backend-go/orgimport/decisions.go |
Reuses the missing-website reason constant. |
cla-backend-go/orgimport/create_route_test.go |
Covers creation, replay, approval, and matching safeguards. |
cla-backend-go/orgimport/cleanup_journal_test.go |
Tests cleanup recovery and retries across collapsed sources. |
cla-backend-go/orgimport/adapters.go |
Adapts member-service creation to the import contract. |
cla-backend-go/emails/prefill_test.go |
Stubs live-Account status in email-parameter tests. |
cla-backend-go/emails/org_lens_links_test.go |
Covers live-Account links and Corporate Console fallback. |
cla-backend-go/cmd/server.go |
Wires live checks independently of company-creation flags. |
cla-backend-go/cmd/org_lens_live_test.go |
Verifies lens-only configuration and client reuse. |
cla-backend-go/cmd/org_import/README.md |
Documents creation mapping syntax and safeguards. |
cla-backend-go/cmd/org_import/main.go |
Wires member-service as the Account-creation dependency. |
cla-backend-go/cla_manager/org_lens.go |
Implements the company/CLA-group hand-off response and errors. |
cla-backend-go/cla_manager/org_lens_test.go |
Tests response payloads, fallback, and lookup failures. |
cla-backend-go/cla_manager/handlers.go |
Registers the new public hand-off handler. |
Review effort: Max


prodversion of: #5336.TASK: Link CLA manager emails to the Organization lens instead of the Corporate Console lfx-self-serve#3796 - the lens rule is "live Account": a company gets an Organization lens link only when member-service answers 200 for its Account (answer kept 10 minutes, a "no" 1 minute) - every e-mail of
cla-backend-goand the one ofcla-backend-legacy- no change whilecla-org-lens-base-{stage}is unset.TASK: Contributor Console and landing page stop linking the Corporate Console lfx-self-serve#5520 - new public
GET /v3/company/{companyID}/cla-group/{claGroupID}/org-lensfor the Contributor Console hand-off - returnsorgLensURL(empty = Corporate Console) withcompanyID,companySFID,claGroupID,foundationSFID- on/v3because a new public/v4route needs an entry inlfx-gateway.Import tool, for TASK: Sales ops create Salesforce Accounts for the companies with no domain match (Data Loader) lfx-self-serve#5082 - a mapping row
old_id,,create,truemakes the apply create the Account through the member-service find-or-create of the create flow - a dry run creates nothing - an Account that already matches the website stops the organization for review.Import tool, for TASK: Import non-member companies in prod, in tranches lfx-self-serve#3957 - a journal record inside the cleanup step, so a killed run reports exactly the roles it lost - and one more try at the end of a run for organization roles that were refused while their user still had one on another source of a collapse - a step is tried again after a 502, 503 or 504 of the Organization Service (seen once on
prodtoday) instead of failing the organization.E2E: harness fix for
M3-ACK-INVALIDATE, three checks of the new route.The doc comment of
Configureinv2/company/handlers.go- review note of Org search limit, atomic e-mails add, lens e-mails, import tool, qs #5334.cc @mlehotskylf @ahmedomosanya
Signed-off-by: Łukasz Gryglicki lgryglicki@cncf.io
Assisted by OpenAI
Assisted by GitHub Copilot
Assisted by Claude