Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slack Auto-Read Channel Pattern with Multiple Spaces #9701

Merged
merged 6 commits into from
Jan 2, 2025

Conversation

flvndvd
Copy link
Contributor

@flvndvd flvndvd commented Jan 2, 2025

Description

This PR resolves https://github.com/dust-tt/tasks/issues/1616.

It lets Dust employees whitelist channel patterns that should automatically be added in a specific spaces. This feature was not working with spaces before.

It adds a new column that will store a JSONB object representing patterns with their associated space id. One pattern can exist several times and they will be added in all the associated data source view.

Poke View:
SlackChannelPatterns

Risks

Worst-case it breaks the auto-join channel approach. Safe to rollback.

Deploy Plan

  • Run migration
  • Manually backfilled the 7 connectors in production with patterns
  • Deploy

Copy link

github-actions bot commented Jan 2, 2025

Warnings
⚠️

Files in **/lib/models/ have been modified and the PR has the migration-ack label. Don't forget to run the migration from prodbox.

Generated by 🚫 dangerJS against c4d46ab

@flvndvd flvndvd marked this pull request as ready for review January 2, 2025 15:10
@@ -0,0 +1,2 @@
-- Migration created on Jan 02, 2025
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Better reviewed with hidden whitespaces (here).

const searchParams = new URLSearchParams({
kind: "custom",
vaultId: p.spaceId,
dataSourceId: connector.dataSourceId,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🚗 case typo prevented this code to work before.

});

export type SlackConfiguration = t.TypeOf<typeof SlackConfigurationTypeSchema>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing this type which was duplicated.

Copy link
Contributor

@JulesBelveze JulesBelveze left a comment

Choose a reason for hiding this comment

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

Looks good

this.connectorId
);
if (!slackConfig) {
return new Err(new Error("autoReadChannelPattern is not deprecated"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return new Err(new Error("autoReadChannelPattern is not deprecated"));
return new Err(new Error("autoReadChannelPattern is now deprecated"));

@@ -725,12 +747,23 @@ export class SlackConnectorManager extends BaseConnectorManager<SlackConfigurati
}
return new Ok(botEnabledRes.value.toString());
}

case "autoReadChannelPattern": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's deprecate as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will need to be done in a clean up PR otherwise it prevents loading Poke.

@flvndvd flvndvd added the migration-ack 📁 Label to acknowledge that a migration is required. label Jan 2, 2025
@flvndvd flvndvd merged commit de30a22 into main Jan 2, 2025
7 checks passed
@flvndvd flvndvd deleted the flav/auto-read-slack-channel-w-spaces branch January 2, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
migration-ack 📁 Label to acknowledge that a migration is required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants