Skip to content

Live Account lens rule, lens route, import tool create route and retry - prod - #5337

Merged
lukaszgryglicki merged 1 commit into
mainfrom
unicron-3796-5520-508-prod
Nov 26, 2026
Merged

lukaszgryglicki merged 1 commit into
mainfrom
unicron-3796-5520-508-prod

Conversation

@lukaszgryglicki

Copy link
Copy Markdown
Member

prod version of: #5336.

cc @mlehotskylf @ahmedomosanya

Signed-off-by: Łukasz Gryglicki lgryglicki@cncf.io

Assisted by OpenAI

Assisted by GitHub Copilot

Assisted by Claude

…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)
@lukaszgryglicki lukaszgryglicki self-assigned this Nov 26, 2026
@lukaszgryglicki
lukaszgryglicki requested a review from a team as a code owner November 26, 2026 11:30
Copilot AI max review requested due to automatic review settings November 26, 2026 11:30
@coderabbitai

coderabbitai Bot commented Nov 26, 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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 4df9a48d-adf4-4d05-b5d9-ae74db303e5a

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@lfx-one

lfx-one commented Nov 26, 2026 •

Copy link
Copy Markdown

@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 re-review, to start another. For help with the review agent, see https://github.com/linuxfoundation/lfx-review-agent/issues.


Hi Łukasz,

Summary

This pull request makes the Organization lens link depend on a live Account check against member-service, adds the public /v3 org-lens route, and extends the org import tool with approved create rows, a journal record inside the cleanup step, a late retry of held-back roles, and a retry after 502/503/504 answers. The code is consistent, well tested, and follows the repository's module layout. The only issues are two small nits.

Decision

✅ Approved with minor comments

⚪ 2 nit

Details

Overall 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 deleteOldGrants and the late retry in retryHeld. A grant is journaled as dropped before its delete, removed from the journal once it is copied, and a failing journal write restores the held grants. I found no correctness problem there.

⚪ 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 DCO check passed on ea7fbd1.

Documentation reminder: changed /v3/company/{companyID}/cla-group/{claGroupID}/org-lens, create, Organization lens link in e-mails. Please check product pages and external docs; the author and maintainers own those updates.

Rule files: read CLAUDE.md; skipped none

Questions, problems, or feedback: https://github.com/linuxfoundation/lfx-review-agent/issues

@lfx-one lfx-one left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)

Comment thread cla-backend-go/orgimport/run.go Resolved

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.

🟡 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
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 /v3 lens 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 Configure doc 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

Comment thread cla-backend-go/orgimport/steps.go Resolved
Comment thread cla-backend-go/orgimport/steps.go Resolved
Comment thread cla-backend-go/cla_manager/org_lens.go Resolved
Comment thread cla-backend-go/orgimport/steps.go Resolved
Comment thread cla-backend-go/utils/org_lens_url.go Resolved
@lukaszgryglicki
lukaszgryglicki merged commit ae2bf0c into main Nov 26, 2026
13 checks passed
@lukaszgryglicki
lukaszgryglicki deleted the unicron-3796-5520-508-prod branch November 26, 2026 12:39

This branch was previously deployed

1 inactive deployment
dev — ea7fbd13 Deployed Nov 26, 2026 by lukaszgryglicki via License Header Check #1472
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.

4 participants