Skip to content

Add Salesforce project and foundation ids to My CLAs rows (prod) - #5159

Merged
lukaszgryglicki merged 1 commit into
mainfrom
feat/GH-1575-console-sfids-prod
Aug 25, 2026
Merged

Add Salesforce project and foundation ids to My CLAs rows (prod)#5159
lukaszgryglicki merged 1 commit into
mainfrom
feat/GH-1575-console-sfids-prod

Conversation

@ahmedomosanya

Copy link
Copy Markdown
Contributor

Promotes #5158 to PROD.

What

GET /v4/my-clas now returns two optional fields on each row: projectSFID and foundationSFID.

Why

The endpoint already resolves the Salesforce ids of a CLA Group's projects_cla_groups mapping in
order to fetch projectName and projectLogo, then throws them away. Consumers are left with no way
to address the CLA Group in the LFX Corporate CLA Console.

The immediate consumer is LFX Self Serve's My CLAs page, which is adding a "Manage in CCLA Console"
link for CLA managers — linuxfoundation/lfx-self-serve#1575.

Contract

Presence is the discriminator. Consumers branch on which ids arrived rather than concatenating them:

Mapping shape foundationSFID projectSFID Console route
Foundation-level (marker row where project_sfid == foundation_sfid) set omitted /foundation/{foundationSFID}/cla
Single project-level mapping set set /foundation/{foundationSFID}/project/{projectSFID}/cla
Several project-level mappings, no foundation marker omitted omitted none — unresolved

A foundation-level group deliberately omits projectSFID rather than echoing the foundation id into
both, so a consumer can tell "foundation" apart from "project under a foundation" without comparing
ids. This matches emails.CLAProjectParams.GetProjectFullURL, which ignores ProjectSFID entirely
on its foundation branch. The unresolved case matches how projectName and projectLogo already
behave.

Both fields marshal with omitempty, so existing clients see no change.

Changes

  • swagger/common/my-cla.yaml — declares both fields, with the branching rule in the description.
  • v2/my_clas/service.goprojectInfo retains the ids it already computed; GetMyClas copies
    them onto models.MyCla. The local driving the project-service lookup is renamed projectSFID
    lookupSFID, since it can hold a foundation id; its log field key follows.
  • docs/MY_CLAS_API.md — sample body, field reference, and the Self Serve mapping section.

The four changed files are byte-identical to dev (merged in #5158), where make fmt, make build-mac, make test, and make lint passed. Cherry-picked as ecc6d7df7 from 71e8c4268. ./v2/my_clas tests re-ran clean on this branch.

Note: main CI does not run build/test/lint, and make swagger regenerates models.MyCla.{ProjectSFID,FoundationSFID} at deploy time from the edited my-cla.yaml.

GET /v4/my-clas already resolves the Salesforce ids of a CLA Group's
projects_cla_groups mapping in order to fetch the project name and logo, then
discards them. Consumers are left with no way to address the CLA Group in the
LFX Corporate CLA Console.

Keep those ids and emit them as optional projectSFID and foundationSFID. A
foundation-level CLA Group - the marker mapping where project_sfid equals
foundation_sfid - sends only foundationSFID; a single project-level mapping
sends both; a multi-project group with no foundation marker sends neither,
matching how projectName and projectLogo already behave. Presence is the
discriminator, so consumers branch on which ids arrived rather than
concatenating them.

Consumer: linuxfoundation/lfx-self-serve#1575
Signed-off-by: ahmedomosany <aopeyemi@contractor.linuxfoundation.org>
(cherry picked from commit 71e8c42)
Copilot AI balanced review requested due to automatic review settings August 25, 2026 14:05
@coderabbitai

coderabbitai Bot commented Aug 25, 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

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: da47cd60-2f43-44c6-912c-4504f4829dad

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

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

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.

Pull request overview

Adds Salesforce project and foundation IDs to /v4/my-clas rows for Corporate CLA Console routing.

Changes:

  • Extends the Swagger response contract with optional SFID fields.
  • Propagates mapping-derived IDs through the service.
  • Adds mapping-shape tests and consumer documentation.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
docs/MY_CLAS_API.md Documents fields and console routing.
cla-backend-go/v2/my_clas/service.go Resolves and returns Salesforce IDs.
cla-backend-go/v2/my_clas/service_test.go Tests ID behavior across mapping shapes.
cla-backend-go/swagger/common/my-cla.yaml Defines the new response fields.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cla-backend-go/v2/my_clas/service.go

@lukaszgryglicki lukaszgryglicki left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@lukaszgryglicki
lukaszgryglicki merged commit dd13006 into main Aug 25, 2026
8 checks passed
@lukaszgryglicki
lukaszgryglicki deleted the feat/GH-1575-console-sfids-prod branch August 25, 2026 14:20
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