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 #170

Merged
merged 10 commits into from Jan 16, 2020
Merged

Slack #170

merged 10 commits into from Jan 16, 2020

Conversation

christopher-schroeder
Copy link
Contributor

This allows snakemake to use an exported slack legacy token to send the user a message on successfully executed and failed workflows. It is written in a way that additional messaging services can be added in near future.
The creators of slack recommend to not use legacy tokens anymore, but their newly provided slack app system. This provides indeed many additional features, but as far as I can see this would require the user to configure the channel for a snakemake communication. Since there would be no improvement in security and the task is to only send simple messages to the executing user, in my opinion the legacy tokens are sufficient.

Copy link
Contributor

@johanneskoester johanneskoester left a comment

Choose a reason for hiding this comment

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

Great work!

Copy link
Contributor

@johanneskoester johanneskoester left a comment

Choose a reason for hiding this comment

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

@sonarcloud
Copy link

sonarcloud bot commented Jan 16, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@johanneskoester johanneskoester merged commit 6371f62 into master Jan 16, 2020
@johanneskoester johanneskoester deleted the slack branch January 16, 2020 13:55
@vincentczhou vincentczhou mentioned this pull request Dec 7, 2023
2 tasks
johanneskoester added a commit that referenced this pull request Dec 13, 2023
### Description

<!--Add a description of your PR here-->

This updates the Slack ``--log-service``  feature added in #170.
The ``Slacker`` package is no longer maintained, and legacy slack tokens
are no longer generatable.
I've replace it with the officially supported [Slack
SDK](https://github.com/slackapi/python-slack-sdk) (see ``setup.cfg``),
preserving the original functionality with minimal adjustments.

This has been minimally tested for functionality. However, the original
implementation has a couple issues (which this PR **does not** address)
-

1. Lack of `docs/` on how to set up the ``--log-service slack`` feature
via Slack
2. Logic is not robust - e.g. when `msg["done"] == msg["total"]`, this
does not mean the workflow is complete (checkpoints)
3. The implementation of ``--log-service slack`` is synchronous, meaning
that Snakemake workflows will wait for the implemented `log_handler`
function to finish. For normal print statements, this isn't an issue,
but repeated calls of Slack WebAPI's `postMessage` can significantly
slow things down. Depending on the workflow (Snakefile), this can become
noticeable.
4. The implementation does not comply with Slack WebAPI's rate limiting.

The current implementation will look like this - messages on slack are
sent by the user, using a user OAuth token.

![image](https://github.com/snakemake/snakemake/assets/43220811/69e3b335-13fc-4af1-8538-8d65920f9494)

I've already addressed points 2, 3, and 4 in a private repository using
``--log-handler`` that should be integrable into this current
implementation, but it has not been robustly tested (integration can
happen at a later PR).

![image](https://github.com/snakemake/snakemake/assets/43220811/97576f52-1c46-4237-806a-e823bd76f9f7)

Thanks!

### QC
<!-- Make sure that you can tick the boxes below. -->

* [ ] The PR contains a test case for the changes or the changes are
already covered by an existing test case.
* [ ] The documentation (`docs/`) is updated to reflect the changes or
this is not necessary (e.g. if the change does neither modify the
language nor the behavior or functionalities of Snakemake).

---------

Co-authored-by: Johannes Köster <johannes.koester@tu-dortmund.de>
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.

None yet

2 participants