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

Interactive Message Response Size Handling #1263

Closed
wants to merge 5 commits into from

Conversation

sadath-12
Copy link
Contributor

@sadath-12 sadath-12 commented Sep 18, 2023

Description

Changes proposed in this pull request:

If resources are request and their size exceeds the max limit of text allowed in slack instead of showing them in a file , we will limit the size to 45 now and only show 45 items maintaining the interactivity for the interactive messages , in the future we will be implementing pagination for this

Related issue(s)

Fixes: #1051

@sadath-12 sadath-12 requested review from a team and mszostok September 18, 2023 10:26
@mszostok mszostok requested review from huseyinbabal and removed request for mszostok September 18, 2023 11:08
@sadath-12 sadath-12 changed the title Sadath dev Interactive Message Response Size Handling Sep 18, 2023
@huseyinbabal huseyinbabal added the enhancement New feature or request label Sep 18, 2023
Signed-off-by: sadath-12 <[email protected]>
@huseyinbabal huseyinbabal self-assigned this Sep 18, 2023
Message: api.Message{
PlaintextInputs: resp.PlaintextInputs,
},
if strings.Contains(resp.Description, "logs") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why there is a condition for logs? I might be executing kubectl describe ... and still I will need pods dropdown, and that means , describe also should be included. Could you please take a look at this part again?

Copy link
Contributor Author

@sadath-12 sadath-12 Sep 19, 2023

Choose a reason for hiding this comment

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

You mean describe should also give file instead ?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, maybe there is a misunderstanding. The primary motivation is to not send an attachment for the interactive blocks. Those blocks are the interactive dropdown elements e.g. namespace, name, verb . So, once you execute kubectl it will show you interactive elements, so that elements should be limited so there wont be an attachment. More concrete example is, once you select namespace, it will return resources (e.g. pods), if those pods > 100 you will see an attachment in the slack UI, you need to prevent that.

Message: api.Message{
PlaintextInputs: resp.PlaintextInputs,
},
if strings.Contains(resp.Description, "logs") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

@sadath-12
Copy link
Contributor Author

This PR was proposed filtering based on the commands but the idea seems to be with the parameters and many other things stepping down from this since haven't spent much time with codebase and its working

@sadath-12 sadath-12 closed this Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interactive Message Response Size Handling
2 participants