Skip to content

fix grcp error mappings#77

Merged
luisina-santos merged 1 commit intomainfrom
luisinasantos/fix-grcp-mappings
Mar 3, 2026
Merged

fix grcp error mappings#77
luisina-santos merged 1 commit intomainfrom
luisinasantos/fix-grcp-mappings

Conversation

@luisina-santos
Copy link
Contributor

@luisina-santos luisina-santos commented Mar 3, 2026

Issue found during CHX-434 validation
Datails: https://linear.app/ductone/issue/CXH-434/investigate-and-resolve-no-such-subteam-error-in-slack-connector#comment-621754c0

Before this change:
image

After fix:
image

Summary by CodeRabbit

  • Style

    • Configuration declaration formatting improvements for consistency.
  • Refactor

    • Error handling refinements for improved internal code quality.

@luisina-santos luisina-santos requested a review from a team March 3, 2026 15:30
@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6980a92 and 3e8cff6.

📒 Files selected for processing (2)
  • pkg/config/conf.gen.go
  • pkg/connector/client/helpers.go

📝 Walkthrough

Walkthrough

Two focused changes: formatting adjustments to struct field declarations in the configuration file, and type corrections in error variable declarations within the Slack client helper functions, changing pointer types to value types with corresponding adjustments to error handling calls.

Changes

Cohort / File(s) Summary
Configuration Formatting
pkg/config/conf.gen.go
Struct field formatting adjustments: Token and GovEnv field tag declarations moved inline. Added spacing after imports. No behavioral changes.
Error Variable Type Corrections
pkg/connector/client/helpers.go
Changed error variable declarations in WrapError from pointer types (*slack.StatusCodeError, *slack.SlackErrorResponse) to value types, with corresponding errors.As() calls updated to pass variable addresses.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Formatting tidies up the line,
Error types now less opaque,
Pointers shift to values fine,
Slack's connection, gently awake!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix grcp error mappings' is vague and contains a typo ('grcp' instead of 'gRPC'), making it unclear and potentially misleading. Clarify the title by correcting the typo and being more specific about what error mappings are being fixed, for example: 'Fix gRPC error code mapping for authentication failures'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch luisinasantos/fix-grcp-mappings

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Claude finished @luisina-santos's task in 1m 38s —— View job


PR Review: fix gRPC error mappings

Issues: 0

  • Gather context and read changed files
  • Review code changes
  • Post review feedback

Breaking Changes

None.

Issues

None found. The fix is correct.

Analysis: The Slack library returns StatusCodeError and SlackErrorResponse as value types (not pointers):

  • misc.go:320return StatusCodeError{Code: resp.StatusCode, Status: resp.Status}
  • misc.go:41return SlackErrorResponse{Err: t.Error, ResponseMetadata: t.ResponseMetadata}

Both types implement error with value receivers. Before this PR, using *slack.StatusCodeError as the target variable made errors.As look for *StatusCodeError in the error chain — which never matched the value types the library actually returns. All Slack errors fell through to codes.Unknown.

After this PR, using value types as errors.As targets correctly matches, enabling proper gRPC code mapping (e.g., Unauthenticated, PermissionDenied, Unavailable).

Note: RateLimitedError correctly remains a pointer target since its Error() method uses a pointer receiver (func (e *RateLimitedError) Error() string).

Documentation

Up to date — no capability, config, or credential changes.

@luisina-santos luisina-santos merged commit f123e25 into main Mar 3, 2026
5 checks passed
@luisina-santos luisina-santos deleted the luisinasantos/fix-grcp-mappings branch March 3, 2026 15:34
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