Skip to content

Org-import copies only EasyCLA roles onto an existing Account #5081, E2E fixes - prod - #5315

Merged
lukaszgryglicki merged 1 commit into
mainfrom
unicron-5081-e2e-token-company-lens-prod
Nov 18, 2026
Merged

lukaszgryglicki merged 1 commit into
mainfrom
unicron-5081-e2e-token-company-lens-prod

Conversation

@lukaszgryglicki

Copy link
Copy Markdown
Member

linuxfoundation/lfx-self-serve#5081

cc @mlehotskylf @ahmedomosanya

org-import - on a rewrite onto an Account that existed before (matched, or several old ids under a collapse decision) only cla-manager, cla-manager-designee, cla-signatory, contributor and contact are copied.

company-admin / viewer (and any other role) are deleted with the old id and listed in the new dropped_grants.csv (apply only: old id, target Account, user, role, scope) and in run.log.

An Account created for one group alone (created) still gets every grant - the choice is kept in the state journal (all_grants), so a replay after a crash follows the same policy.

Also tests/e2e: tokens are minted through utils/get_lfx_token.sh, the browser checks follow the Self Serve company lens (linuxfoundation/lfx-self-serve#5185), the v1 Corporate Console login is skipped once its Auth0 application refuses logins.

Tested: unit tests (the new grants_test.go cases for matched / created / collapse / replay fail on the dev sources), -race, lint, dev dry runs of the tool for matched / created / collapse, E2E browser modules on dev (127 pass, 0 fail) and prod (80 pass, 0 fail).

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

Assisted by OpenAI

Assisted by GitHub Copilot

Assisted by Claude

…E2E fixes - 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 18, 2026
@lukaszgryglicki
lukaszgryglicki requested a review from a team as a code owner November 18, 2026 12:30
Copilot AI balanced review requested due to automatic review settings November 18, 2026 12:30
@coderabbitai

coderabbitai Bot commented Nov 18, 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: fcb4bab7-72e1-46e4-9114-ab8bdcf2360a

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 18, 2026 •

Copy link
Copy Markdown

@lukaszgryglicki I'm starting review 1 of this pull request now (started 2026-11-18 12: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 org-import copy only the EasyCLA roles onto an Account that already existed. It adds a dropped_grants.csv report and a journal flag so a resumed run follows the same policy. It also updates the E2E suite for the new token flow and the Self Serve company lens. The code and tests are careful. The main concern is a gap in the safety net around the new report.

Decision

✅ Approved with minor comments

🟡 1 minor · ❔ 1 question

Details

Overall impression: The grant-policy change is well scoped. AllGrants is decided once at plan time, kept in the journal, and re-checked against the target at replay. A grant with no role name fails the copy step instead of being deleted uncopied. Usernames stay out of the journal and the log, and a dry run removes any stale dropped_grants.csv. The new grants_test.go covers matched, created, collapse, replay, a late-added grant and a journal line over 1 MiB. The E2E changes are test-only.

🟡 Minor: 1 issue: Dropped-grant usernames are lost when a rewrite apply runs with notify off

❔ Question: 1 item: Journals written before this change replay as an existing Account

Other reviewers and CI checks: CodeRabbit skipped this pull request because the base branch is not the default branch. The required check DCO passed on 8fa4c3d. The CodeRabbit commit status is success.

Documentation reminder: changed dropped_grants.csv, EasyCLA-only role copy onto an existing Account, E2E token minting through utils/get_lfx_token.sh. 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.

No blocking findings. One minor finding and one question are left inline; neither blocks approval.

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:

  • dropped_grants.csv (new report file written by an apply)
  • EasyCLA-only role copy onto an existing Account (behavior change in org-import)
  • E2E token minting through utils/get_lfx_token.sh (changed)

Comment thread .github/workflows/org-import-sweep.yml Resolved
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

Interrupted and legacy rewrite replays can retain elevated access or delete required grants, and audit, privacy, and test issues remain unresolved.

7 open issues
What changed in this PR

Updates EasyCLA’s organization-import tool for the role-transfer policy in lfx-self-serve#5081, alongside E2E authentication and Self Serve company-lens updates.

Changes:

  • Limits transfers onto existing or shared Accounts to five EasyCLA roles; dedicated newly created Accounts retain all grants.
  • Adds grant-policy journal fields, dropped-grant reports, documentation, and regression tests.
  • Switches E2E token minting to device-code login and refresh, updates company-lens checks, and handles retired-console login errors.
File Description
tests/​e2e/​secrets/​README.md Documents device-code credentials and refresh-token storage.
tests/​e2e/​README.md Updates token-minting prerequisites.
tests/​e2e/​lib/​token.sh Adds device-code login and refresh-token reuse.
tests/​e2e/​browser/​ss_identity.mjs Recognizes the company-selector placeholder.
tests/​e2e/​browser/​m3_chain.mjs Includes company-lens navigation links.
tests/​e2e/​browser/​lib/​m3.mjs Closes overlays before opening agreement details.
tests/​e2e/​browser/​lib/​e2e.mjs Updates selector placeholders and backdrop handling.
tests/​e2e/​browser/​consoles.mjs Adds handling for rejected Auth0 console logins.
tests/​e2e/​browser/​bridge.mjs Supports company-lens navigation and denial checks.
cla-backend-go/​v2/​company/​create_company_member_service.go Corrects comment punctuation only.
cla-backend-go/​orgimport/​steps.go Filters copied roles and tracks uncopied grants.
cla-backend-go/​orgimport/​state.go Stores grant policy and dropped-grant metadata.
cla-backend-go/​orgimport/​run.go Selects grant policy and carries it through replay.
cla-backend-go/​orgimport/​run_test.go Updates role fixtures and deletion-failure support.
cla-backend-go/​orgimport/​report.go Includes the dropped-grant CSV in report attachments.
cla-backend-go/​orgimport/​orgimport.go Adds grant-policy and dropped-grant group fields.
cla-backend-go/​orgimport/​grants_test.go Tests filtering, collapse, replay, and reporting behavior.
cla-backend-go/​orgimport/​decisions.go Detects Accounts shared with other groups or rows.
cla-backend-go/​orgimport/​columns.go Documents role filtering and dropped-report columns.
cla-backend-go/​orgimport/​columns_test.go Extends report-column coverage.
cla-backend-go/​orgimport/​audit.go Generates apply-only dropped-grant reports.
cla-backend-go/​orgimport/​account_forms_test.go Uses EasyCLA roles in existing grant-safety tests.
cla-backend-go/​cmd/​org_import/​README.md Documents transfer policy, reports, and operational handling.
.github/​workflows/​org-import-sweep.yml Excludes the username-bearing CSV from uploaded artifacts.

Review effort: Balanced

Comment thread cla-backend-go/orgimport/run.go Resolved
Comment thread cla-backend-go/orgimport/run.go Resolved
Comment thread cla-backend-go/orgimport/steps.go Resolved
Comment thread cla-backend-go/orgimport/steps.go Resolved
Comment thread cla-backend-go/orgimport/steps.go Resolved
Comment thread tests/e2e/browser/consoles.mjs Resolved
Comment thread tests/e2e/lib/token.sh Resolved
@lukaszgryglicki
lukaszgryglicki merged commit 3c56b96 into main Nov 18, 2026
8 checks passed
@lukaszgryglicki
lukaszgryglicki deleted the unicron-5081-e2e-token-company-lens-prod branch November 18, 2026 13:27

This branch was previously deployed

1 inactive deployment
dev — 8fa4c3dc Deployed Nov 18, 2026 by lukaszgryglicki via License Header Check #1457
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