Skip to content

remove delete#51

Merged
aldevv merged 2 commits intomainfrom
remove_delete
Sep 29, 2025
Merged

remove delete#51
aldevv merged 2 commits intomainfrom
remove_delete

Conversation

@aldevv
Copy link
Contributor

@aldevv aldevv commented Sep 25, 2025

Summary by CodeRabbit

  • Breaking Changes

    • Deleting users via the Slack integration is no longer supported; delete requests now return an immediate error.
  • User Impact

    • Automations or workflows that attempted to delete users will fail with a “delete user not supported” message.
    • Use Slack’s native admin tools for user removal and update any processes accordingly.

@coderabbitai
Copy link

coderabbitai bot commented Sep 25, 2025

Walkthrough

Removed the Delete method from the user resource type; the connector no longer exposes any code path to delete Slack users via this resource (previous Slack API calls, enterprise checks, and rate-limit handling were removed).

Changes

Cohort / File(s) Summary
User deletion removal
pkg/connector/user.go
Deleted the Delete method for the user resource type, removing all logic that previously performed Slack API calls, enterprise-client checks, and rate-limit handling; deletion capability via this connector is removed.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Caller
  participant Connector as UserConnector
  Note over Caller,Connector: New flow (post-change)
  Caller->>Connector: Delete(user)
  Note right of Connector: No Delete implementation exists\n(no external Slack interaction)
  Connector-->>Caller: (no deletion capability exposed)
Loading
sequenceDiagram
  autonumber
  actor Caller
  participant Connector as UserConnector
  participant Slack as Slack API
  Note over Caller,Slack: Prior flow (removed)
  Caller->>Connector: Delete(user)
  Connector->>Slack: Lookup user / Remove (enterprise client)
  Slack-->>Connector: Success / Rate limit / Error
  alt success
    Connector-->>Caller: nil
  else rate limited
    Connector-->>Caller: Retryable/RateLimit error
  else errors
    Connector-->>Caller: Specific error
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A rabbit nudged the delete key light,
Found the path had hopped away from sight.
No API bustle, no frantic run—
Quiet code, and simpler fun. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title “remove delete” lacks context and specificity, making it unclear which delete functionality is being removed; it should explicitly mention the deleted method or resource type. Please update the title to clearly describe the primary change, for example “Remove Delete method from userResourceType in Slack connector” so that it immediately conveys the removed functionality and its scope.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 remove_delete

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 279f0b5 and 03f7942.

📒 Files selected for processing (1)
  • pkg/connector/user.go (0 hunks)
💤 Files with no reviewable changes (1)
  • pkg/connector/user.go
⏰ 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: test-member

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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c896aa and 279f0b5.

📒 Files selected for processing (1)
  • pkg/connector/user.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: test-member

Comment on lines 304 to 307
// Delete user can't be done via the Slack API.
func (o *userResourceType) Delete(ctx context.Context, resourceId *v2.ResourceId) (annotations.Annotations, error) {
if o.enterpriseClient == nil {
return nil, fmt.Errorf("baton-slack: enterprise client required for user deletion")
}

userID := resourceId.Resource
outputAnnotations := annotations.New()

user, ratelimitData, err := o.enterpriseClient.GetUserInfo(ctx, userID)
outputAnnotations.WithRateLimiting(ratelimitData)
if err != nil {
return outputAnnotations, fmt.Errorf("baton-slack: failed to get user info: %w", err)
}

ratelimitData, err = o.enterpriseClient.RemoveUser(ctx, user.Profile.Team, userID)
outputAnnotations.WithRateLimiting(ratelimitData)
if err != nil {
if err.Error() == enterprise.SlackErrUserAlreadyDeleted {
return outputAnnotations, nil
}
return outputAnnotations, fmt.Errorf("baton-slack: failed to delete user %s: %w", userID, err)
}

return outputAnnotations, nil
return nil, fmt.Errorf("baton-slack: delete user not supported")
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Return the standardized “not implemented” error.

The rest of the connector surface uses the shared connectorbuilder.ErrNotImplemented (or wraps it) to signal unsupported operations. Returning a plain fmt.Errorf here deviates from that contract, so the SDK will treat this as an opaque failure instead of a capability verdict. Please swap the error for the canonical sentinel (and wrap with context/fmt.Errorf if you need a message).

🤖 Prompt for AI Agents
In pkg/connector/user.go around lines 304 to 307, the Delete implementation
returns a plain fmt.Errorf which deviates from the connector contract; replace
the returned error with the shared sentinel connectorbuilder.ErrNotImplemented
(or wrap it with fmt.Errorf to add context, e.g. fmt.Errorf("delete user: %w",
connectorbuilder.ErrNotImplemented)) so the SDK recognizes this as an
unsupported operation rather than an opaque failure.

@aldevv aldevv requested review from a team and btipling September 25, 2025 22:19
@agustin-conductor agustin-conductor requested a review from a team September 26, 2025 17:36
@aldevv aldevv merged commit eba318e into main Sep 29, 2025
8 checks passed
@aldevv aldevv deleted the remove_delete branch September 29, 2025 16:35
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

Comments