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] Read message cross channels #1110

Open
ShihChun-H opened this issue Sep 24, 2024 · 34 comments
Open

[Slack] Read message cross channels #1110

ShihChun-H opened this issue Sep 24, 2024 · 34 comments
Labels
component feature New feature or request good-first-issue Good for newcomers hacktoberfest hacktoberfest2024 Component improvement issues for Hacktoberfest 2024 help-wanted Help from the community is appreciated improvement Improvement on existing features instill core Label

Comments

@ShihChun-H
Copy link
Member

ShihChun-H commented Sep 24, 2024

Issue Description

Current State

  • Slack cannot read message across different channels

Why We Want to Change?

  • Users want to build a pipeline for the similar channels with only one Slack component.
    • For example, in InstillAI, we have dev-xxx channels that we could want to have the same automation flow.

Proposed Change

  • prefix / suffix of channel name for users to scan the channels

Rules for the Component Hackathon

  • Each issue will only be assigned to one person/team at a time.
  • You can only work on one issue at a time.
  • To express interest in an issue, please comment on it and tag @kuroxx, allowing the Instill AI team to assign it to you.
  • Ensure you address all feedback and suggestions provided by the Instill AI team.
  • If no commits are made within five days, the issue may be reassigned to another contributor.
  • Join our Discord to engage in discussions and seek assistance in #hackathon channel. For technical queries, you can tag @chuang8511.

Component Contribution Guideline | Documentation | Official Go Tutorial

@ShihChun-H ShihChun-H added documentation Improvements for instill.tech/docs tutorial Improvements for instill.tech/tutorials need-triage Need to be investigated further hacktoberfest2024 Component improvement issues for Hacktoberfest 2024 labels Sep 24, 2024
Copy link

linear bot commented Sep 24, 2024

@ShihChun-H ShihChun-H added help-wanted Help from the community is appreciated improvement Improvement on existing features feature New feature or request instill core component and removed documentation Improvements for instill.tech/docs tutorial Improvements for instill.tech/tutorials need-triage Need to be investigated further labels Sep 24, 2024
@chuang8511 chuang8511 added the good-first-issue Good for newcomers label Sep 25, 2024
@Joycelyn-Chen
Copy link

Hello @ShihChun-H, I'm interested in working on this issue for Hacktoberfest!

@ShihChun-H
Copy link
Member Author

Hi @Joycelyn-Chen, Sounds great! This issue is assigned to you.

@aazam-gh
Copy link

aazam-gh commented Oct 3, 2024

Hi, can I work on this? :)

@ShihChun-H
Copy link
Member Author

@aazam-gh Sure! The issue has been assigned to you.

@ShihChun-H
Copy link
Member Author

Hi @aazam-gh, I'm following up to check on any progress made regarding this issue. Could you please provide an update? Thanks 🙏

@aazam-gh
Copy link

aazam-gh commented Oct 9, 2024

Hi sorry for not replying sooner. Seems like I need to have an appropriate nvidia driver

make: *** [Makefile:68: latest] Error 1
alcadeus@warmachine:~/instill-core$ 

getting this error when running the make command to start services

@chuang8511
Copy link
Member

chuang8511 commented Oct 9, 2024

Hi @aazam-gh

Did you run make latest PROFILE=all in instill-core?

@aazam-gh
Copy link

@chuang8511 Yes I am running that command

@aazam-gh
Copy link

[sudo] password for alcadeus: 
make[1]: Entering directory '/home/alcadeus/instill-core'
make[1]: Leaving directory '/home/alcadeus/instill-core'
[+] Running 11/12
 ✔ Container pg-sql           Healthy                                                                                                                                   3.0s 
 ✔ Container elasticsearch    Healthy                                                                                                                                  11.0s 
 ✔ Container minio            Started                                                                                                                                   0.5s 
 ✔ Container milvus           Started                                                                                                                                   0.4s 
 ✔ Container redis            Healthy                                                                                                                                   5.9s 
 ✔ Container influxdb         Healthy                                                                                                                                   6.1s 
 ✔ Container temporal         Started                                                                                                                                  11.3s 
 ✔ Container openfga_migrate  Started                                                                                                                                   3.2s 
 ✔ Container console          Started                                                                                                                                   0.6s 
 ✔ Container registry         Started                                                                                                                                   6.2s 
 ✔ Container api-gateway      Started                                                                                                                                   6.3s 
 ⠸ Container ray-server       Starting                                                                                                                                 11.3s 
Error response from daemon: could not select device driver "nvidia" with capabilities: [[gpu]]
make: *** [Makefile:68: latest] Error 1
alcadeus@warmachine:~/instill-core$ 

@chuang8511
Copy link
Member

Hi @aazam-gh
Thanks for your report.
sudo might be the cause.

Could you not use sudo?

@aazam-gh
Copy link

Let me try it. I will have to give user access to docker first

@aazam-gh
Copy link

aazam-gh commented Oct 11, 2024

@chuang8511 same result :(

alcadeus@warmachine:~/instill-core$ make latest PROFILE=all
make[1]: Entering directory '/home/alcadeus/instill-core'
make[1]: Leaving directory '/home/alcadeus/instill-core'
[+] Running 12/13
 ✔ Container console          Running                                                                                                                                   0.0s 
 ✔ Container minio            Running                                                                                                                                   0.0s 
 ✔ Container pg-sql           Healthy                                                                                                                                   0.5s 
 ✔ Container influxdb         Healthy                                                                                                                                   0.5s 
 ✔ Container redis            Healthy                                                                                                                                   0.5s 
 ✔ Container elasticsearch    Healthy                                                                                                                                   0.5s 
 ✔ Container api-gateway      Running                                                                                                                                   0.0s 
 ✔ Container milvus           Running                                                                                                                                   0.0s 
 ✔ Container registry         Running                                                                                                                                   0.0s 
 ✔ Container openfga_migrate  Started                                                                                                                                   0.7s 
 ✔ Container temporal         Running                                                                                                                                   0.0s 
 ✔ Container temporal-ui      Running                                                                                                                                   0.0s 
 ⠦ Container ray-server       Starting                                                                                                                                  0.7s 
Error response from daemon: could not select device driver "nvidia" with capabilities: [[gpu]]
make: *** [Makefile:68: latest] Error 1
alcadeus@warmachine:~/instill-core$ 

@chuang8511
Copy link
Member

@aazam-gh

You probably have NVIDIA driver installed on his machine which will enable GPU features in instill-core by default.

If you really cannot run instill-core, you can just directly run pipeline-backend.
About end-to-end test part, we will help you confirm it.

Please just make sure that the unit test is ok.

Will it be ok to you?

@aazam-gh
Copy link

Yes that will be fine. What command should I run then instead?

@chuang8511
Copy link
Member

chuang8511 commented Oct 11, 2024

go test ./pkg/component/application/slack/v0/... to verify the test

make gen-component-doc to verify JSON schema

@kuroxx
Copy link
Collaborator

kuroxx commented Oct 15, 2024

Hey @aazam-gh how's it going? We're you able to resolve the issue? If not, you can join our Discord server: https://discord.gg/sevxWsqpGh where others may be able to help!

@VibhorGits
Copy link

Hey @aazam-gh @kuroxx
I would like to work on the issue if it's open for contributions now.

@aazam-gh
Copy link

Yeah, I won't have enough time to continue working on this

@aazam-gh aazam-gh removed their assignment Oct 20, 2024
@VibhorGits
Copy link

Thanks @aazam-gh
I should start contributing while the issue is reassigned :)

@kuroxx
Copy link
Collaborator

kuroxx commented Oct 21, 2024

Thanks @aazam-gh for letting us know!

Hey @VibhorGits I have assigned the issue to you now 🤝 Happy Hacking 👻

@VibhorGits
Copy link

Hey @kuroxx, I’ve started reading the Slack documentation
and made some progress with implementing the array of channel names using regexp.
Could you please assist me out with prefix / suffix of channel name for users to scan the channels.
I doesn't seem clear to me.

@chuang8511
Copy link
Member

Hi @VibhorGits
Thanks for your question.

Currently, the users need to input the exact channel name to fetch the conversations in Slack.
After this feature, we expect the users can fetch the conversations in Slack only inputing the prefix or suffix of the channel name.

e.g. there are channel names called

  • dev-frontend
  • dev-backend
  • dev-devop

When the users input dev, the users can fetch the conversations in all three channels above.

@VibhorGits
Copy link

Hey @chuang8511 my apology to interrupt you on the above issue
Currently I would like to get some feedback on the first part of the proposed changes:
array of channel names with regexp

I made the following changes in the tasks.json file

 "TASK_READ_MESSAGE": {
    "instillShortDescription": "Get the latest message since specific date",
    "input": {
      "description": "Please input the channel name and the date that we want to start to read",
      "instillUIOrder": 0,
      "properties": {
        "channel-name": {
          "description": "Channel name, as displayed on Slack",
          "instillAcceptFormats": [
            "array"
          ],
          "instillUIMultiline": true,
          "instillUIOrder": 0,
          "instillUpstreamTypes": [
            "value",
            "reference",
            "template"
          ],
          "title": "Channel Name",
          "type": "array",
          "items": {
          "type": "string"
          }
        },
"TASK_WRITE_MESSAGE": {
    "instillShortDescription": "send message to a specific channel",
    "title": "Send Message",
    "input": {
      "description": "Input",
      "instillUIOrder": 0,
      "properties": {
        "channel-name": {
          "description": "Channel name, as displayed on Slack",
          "instillAcceptFormats": [
            "array"
          ],
          "instillUIMultiline": true,
          "instillUIOrder": 0,
          "instillUpstreamTypes": [
            "value",
            "reference",
            "template"
          ],
          "title": "Channel Name",
          "type": "array",
          "items": {
            "type": "string"
          }
        },

@chuang8511
Copy link
Member

chuang8511 commented Oct 21, 2024

        "channel-name": {
          "description": "Channel name, as displayed on Slack",
          "instillAcceptFormats": [
            "array"
          ],

"channel-name" -> "channel-names"

"description": "Channel name, as displayed on Slack", -> "description": "Enter a partial or complete channel name to fetch conversations. For example, typing 'dev' retrieves conversations from all channels containing 'dev', such as 'dev-frontend', 'dev-backend', and 'dev-devop'."

And, you don't have to modify the write part.

@VibhorGits
Copy link

Thank you @chuang8511
I revert back all the changes in the write part to original and made the following changes in the read part.
I also tried to implement the regex pattern functionality inside the input section.
What you think?

"TASK_READ_MESSAGE": {
    "instillShortDescription": "Get the latest message since specific date",
    "input": {
      "description": "Please input the channel name and the date that we want to start to read",
      "instillUIOrder": 0,
      "properties": {
        "channel-names": {
          "description": "Enter a partial or complete channel name to fetch conversations.",
          "instillAcceptFormats": [
            "array"
          ],
          "instillUIMultiline": true,
          "instillUIOrder": 0,
          "instillUpstreamTypes": [
            "value",
            "reference",
            "template"
          ],
          "title": "Channel Name",
          "type": "array",
          "items": {
          "type": "string"
          }
        },
        "channel-regex": {
        "description": "Regular expression to filter channel names",
        "instillAcceptFormats": [
          "string"
        ],
        "instillUIOrder": 1,
        "title": "Channel Regex",
        "type": "string"
        },

@chuang8511
Copy link
Member

        "channel-regex": {
        "description": "Regular expression to filter channel names",
        "instillAcceptFormats": [
          "string"
        ],
        "instillUIOrder": 1,
        "title": "Channel Regex",
        "type": "string"
        },

After thinking again, how about removing regex part?

regex for channel name may too difficult for users to input.
And, I suspect the channel should be easy to group by suffix or prefix in the most of use cases.

@VibhorGits
Copy link

Yea sure we can go with either one of them and suffix/prefix should be easier in most cases as you said.
I went along with regex part as the suffix/prefix implementation wasn't quite clear to me.
So now I need to add the suffix/prefix only to my read part, that's it @chuang8511 ?

@chuang8511
Copy link
Member

So now I need to add the suffix/prefix only to my read part, that's it @chuang8511 ?

Yes, please! Thank you!

@VibhorGits
Copy link

Sure ! @chuang8511
Here's the required changes

 "TASK_READ_MESSAGE": {
    "instillShortDescription": "Get the latest message since specific date",
    "input": {
      "description": "Please input the channel name and the date that we want to start to read",
      "instillUIOrder": 0,
      "properties": {
        "channel-names": {
          "description": "Enter a partial or complete channel name to fetch conversations.",
          "instillAcceptFormats": [
            "array"
          ],
          "instillUIMultiline": true,
          "instillUIOrder": 0,
          "instillUpstreamTypes": [
            "value",
            "reference",
            "template"
          ],
          "title": "Channel Name",
          "type": "array",
          "items": {
          "type": "string"
          }
        },
		  "prefix": {
		  "description": "Prefix to add to each channel name",
		  "instillAcceptFormats": [
		  "string"
		  ],
		  "instillUIOrder": 1,
		  "title": "Prefix",
		  "type": "string"
		},
		"suffix": {
		  "description": "Suffix to add to each channel name",
		  "instillAcceptFormats": [
		  "string"
		  ],
		  "instillUIOrder": 2,
		  "title": "Suffix",
		  "type": "string"
		},
        "start-to-read-date": {
          // REMAINING CODE
          }

@chuang8511
Copy link
Member

@VibhorGits
Oh, sorry. I miss to read your code.

Please use this definition.

        "channel-names": {
          "description": "Enter a partial or complete channel name to fetch conversations. For example, typing 'dev' retrieves conversations from all channels containing 'dev', such as 'dev-frontend', 'dev-backend', and 'dev-devop'.",
          "instillAcceptFormats": [
            "array"
          ],

With only channel-names, the users can set the channel partially or completely.
Don't have to let the users add prefix or suffix.

		  "prefix": {
		  "description": "Prefix to add to each channel name",
		  "instillAcceptFormats": [
		  "string"
		  ],
		  "instillUIOrder": 1,
		  "title": "Prefix",
		  "type": "string"
		},
		"suffix": {
		  "description": "Suffix to add to each channel name",
		  "instillAcceptFormats": [
		  "string"
		  ],
		  "instillUIOrder": 2,
		  "title": "Suffix",
		  "type": "string"
		},

@VibhorGits
Copy link

VibhorGits commented Oct 22, 2024

No worries @chuang8511
Ok so I dont need to add prefix/suffix and the following code is enough to get the desired functionality where
I need to retrieve conversation from for ex: 'dev-frontend', 'dev-backend' when typing 'dev'.

"channel-names": {
  "description": "Enter a partial or complete channel name to fetch conversations. For example, typing 'dev' retrieves conversations from all channels containing 'dev'.",
  "instillAcceptFormats": [
    "array"
  ],
  "instillUIMultiline": true,
  "instillUIOrder": 0,
  "instillUpstreamTypes": [
    "value",
    "reference",
    "template"
  ],
  "title": "Channel Name",
  "type": "array",
  "items": {
    "type": "string"
  }
}

@VibhorGits
Copy link

Hey @kuroxx @chuang8511 I created a PR.
Check it out : PR

@kuroxx
Copy link
Collaborator

kuroxx commented Nov 4, 2024

Hey @VibhorGits as discussed on Discord, without being able to test your own code will make it difficult for our reviewers to check your code for you so I will de-assign you from this ticket now, Thanks! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component feature New feature or request good-first-issue Good for newcomers hacktoberfest hacktoberfest2024 Component improvement issues for Hacktoberfest 2024 help-wanted Help from the community is appreciated improvement Improvement on existing features instill core Label
Projects
Status: In Progress
Development

No branches or pull requests

7 participants