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

[Triage bot] Do not report private things to Discord #4431

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Piinks
Copy link
Contributor

@Piinks Piinks commented Apr 2, 2025

This is not the code that is the deployed triage bot, @Hixie says it has diverged from the one he has running.
If we do end up deploying our own instance of this triage bot, which also posts to Discord, we don't want to fall into the same issue we had the other day.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@Piinks Piinks requested a review from Hixie April 2, 2025 19:42
@@ -815,7 +815,8 @@ class Engine {
}

Future<void> _updateDiscordFromWebhook(String event, dynamic payload) async {
if (GitHubSettings.knownBots.contains(payload.sender.login.toString())) {
if (GitHubSettings.knownBots.contains(payload.sender.login.toString())
Copy link
Contributor Author

@Piinks Piinks Apr 2, 2025

Choose a reason for hiding this comment

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

Is this around about the change you made in your copy @Hixie ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I ended up doing:

    if (!payload.repository.isNull && payload.repository.private.isBoolean && payload.repository.private.toBoolean()) {
      return;
    }

...with suitable changes to json.dart (adding isNull, isBoolean). The isBoolean is probably not necessary. The isNull is, because GitHub's API doesn't always send a repository key. HTH.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, thanks! 🙏 I will circle back on this next week after Cloud Next.

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.

2 participants