TJ-Bot icon indicating copy to clipboard operation
TJ-Bot copied to clipboard

PR notifications

Open SquidXTV opened this issue 1 year ago • 1 comments

About

closes #1142

Implements the functionality for PR notifications link-gh-project: links a channel to GitHub repositories to announce new pull request unlink-gh-project: unlinks a previous pull request notification configuration

The PullRequestNotificationRoutine handles pulling the new updates from repositories and sending a notification.

Database

This PR creates a new database table to store the notification configuration:

CREATE TABLE pr_notifications
(
    id INTEGER   NOT NULL PRIMARY KEY AUTOINCREMENT,
    channel_id BIGINT NOT NULL,
    repository_owner TEXT NOT NULL,
    repository_name TEXT NOT NULL
)

SquidXTV avatar Jul 31 '24 18:07 SquidXTV

Quality Gate Failed Quality Gate failed

Failed conditions
13.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

sonarqubecloud[bot] avatar Jul 31 '24 18:07 sonarqubecloud[bot]

Quality Gate Failed Quality Gate failed

Failed conditions
13.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

sonarqubecloud[bot] avatar Jul 01 '25 13:07 sonarqubecloud[bot]

Closing this PR. GitHub already supports native Discord webhook notifications through the GitHub repo settings, which makes this kinda redundant. The feature also isn't critical and likely wouldn't be used much in practice (probably).

The webhook alternative approach involves sharing the sensitive webhook link with a third party. My suggestion would be sharing them with very active #projects posts and trusted users if needed. If anything goes wrong, we can just disable the webhook.

Quick note: When sharing webhook links in forum-based threads, you need to append a thread_id query parameter to the webhook link: https://discord.com/developers/docs/resources/webhook#execute-webhook

SquidXTV avatar Jul 03 '25 08:07 SquidXTV