Skip to content

Conversation

@pastorhudson
Copy link
Contributor

Adds slack_attachment mixin. This allows you to build nicely formatted slack attachment messages like the ones below.
drawing
drawing

I put this in mixins but I'm not sure that's where it belongs. The styles are in the mixin and should be customized for personal needs so it seemed like putting it in the Slack io backend wasn't a good idea.

I hope this helps!

skoczen and others added 30 commits November 7, 2017 10:06
@pastorhudson
Copy link
Contributor Author

Ok I think this is good now

@Ashex
Copy link
Collaborator

Ashex commented Nov 26, 2019

Can you throw in the color red to the pre-defined list? And as the commits have gotten a little crazy we'll probably want to squash them during the merge.

pastorhudson and others added 5 commits November 26, 2019 16:52
…lack

Html link converter slack

Added slack_attachment mixin & updated docs

PEP 8 Fixes for CI

Added Attachment Class

Added SlackAttachmentConverter

Removed slack_attachment.py

Updated documentation

Button color fix

Tests for Attachment & SlackAttachmentConverter

tox fixes & Bug Fixes

Test fix hopefully!

Fixed typo

Added  hex style

added custom style test

Added slack_attachment mixin & updated docs

PEP 8 Fixes for CI
Added SlackAttachmentConverter

Removed slack_attachment.py

Button color fix

Tests for Attachment & SlackAttachmentConverter

tox fixes & Bug Fixes

Test fix hopefully!

Fixed typo

Added  hex style

added custom style test

Fixed == string comparisons

Flake8 doesn't like == and doesn't like is. Maybe this works
@pastorhudson
Copy link
Contributor Author

@Ashex I tried to squish a bunch of commits in the rebase. I'm not sure if that helped or made it worse. I admit I'm still on training wheels with git rebase.

Copy link
Collaborator

@Ashex Ashex left a comment

Choose a reason for hiding this comment

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

rebase is a fickle thing so it's amazing but can also result in a really weird rev tree. It's easier to squash during the PR merge so that github can handle it for us.

That said, this looks great and I'll go ahead and approve. The unfortunate reality is that slack has introduced a new format called Blocks since this was originally submitted so attachments are now legacy. This shouldn't stop us from using this as it's a huge improvement to Slack support and will enable devs to make better use of the slack integration.

@pastorhudson
Copy link
Contributor Author

Slack seems to change everything every year. . . I somehow missed the blocks announcement.
I'm sure it wouldn't be too hard to update to the new block format.
Most of the update work is probably in the SlackAttachmentConverter
We can add stuff to the Attachment abstraction class if we need to. As long as we don't remove stuff then it shouldn't break if people are using it.

@Ashex
Copy link
Collaborator

Ashex commented Nov 28, 2019

I only spotted it when I started working on an alerting framework that posted to slack. It's definitely much more flexible with features I was craving when I started using attachments last year.

So we can try incorporating it into the SlackAttachmentConverter but we may run into a wall there (then we'll end up in backwards compatibility hell). Once again I'm stretched a bit thin so I can't lend any dev time to solve this in the immediate (and Reinvent is next week so I'll be busy tracking announcements and watching the sessions).

@pastorhudson
Copy link
Contributor Author

pastorhudson commented Mar 18, 2021

I'm going to look at updating this to the new block format before we merge. It makes sense to only support the new format since nobody is using this (currently) but me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.