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

Add a flag to send dry-run results to slack #492

Merged
merged 5 commits into from
Jan 16, 2025
Merged

Conversation

bram-vdberg
Copy link
Contributor

This PR adds a flag to send the results from the dry-run to a slack channel.

@bram-vdberg bram-vdberg marked this pull request as ready for review January 15, 2025 12:38
@bram-vdberg bram-vdberg requested review from harisang and fhenneke and removed request for harisang January 15, 2025 12:38
Copy link
Collaborator

@fhenneke fhenneke left a comment

Choose a reason for hiding this comment

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

What is the purpose of this feature?

Do we want to see results of test runs? Then just looking at the workflow logs would work fine.
Do we want to make sure that posting to slack works? Then I would prefer a test which posts to slack.

In both cases, I would avoid posting messages to a channel used for actual payouts.

src/fetch/transfer_file.py Show resolved Hide resolved
src/fetch/transfer_file.py Show resolved Hide resolved
parser.add_argument(
"--send-to-slack",
action="store_true",
help="Flag indicating whether or not the script should send the results to a slack channel",
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I read the code correctly, a slack message is also posted without this flag if the --post-tx flag is set.

Those flags could profit from some clean-up. Also, the manual_propose and auto_propose have become somewhat similar. Merging them and splitting off some functionality for removing transfers would make it easier to understand what those functions do and how those flags enter into the logic.

Copy link
Contributor Author

@bram-vdberg bram-vdberg Jan 15, 2025

Choose a reason for hiding this comment

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

I tried running the dry run with the --post-tx flag and ran into this error:

assert signing_key is not None

I think that still wouldn't send the slack message though because of this part:

if not dry_run:
slack_channel = config.io_config.slack_channel

Copy link
Collaborator

Choose a reason for hiding this comment

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

The current main is not easy to understand and this PR makes it even a bit more complicated. We can still proceed with merging, I add an issue about cleaning up flags.

Copy link
Collaborator

@fhenneke fhenneke left a comment

Choose a reason for hiding this comment

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

Can be merged as is to move forward with test runs. I created the issue #494 for cleaning up command line arguments.

@bram-vdberg bram-vdberg merged commit a3213a8 into main Jan 16, 2025
6 checks passed
@bram-vdberg bram-vdberg deleted the Add-Slack-Flag branch January 16, 2025 11:40
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2025
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.

2 participants