Skip to content

Conversation

@mfrancisc
Copy link
Contributor

@mfrancisc mfrancisc commented Sep 8, 2025

Description

When present we want to send the account number to segment and amplitude as well.
See: https://redhat-internal.slack.com/archives/CHK0J6HT6/p1756885453252769?thread_ts=1756302863.754179&cid=CHK0J6HT6

Jira: https://issues.redhat.com/browse/SANDBOX-1394

Checks

  1. Did you run make generate target? yes

  2. Did make generate change anything in other projects (host-operatorr)? yes

  3. In case of new CRD, did you the following? N/A

  4. In case other projects are changed, please provides PR links.

Summary by CodeRabbit

  • New Features

    • Added an optional accountNumber field to user identity claims, capturing the identity provider’s account_number claim. Available via the public API and reflected in the OpenAPI schema.
  • Documentation

    • Updated API reference to document the new accountNumber claim.
    • Minor formatting and escaping adjustments with no impact on behavior.

@coderabbitai
Copy link

coderabbitai bot commented Sep 8, 2025

Walkthrough

Added a new optional string field AccountNumber to IdentityClaimsEmbedded, updated the generated OpenAPI schema to include accountNumber, and refreshed API reference documentation formatting to mention the new field.

Changes

Cohort / File(s) Summary
API struct update
api/v1alpha1/usersignup_types.go
Added AccountNumber string with JSON tag accountNumber,omitempty to IdentityClaimsEmbedded.
OpenAPI schema generation
api/v1alpha1/zz_generated.openapi.go
Extended IdentityClaimsEmbedded schema with accountNumber (string) and description referencing the account_number claim.
API docs refresh
api/v1alpha1/docs/apiref.adoc
Documented new accountNumber field; other edits are formatting/escaping changes without semantic impact.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A nimble hare taps keys with cheer,
“AccountNumber hops in here!”
Claims align, the fields convene,
Docs and schema crisp and clean.
With one new string, the path is clear—
Thump-thump! A tidy change to steer. 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 8, 2025

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)
api/v1alpha1/docs/apiref.adoc (2)

2104-2104: Fix typo: “a ccess” → “access”

Minor doc typo.

-| *`registrationServiceURL`* __string__ | RegistrationServiceURL is the URL used to a ccess the registration service + |  | 
+| *`registrationServiceURL`* __string__ | RegistrationServiceURL is the URL used to access the registration service + |  | 

772-772: Verified codegen tags; apply doc tweak to clarify optionality

-| *`accountNumber`* __string__ | AccountNumber contains the value of the 'account_number' claim + |  | 
+| *`accountNumber`* __string__ | AccountNumber contains the value of the 'account_number' claim (optional; set only when present in the IdP token) + |  | 
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cbad29a and 7efc77c.

📒 Files selected for processing (3)
  • api/v1alpha1/docs/apiref.adoc (25 hunks)
  • api/v1alpha1/usersignup_types.go (1 hunks)
  • api/v1alpha1/zz_generated.openapi.go (1 hunks)
⏰ 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). (1)
  • GitHub Check: Verify Dependencies
🔇 Additional comments (4)
api/v1alpha1/usersignup_types.go (2)

209-212: AccountNumber field addition looks correct

Optional string with proper json tag and doc; consistent with surrounding claims.


209-212: Confirm propagation/usage expectations

If this claim also needs to flow into MUR/UserAccount, consider adding it to PropagatedClaims; if it's only for analytics, current scope is fine. Also confirm registration-service/host-operator changes read and populate this new field from the IdP claim account_number.

api/v1alpha1/zz_generated.openapi.go (1)

1034-1040: OpenAPI schema updated appropriately

New optional property accountNumber with clear description; required set unchanged. Regenerated file aligns with the Go struct.

api/v1alpha1/docs/apiref.adoc (1)

183-183: AsciiDoc escaping for XPreserveUnknownFields braces: LGTM

The added backslash avoids attribute substitution; formatting-only and correct.

Also applies to: 823-823, 939-939, 1067-1067, 1212-1212, 1389-1389, 1556-1556, 1723-1723, 1961-1961, 2383-2383, 2698-2698, 2804-2804, 2926-2926, 3098-3098, 3147-3147, 3400-3400, 3543-3543, 3685-3685, 3805-3805, 4067-4067

@mfrancisc mfrancisc merged commit ca043a6 into codeready-toolchain:master Sep 9, 2025
7 checks passed
@mfrancisc mfrancisc deleted the addaccountnumber branch September 9, 2025 07:51
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