Skip to content

feat: make slack notification explictly opt in - #60

Merged
ruocco-l merged 4 commits into
masterfrom
feat/make-slack-report-opt-in
Mar 20, 2026
Merged

feat: make slack notification explictly opt in#60
ruocco-l merged 4 commits into
masterfrom
feat/make-slack-report-opt-in

Conversation

@ruocco-l

Copy link
Copy Markdown
Contributor

Closes #55

Now report-tests and release commands must include --notify-slack or it will not trigger the notify notification, but just show the failed errors in the terminal.

@ruocco-l
ruocco-l requested a review from oklinov March 17, 2026 15:28
@ruocco-l ruocco-l self-assigned this Mar 17, 2026

@metalwarrior665 metalwarrior665 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, just small nits

Comment thread bin/main.ts Outdated
Comment on lines 147 to 159

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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,
      
      
        
                          });
      
      
        
                    };

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Comment thread bin/test-report.ts Outdated
console.error('SLACK:', slackMessage);
console.error('\tblocks:', blocks.join('\n\t\t'));

if (!notifySlack) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would move this above the channel selection as it is part of the slack logic

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hm, I wanted to leave this in because I liked the message, but I guess the diff will be enough to evaluate the results 👍

Comment thread bin/main.ts Outdated
(args) =>
args
.option('report-file', { type: 'string', demandOption: true })
.option('notify-slack', { type: 'boolean', default: false })

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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-slack

we'd have

apify-test-tools --report-slack-channel '#notif-google-maps' --release-slack-channel '#delivery-public-actor'
  • #delivery-public-actor could be a variable at the org level
  • #notif-google-maps we'd take it from the env: `"#notif-$(echo $GITHUB_REPOSITORY | cut -d '/' -f 2)"
    • use cat to remove the apify-store/ part

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)"

@metalwarrior665 metalwarrior665 Mar 19, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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 metalwarrior665 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

@metalwarrior665

Copy link
Copy Markdown
Member

@ruocco-l Here is how to test it after you merge.

  1. Since this starts with feat, it should make automatic beta npm release. see the current ones
  2. If it doesn't, let me know. You can release manually by going to Actions and selecting npm publish workflows on the left and fill master branch and beta target.
  3. Then make a PR to https://github.com/apify-store/github-actions-source/ since these things need to go hand in hand.
  4. Then you can test it manually with https://github.com/apify-store/testing-repo-for-github-actions. Change the source actions branch in workflows and change the apify-test-tools library to the new beta. I made it that the beta version is never overriden
  5. Check it correctly uses the Slack channels. The testing repo has legit slack channel too

If you have idea how to automate this whole thing, that would be golden :D (AI might know)

@ruocco-l
ruocco-l merged commit 32fda72 into master Mar 20, 2026
9 checks passed
metalwarrior665 added a commit that referenced this pull request Sep 10, 2026
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
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.

Make slack report opt-in

4 participants