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

Feature: Slack integration #783

Merged
merged 32 commits into from
Jun 12, 2020
Merged

Feature: Slack integration #783

merged 32 commits into from
Jun 12, 2020

Conversation

subintp
Copy link
Contributor

@subintp subintp commented Apr 29, 2020

Pull Request Template

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@subintp subintp marked this pull request as ready for review May 16, 2020 18:16
sojan-official
sojan-official previously approved these changes May 30, 2020
Copy link
Member

@sojan-official sojan-official left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1,5 @@
class AddReferenceIdToConversation < ActiveRecord::Migration[6.0]
def change
add_column :conversations, :reference_id, :string
Copy link
Member

Choose a reason for hiding this comment

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

@subintp since this attribute will only be used in only x % of conversations lets make use of the additional_attributes jsonb column to store the reference id. probably let's name it as 'slack_reference_id` to avoid confusion in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sojan-official Please check the below comment.

@mimikadze
Copy link

Let's go get it guys =) Highly needed.

end

def conversation
@conversation ||= Conversation.where(reference_id: params[:event][:thread_ts]).first
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sojan-official We are fetching the conversation with reference_id to create the new incoming messages from slack.This is the only identifier slack is giving us. We are finding conversation directly by querying it via reference_id. If we move reference_id to addtional_attributes JSONb column we won't able to fetch it with a single query and also looping all conversation and checking for reference_id is not a good approach and also super slow to fetch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sojan-official
Update: It's possible to index the JSONb field. But as discussed I am keeping this as separate, But renamed it to identifier to keep it consistant across the models.

subintp added 2 commits June 2, 2020 16:52
# Conflicts:
#	config/initializers/00_init.rb
#	config/routes.rb
@sojan-official sojan-official merged commit ed1c871 into develop Jun 12, 2020
@sojan-official sojan-official deleted the slack_integration branch June 12, 2020 17:42
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants