Skip to content

Conversation

@aldevv
Copy link
Contributor

@aldevv aldevv commented Sep 23, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Improved account creation via invitation: users now receive a clear confirmation message indicating the invitation was sent, including the invited email address.
    • The operation now returns a proper success indicator instead of an empty response, enabling client apps to reliably detect and handle the outcome.
    • Enhances user feedback and reduces ambiguity during the invite flow without changing any other behaviors.

@coderabbitai
Copy link

coderabbitai bot commented Sep 23, 2025

Walkthrough

CreateAccount in pkg/connector/user.go now returns a populated CreateAccountResponse_ActionRequiredResult with a success message including the user email and sets IsCreateAccountResult to true. Previously, it returned an empty ActionRequiredResult. No other exported declarations changed.

Changes

Cohort / File(s) Summary
Connector: CreateAccount response tweak
pkg/connector/user.go
Populate ActionRequiredResult in CreateAccount with message "User invitation sent successfully" and set IsCreateAccountResult=true instead of returning an empty struct.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Caller
  participant Connector as Connector.CreateAccount
  Caller->>Connector: CreateAccount(email)
  rect rgba(200,235,255,0.3)
    note right of Connector: Send invitation (existing behavior)
  end
  Connector-->>Caller: ActionRequiredResult { message: "User <email> invitation sent successfully", IsCreateAccountResult: true }
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A whisk of ears, a tap-tap key,
I nudge the code to speak with glee—
“Invite sent!” it now declares,
With flags set true and fewer snares.
I hop away, tail all a-flutter,
Another crisp response to utter.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "BB-1546 fix error when provisioning accounts" concisely and accurately summarizes the primary change—fixing account provisioning behavior—and directly relates to the CreateAccount update that returns a proper ActionRequiredResult; it is specific, readable, and free of noise.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix_account_prov_message

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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

@aldevv aldevv changed the title add result true to acc provisioning fix error when provisioning accounts Sep 23, 2025
@aldevv aldevv changed the title fix error when provisioning accounts [BB-1546] fix error when provisioning accounts Sep 23, 2025
@aldevv aldevv merged commit 144f865 into main Sep 23, 2025
5 of 6 checks passed
@aldevv aldevv deleted the fix_account_prov_message branch September 23, 2025 18:53
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/connector/user.go (1)

115-115: Fix incorrect error message (“name” → “email”).

The lookup is for "email" but the error says "name", which is misleading.

Apply this diff:

-        return nil, nil, nil, fmt.Errorf("baton-tableau: name not found in profile")
+        return nil, nil, nil, fmt.Errorf("baton-tableau: email not found in profile")
🧹 Nitpick comments (1)
pkg/connector/user.go (1)

96-96: Unify method receiver naming (u vs o).

Other methods use o *userResourceType. Keep it consistent.

Apply this diff:

-func (u *userResourceType) CreateAccountCapabilityDetails(ctx context.Context) (*v2.CredentialDetailsAccountProvisioning, annotations.Annotations, error) {
+func (o *userResourceType) CreateAccountCapabilityDetails(ctx context.Context) (*v2.CredentialDetailsAccountProvisioning, annotations.Annotations, error) {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d0f06ff and 20f61da.

📒 Files selected for processing (1)
  • pkg/connector/user.go (1 hunks)
🔇 Additional comments (1)
pkg/connector/user.go (1)

131-134: Good: explicit success result with message.

Returning an ActionRequiredResult with a clear message and IsCreateAccountResult: true aligns with the PR goal and should surface a user‑friendly confirmation.

Please confirm that the Baton SDK/UI treats ActionRequiredResult with IsCreateAccountResult: true as a non-blocking success (i.e., no further user action required) and that this field exists in the pinned SDK version.

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