Repository navigation
feat: support the user_connections manifest feature - #688
Conversation
Add features.user_connections (is_enabled, auth_hosts) to the app manifest types so the field round-trips through run, deploy, and manifest sync instead of being dropped when the manifest is decoded. Both fields are required by the manifest schema, so neither is omitted when empty: a disabled feature keeps its auth hosts. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #688 +/- ##
==========================================
+ Coverage 78.11% 78.14% +0.02%
==========================================
Files 239 239
Lines 18135 18135
==========================================
+ Hits 14167 14171 +4
+ Misses 3968 3964 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
A plain bool without omitempty turned a missing is_enabled into false, so Slack's required-field check never fired and the feature was silently disabled. IsEnabled is now a pointer, like CodeChannels.Enabled: an explicit false (with its auth_hosts) still round-trips, while an omitted field reaches Slack as missing and is rejected. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mwbrooks
left a comment
There was a problem hiding this comment.
Thanks @WilliamBergamin - this matches the code_channels pattern and looks good.
❓ Question: I checked the shape against the manifest schema in the Slack API: is_enabled and auth_hosts both look to be required whenever user_connections is declared. Are you certain that it's safe to is_enabled a pointer and leave validation to Slack?
| Search *Search `json:"search,omitempty" yaml:"search,flow,omitempty"` | ||
| RichPreviews *RichPreviews `json:"rich_previews,omitempty" yaml:"rich_previews,flow,omitempty"` | ||
| CodeChannels *CodeChannels `json:"code_channels,omitempty" yaml:"code_channels,flow,omitempty"` | ||
| UserConnections *UserConnections `json:"user_connections,omitempty" yaml:"user_connections,flow,omitempty"` |
There was a problem hiding this comment.
praise: 👌🏻 omitempty looking good
| // connection flow. IsEnabled is a pointer so an explicit `false` (feature turned | ||
| // off) is distinguishable from an unset field, which Slack rejects as missing. | ||
| type UserConnections struct { | ||
| IsEnabled *bool `json:"is_enabled,omitempty" yaml:"is_enabled,omitempty"` |
There was a problem hiding this comment.
note: Thanks for calling out that the is_enabled bool is intentionally a pointer because it's an optional param that can fallback on the Slack API default value.
|
@mwbrooks Good question, I checked the schema too: both are required, with no default. That's why is_enabled is a pointer. A plain bool with |
@WilliamBergamin Good point that the manifest validation will enforce it and explain that it's required. I prefer that we keep it as-is with the |
Changelog
The
features.user_connectionsapp manifest property (is_enabled,auth_hosts) is now supported, so it is kept byrun,deploy, andmanifest sync.Summary
The CLI decodes
manifest.json(or theget-manifesthook output) into typed manifest structs, so any property it does not model is silently dropped before the manifest is sent to Slack. This addsfeatures.user_connectionstoAppFeaturesso apps that opt into the standardized user connection flow keep that setting.is_enabledis a pointer, likecode_channels.enabled, so an explicitfalseis kept and a missing value is left for Slack to reject.Preview
slack manifest info --source localwithfeatures.user_connectionsinmanifest.json:Before (
main): the property is strippedAfter (this branch): the property round-trips
Testing
Test_AppManifest_AppFeaturesfor enabled and explicitly disableduser_connections.Test_AppManifest_AppFeatures_UserConnectionsdecodes manifest JSON, asserts the typed value, and checks it re-marshals unchanged (undefined, enabled, disabled with hosts, omitted fields).make testpasses (lint: 0 issues).mainand this branch, ranslack manifest info --source localon a sample project with the property (output above).Notes
user_connectionsto slackapi/manifest-schema so editors stop flagging it.Requirements
🤖 Generated with Claude Code