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 integration #1384

Open
28 of 36 tasks
JanCizmar opened this issue Sep 30, 2022 · 2 comments · May be fixed by #2247
Open
28 of 36 tasks

Slack integration #1384

JanCizmar opened this issue Sep 30, 2022 · 2 comments · May be fixed by #2247
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@JanCizmar
Copy link
Contributor

JanCizmar commented Sep 30, 2022

Basics

Users will be able to subscribe to a Tolgee project from a Slack channel, and when permitted, they will be able to modify translated values directly from Slack.

  • Users are able to subscribe to a project in a private or public channel /tolgee subscribe <projectId>
    • By default, it subscribes to all languages in the project, and the messages are only visible to the subscribing user.
    • The user won't see controlling elements for a global subscription. Since they can have MANAGE permission to project and can technically modify all the language translations, they probably don't want to touch them, though.
    • The user will be able to change the visibility using an argument. /tolgee subscribe <projectId> --visibility all-in-channel. In that case, even users who are not logged into the platform will see the changes.
  • User will be able to subscribe to specific language /tolgee subscribe <projectId> <languageTag>. Then, the user will get notified when
    • A new key is created
    • Base value is changed
    • The value in the language is changed

The default settings would notify users a lot, especially in bigger projects. To avoid this, we need to introduce some configuration parameter so users can define, what events they would like to listen to.

  • Add configuration parameter --on <event name>
    Event names:
    • new-key - new key is created
    • base-changed - base value for an language is changed
    • translation-changed - the translation in the selected language is modified. e.g. If user executes /toglee subscribe 1 fr --on translation-changed, they will be notified when french value is modified, but not when new key is created nor base language value changed.

Data modification

With Tolgee Slack integration, users can update or review the translation texts directly from the Slack integration.

  • Users can set translated value when they have the permission to
  • User can review a value provided by another user
  • When translated value or state changes in a defined period of time (2 hours), the original message is updated
  • The database is cleaned, so we don't store data which we don't need anymore
  • Only users with permissions to each operation will see the inputs and buttons to modify the data.

Message merging

When there are multiple subscriptions in a single channel, the messages are merged, so a single event is not displayed multiple times. For example, the user executes /tolgee subscribe 1 and then executes /tolgee subscribe en. For the first command, they wouldn't see the controlling elements (as described above) since it was a global subscription. For the second command, the elements will be sent in message.

  • Messages are merged

Larger data modification

Users can modify many keys at once for imports (via import endpoint or key import endpoints). In this case, we don't want to send that many messages to the Slack channel. Instead, we send one message with a link to the Tolgee Platform so they can edit it there

  • Larger data modifications are sent as one message with a link to tolgee for events with 10+ messages

The message UI and controlling elements

The message should contain:

  • Key name
  • Key namespace
  • The base language translation value
  • The value in the subscribed language (or the modified one)
  • The state as the attachment bar color
  • Link to Tolgee platform to modify the string

Non-functional requirements

  • Check how many SQL queries are executed for the operations
  • Try not to load unnecessary data (use DTOs instead of entities for reading)
  • Write tests for the Webhook endpoint
  • Write tests for the communication with Slack SDK by mocking it

Organization and Workspace pairing & UI

  • For better security, we need to pair workspace and organization first
  • Endpoint returning whether organization is paired
  • Endpoint returning all the subscriptions in organization showing
    • The workspace name
    • The author of subscription
    • The channel name
  • Endpoint removing the workspace & organization pairing removing all the subscriptions
@ludovicobesana
Copy link

@JanCizmar If you need some help I can take this

@JanCizmar JanCizmar added good first issue Good for newcomers and removed hacktoberfest labels Nov 11, 2022
@github-actions github-actions bot added the stale label Mar 11, 2023
@tolgee tolgee deleted a comment from ludovicobesana Mar 11, 2023
@JanCizmar JanCizmar added enhancement New feature or request and removed stale labels Mar 11, 2023
@JanCizmar JanCizmar reopened this Mar 11, 2023
@tolgee tolgee deleted a comment from github-actions bot Feb 12, 2024
@JanCizmar
Copy link
Contributor Author

JanCizmar commented Feb 12, 2024

I've updated the issue with new spec. @huglx is done with PFC, now we just need to do all of the serious work. 🚀

@JanCizmar JanCizmar linked a pull request Apr 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants