Skip to content

Conversation

@lukaszgryglicki
Copy link
Member

cc @mlehotskylf @ahmedomosanya @jarias-lfx - I need another pair of eyes on this, additionally there might also be something in UI to remove - @ahmedomosanya PTAL.

Signed-off-by: Lukasz Gryglicki lgryglicki@cncf.io

Assisted by OpenAI

Assisted by GitHub Copilot

Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>

Assisted by [OpenAI](https://platform.openai.com/)

Assisted by [GitHub Copilot](https://github.com/features/copilot)
@coderabbitai
Copy link

coderabbitai bot commented Dec 2, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The pull request removes usage of the V1 corporate console URL across services and configs, deleting the CorporateConsoleV1URL config/SSM handling and updating constructors and utility functions to always use the V2 corporate console URL.

Changes

Cohort / File(s) Change Summary
Configuration removal
cla-backend-go/config/config.go, cla-backend-go/config/ssm.go
Removed CorporateConsoleV1URL field from Config and deleted SSM key handling for cla-corporate-v1-base-%s
Service initialization updates
cla-backend-go/cmd/dynamo_events_lambda/main.go, cla-backend-go/cmd/server.go
Replaced constructor arguments to use CorporateConsoleV2URL instead of CorporateConsoleV1URL (company/CLA/email-template services)
Utils and internal Go usage
cla-backend-go/utils/email.go, cla-backend-go/company/service.go
Changed GetCorporateURL signature to no-arg and always return V2; updated callsites to use new signature
V2 handlers API change
cla-backend-go/v2/company/handlers.go
Removed v1CorporateConsole parameter from Configure and unified corporate link resolution to use LFXPortalURL only
Python backend updates
cla-backend/cla/utils.py, cla-backend/cla/models/docusign_models.py, cla-backend/cla/routes.py
get_corporate_url now has no parameter and always returns V2; updated signed-email link construction and an example payload return_url string

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review cla-backend-go/v2/company/handlers.go to ensure removal of the v1 parameter and link-resolution changes don't break existing consumers.
  • Check cla-backend-go/config/ssm.go and deployment/SSM setup to ensure the removed SSM key is not required in environments.
  • Audit repo for any remaining references to CorporateConsoleV1URL (other callsites, docs, tests).

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Remove V1 corporate console' accurately summarizes the main change: removing V1 corporate console URL configuration and code paths throughout the codebase.
Description check ✅ Passed The description is related to the changeset as it references code changes and requests reviewers, though it lacks detailed explanation of what is being changed.
Docstring Coverage ✅ Passed Docstring coverage is 81.82% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch unicron-disable-v1-corporate-console

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 2d742d0 and 77431b4.

📒 Files selected for processing (5)
  • cla-backend-go/company/service.go (2 hunks)
  • cla-backend-go/utils/email.go (1 hunks)
  • cla-backend-go/v2/company/handlers.go (2 hunks)
  • cla-backend/cla/models/docusign_models.py (1 hunks)
  • cla-backend/cla/utils.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
cla-backend-go/company/service.go (1)
cla-backend-go/utils/email.go (1)
  • GetCorporateURL (103-106)
cla-backend-go/v2/company/handlers.go (1)
cla-backend-go/v2/company/service.go (1)
  • Service (88-109)
cla-backend/cla/models/docusign_models.py (1)
cla-backend/cla/utils.py (1)
  • get_corporate_url (1927-1934)
cla-backend-go/utils/email.go (1)
cla-backend-go/config/config.go (1)
  • GetConfig (168-170)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: cypress-functional
  • GitHub Check: build-test-lint
🔇 Additional comments (5)
cla-backend-go/utils/email.go (1)

102-105: Consolidated GetCorporateURL to always return V2 console URL

Implementation is straightforward, aligns with the V1 shutdown, and cleanly centralizes the V2 URL lookup via config. No issues from this change.

cla-backend/cla/utils.py (1)

1927-1934: Python get_corporate_url now unconditionally targets V2

The helper cleanly reflects the V1 shutdown by always returning CORPORATE_V2_BASE, and the docstring/comment clearly document that behavior. Looks good.

cla-backend/cla/models/docusign_models.py (1)

2484-2513: document_signed_email_content correctly switches to version-agnostic V2 URL

Using corporate_url = get_corporate_url() removes the now-irrelevant project version branching and ensures CCLA emails always link to the V2 corporate console as intended.

cla-backend-go/company/service.go (1)

474-475: Company access emails now rely on the unified V2 GetCorporateURL helper

Swapping GetCorporateURL to the new parameterless form keeps the templates intact while standardizing on the V2 corporate console URL; the emails will no longer depend on any project-version flag. Change is sound.

Also applies to: 511-512

cla-backend-go/v2/company/handlers.go (1)

30-30: Configure now standardizes RequestCompanyAdmin on LFXPortalURL (V2 only)

Reducing the Configure signature to a single LFXPortalURL and always passing that as corporateLink removes obsolete V1 branching and matches the service interface. This is a clear, correct simplification.

Also applies to: 639-641


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
cla-backend/cla/utils.py (1)

1927-1934: Always‑V2 behavior looks correct; please verify infra config and consider a defensive check.

The change to always return CORPORATE_V2_BASE aligns with decommissioning the V1 console and keeps the call sites’ signature stable. The updated docstring clearly marks project_version as deprecated.

Two follow‑ups to consider:

  1. Config verification: Because CORPORATE_V2_BASE now unconditionally drives all corporate URLs, any environment that still only sets CLA_CORPORATE_BASE (and not CLA_CORPORATE_V2_BASE) will start emitting empty/broken links. Please double‑check deployment config before rolling this out.

  2. Optional hardening: To fail fast on misconfiguration, you might raise or log loudly if CORPORATE_V2_BASE is empty instead of silently returning "", for example:

 def get_corporate_url(project_version: str) -> str:
@@
-    # V1 corporate console has been shut down - always return V2
-    return CORPORATE_V2_BASE
+    # V1 corporate console has been shut down - always return V2
+    if not CORPORATE_V2_BASE:
+        cla.log.error("CLA_CORPORATE_V2_BASE is not configured – cannot build corporate console URL")
+        # Optionally: raise RuntimeError("CLA_CORPORATE_V2_BASE is not configured")
+    return CORPORATE_V2_BASE
cla-backend-go/v2/company/handlers.go (1)

639-649: Simplify redundant conditional logic.

All branches of the conditional assign the same value (LFXPortalURL) to corporateLink. The conditional logic can be simplified while preserving the informative comment about V1 being shut down.

Apply this diff to simplify the logic:

-		corporateLink := ""
-		// Get appropriate corporate link - V1 is no longer supported, redirect to V2
-		if params.Body.Version == "v1" {
-			// V1 corporate console has been shut down - redirect to V2
-			corporateLink = LFXPortalURL
-		} else if params.Body.Version == "v2" {
-			corporateLink = LFXPortalURL
-		} else {
-			// Default to V2 if version is not specified
-			corporateLink = LFXPortalURL
-		}
+		// V1 corporate console has been shut down - always use V2 (LFXPortalURL) regardless of version
+		corporateLink := LFXPortalURL
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f8af0dd and 2d742d0.

📒 Files selected for processing (8)
  • cla-backend-go/cmd/dynamo_events_lambda/main.go (1 hunks)
  • cla-backend-go/cmd/server.go (3 hunks)
  • cla-backend-go/config/config.go (0 hunks)
  • cla-backend-go/config/ssm.go (2 hunks)
  • cla-backend-go/utils/email.go (1 hunks)
  • cla-backend-go/v2/company/handlers.go (2 hunks)
  • cla-backend/cla/routes.py (1 hunks)
  • cla-backend/cla/utils.py (1 hunks)
💤 Files with no reviewable changes (1)
  • cla-backend-go/config/config.go
🧰 Additional context used
🧬 Code graph analysis (4)
cla-backend-go/cmd/dynamo_events_lambda/main.go (1)
cla-backend-go/v2/company/service.go (1)
  • NewService (119-129)
cla-backend-go/cmd/server.go (4)
cla-backend-go/emails/prefill.go (1)
  • NewEmailTemplateService (37-45)
cla-backend-go/v2/cla_manager/service.go (1)
  • NewService (108-122)
cla-backend-go/v2/current_user/service.go (1)
  • NewService (26-28)
cla-backend-go/v2/company/service.go (1)
  • NewService (119-129)
cla-backend-go/v2/company/handlers.go (1)
cla-backend-go/v2/company/service.go (1)
  • Service (88-109)
cla-backend-go/utils/email.go (1)
cla-backend-go/config/config.go (1)
  • GetConfig (168-170)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: CodeQL analysis (go)
  • GitHub Check: Agent
  • GitHub Check: build-test-lint
  • GitHub Check: cypress-functional
🔇 Additional comments (9)
cla-backend/cla/routes.py (1)

1278-1278: Documentation update aligns with V2 console migration.

The example payload's return_url has been updated from a corporate domain to the organization console domain. This documentation-only change reflects the removal of V1 corporate console support as stated in the PR objective. The function implementation correctly passes through the return_url parameter without enforcing any specific domain format, so downstream consumers will receive whatever URL is provided.

cla-backend-go/cmd/dynamo_events_lambda/main.go (1)

141-141: LGTM! Service constructor correctly updated to use V2 URL.

The company service constructor now uses CorporateConsoleV2URL instead of the V1 URL, which aligns with the PR's objective to remove V1 corporate console support.

cla-backend-go/cmd/server.go (4)

319-319: LGTM! Email template service correctly transitioned to V2.

The email template service constructor now receives CorporateConsoleV2URL for both the V1 and V2 parameters. This is a reasonable transitional approach while V1 references are being phased out from the email template service implementation.


322-322: LGTM! Company service constructor correctly updated.

The v1 company service now uses CorporateConsoleV2URL, consistent with the removal of V1 corporate console support.


332-332: LGTM! CLA manager service constructor correctly updated.

The v1 CLA manager service now uses CorporateConsoleV2URL instead of the V1 URL, aligning with the PR's objective.


386-386: LGTM! Company handler configuration correctly updated.

The v2Company.Configure call now passes only LFXPortalURL, consistent with the signature change in handlers.go that removed the V1 corporate console parameter.

cla-backend-go/v2/company/handlers.go (1)

30-30: LGTM! Configure signature correctly updated.

The function signature now removes the v1CorporateConsole parameter, keeping only LFXPortalURL. This aligns with the PR's objective to remove V1 corporate console support. The caller in server.go has been updated accordingly.

cla-backend-go/config/ssm.go (1)

78-80: CorporateConsoleURL is still actively used and should not be removed.

The CorporateConsoleURL field loaded from the cla-corporate-base-%s key is actively used throughout the codebase:

  • Assigned in email templates (v2/cla_manager/emails.go)
  • Used in service logic (v2/cla_manager/service.go:1223)
  • Referenced in tests

Keeping both cla-corporate-base-%s (CorporateConsoleURL) and cla-corporate-v2-base-%s (CorporateConsoleV2URL) is necessary for the current functionality.

cla-backend-go/utils/email.go (1)

102-106: File path mismatch: Unable to verify review comment against repository.

The review comment references cla-backend-go/utils/email.go at lines 102-106, but this file does not exist in the current repository. A search for the GetCorporateURL function and related symbols across all Go files in the repository returned no results.

This may indicate:

  • The file is not part of the current repository
  • The repository structure differs from what was referenced
  • The change may have already been applied or reverted

To proceed with verification, please confirm:

  1. The correct file path and repository location
  2. Whether this is the intended branch/commit containing these changes

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes all references to the V1 corporate console that has been shut down, redirecting all traffic to the V2 corporate console URL across both Python and Go backends.

  • Updated utility functions to always return V2 corporate console URL
  • Removed V1 configuration parameters and SSM keys
  • Updated service initializations to use V2 URLs exclusively

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
cla-backend/cla/utils.py Modified get_corporate_url() to always return V2 URL, ignoring the version parameter
cla-backend/cla/routes.py Updated API documentation example to use V2 corporate console URL
cla-backend-go/config/config.go Removed CorporateConsoleV1URL field from configuration struct
cla-backend-go/config/ssm.go Removed V1 corporate console SSM parameter loading
cla-backend-go/utils/email.go Modified GetCorporateURL() to always return V2 URL, ignoring the flag parameter
cla-backend-go/v2/company/handlers.go Removed v1CorporateConsole parameter and updated handler logic to always use V2 URL
cla-backend-go/cmd/server.go Updated service initializations to pass V2 URL for all corporate console references
cla-backend-go/cmd/dynamo_events_lambda/main.go Updated company service initialization to use V2 URL

Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>

Assisted by [OpenAI](https://platform.openai.com/)

Assisted by [GitHub Copilot](https://github.com/features/copilot)
@lukaszgryglicki lukaszgryglicki merged commit 7f01c5f into dev Dec 2, 2025
4 of 6 checks passed
@lukaszgryglicki lukaszgryglicki deleted the unicron-disable-v1-corporate-console branch December 2, 2025 10:10
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.

3 participants