feat: make slack notification explictly opt in - #60
Conversation
metalwarrior665
left a comment
There was a problem hiding this comment.
Looks good, just small nits
There was a problem hiding this comment.
Why not just like this? (just format it after me :) ) Not sure why we would log error if we choose to not notify.
Suggested change
if (notifySlack) {
await notifyToSlack({
changedFiles,
commits,
changelog,
repository,
dryRun,
author,
});
};
There was a problem hiding this comment.
I thought that since not sending the notification is the default, having a message that texplicitly says that you can actually send the notification can be informative, for either people that do not know how to set it up and people who simply forgot to add the flag
| console.error('SLACK:', slackMessage); | ||
| console.error('\tblocks:', blocks.join('\n\t\t')); | ||
|
|
||
| if (!notifySlack) { |
There was a problem hiding this comment.
I would move this above the channel selection as it is part of the slack logic
There was a problem hiding this comment.
Hm, I wanted to leave this in because I liked the message, but I guess the diff will be enough to evaluate the results 👍
| (args) => | ||
| args | ||
| .option('report-file', { type: 'string', demandOption: true }) | ||
| .option('notify-slack', { type: 'boolean', default: false }) |
There was a problem hiding this comment.
If we would want to make this more usable outside of our team, we would probably need to make the Slack channels configurable etc. but for now this will do
There was a problem hiding this comment.
since this is already a breaking change, what if we added now 2 new cli arguments for defining slack channels instead of this flag?
So instead of
apify-test-tools --notify-slackwe'd have
apify-test-tools --report-slack-channel '#notif-google-maps' --release-slack-channel '#delivery-public-actor'#delivery-public-actorcould be a variable at the org level#notif-google-mapswe'd take it from the env: `"#notif-$(echo $GITHUB_REPOSITORY | cut -d '/' -f 2)"- use
catto remove theapify-store/part
- use
In the GH workflow file, we would have:
npx apify-test-tools release --push-event-path ${{ github.event_path }} --release-slack-channel ${{ var.release_slack_channel }} --report-slack-channel "#notif-$(echo $GITHUB_REPOSITORY | cut -d "/" -f 2)"There was a problem hiding this comment.
I wouldn't worry about breaking changes, this is used only with us and we control https://github.com/apify-store/github-actions-source :)
Feel free to go with the suggested change although I don't think it is really needed at this point. But it would be good to eventually look at the whole thing and try to restructure it so it is more generally usable. Like now it would still rely on the slack tokens in env.
There was a problem hiding this comment.
Personally I like passing the channel name instead of a notify-slack flag which feels very generic. That being said, I did the changes but I can just revert them if you think there is too much stuff going on for now :)
metalwarrior665
left a comment
There was a problem hiding this comment.
Looks correct to me. We should figure out how to test this in the wild, probably manually adjust the beta version https://github.com/apify-store/testing-repo-for-github-actions and in the actions make sure we don't override the beta
|
@ruocco-l Here is how to test it after you merge.
If you have idea how to automate this whole thing, that would be golden :D (AI might know) |
Catches the merged copy up with the four commits that landed on github-actions-source master after the import (#57, #59, #60, #63), all of which built the claude-review action. Two new files, nothing else changed upstream. `review.yaml` fetches its instructions over HTTP rather than from a checkout, because a reusable workflow runs with the caller's repo checked out and never gets its own, so the URL had to follow the move to this repo. Its `prompt-ref` default moves from `master` to `v1`: consumers call the workflow at `@v1`, and defaulting the prompt to master would run released workflows against unreleased instructions, which is the skew the tag gate exists to prevent. Also drops `RUN_PLATFORM_TESTS` from pr-build-test. Master removed it in #122 in favour of gating on `TESTER_APIFY_TOKEN`, which that step already sets, so after merging master the variable was config nothing reads. Two notes on the checks: - .github/actionlint.yaml ignores two errors on review.yaml. actionlint bakes in a snapshot of popular actions' interfaces from when the pinned version shipped, and claude-code-action has grown since, so it flags `display_report` and the `conclusion` output as undefined. Both are declared in the action's action.yml at @v1 — verified before suppressing, and the patterns name those two symbols so unrelated bad inputs and outputs in that file still fail. - .github/review-prompt.md is prettier-ignored. Prettier collapses the nested bullet list under "do not visit, fetch, infer, or evaluate the following external links" into one run-on line, changing what the model is told. Keeping it byte-identical also makes re-syncing it a plain copy. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SkUZADZ6gzWW4GE6CFMreM
Closes #55
Now
report-testsandreleasecommands must include--notify-slackor it will not trigger the notify notification, but just show the failed errors in the terminal.