From 20bc79eeb9a5f93468a081e630cacfb01fe8844c Mon Sep 17 00:00:00 2001 From: Patrick Maslana Date: Mon, 5 Aug 2024 12:56:31 -0700 Subject: [PATCH 1/3] Change message to include the website that provides more options for signing commits --- internal/github/checkUnsigned.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/github/checkUnsigned.go b/internal/github/checkUnsigned.go index 2901c12..ce49ba4 100644 --- a/internal/github/checkUnsigned.go +++ b/internal/github/checkUnsigned.go @@ -103,7 +103,7 @@ func hasUnsignedCommits(ctx context.Context, githubClient *github.Client, pr *gi // CheckAndComment checks for the specific comment from a specific account and posts a comment if it doesn't exist. func CheckAndComment(ctx context.Context, client *github.Client, owner, repo string, prNumber int) error { commentAuthor := "ChiaAutomation" - commentBody := "Your commits are not signed and our branch protection rules require signed commits. For more information on how to create signed commits, please visit this page: https://docs.chia.net/contribution/using-github/#setup-commit-signing. Please use the button towards the bottom of the page to close this pull request and open a new one with signed commits." + commentBody := "Your commits are not signed and our branch protection rules require signed commits. For more information on how to create signed commits, please visit this page: https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification. Please use the button towards the bottom of the page to close this pull request and open a new one with signed commits." comments, _, err := client.Issues.ListComments(ctx, owner, repo, prNumber, nil) if err != nil { return fmt.Errorf("error fetching comments: %v", err) @@ -121,7 +121,7 @@ func CheckAndComment(ctx context.Context, client *github.Client, owner, repo str comment := &github.IssueComment{ Body: github.String(commentBody), } - + // _, _, err = client.Issues.CreateComment(ctx, owner, repo, prNumber, comment) if err != nil { return fmt.Errorf("error creating comment: %v", err) From 76d2dced8ae127d2481c53506e4db1e605b45c62 Mon Sep 17 00:00:00 2001 From: Patrick Maslana Date: Mon, 5 Aug 2024 12:59:51 -0700 Subject: [PATCH 2/3] Moving the check for pending CI bot to send mesasages to devrel and allowing the unsigned commit bot to start creating comments on PRs. --- .github/workflows/build-deploy.yml | 1 + k8s/notify-pending-prs.yml.j2 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index fb9a10d..46494c9 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -31,6 +31,7 @@ jobs: - name: label-prs - name: notify-stale-prs - name: notify-pending-prs + - name: notify-unsigned steps: - uses: actions/checkout@v4 diff --git a/k8s/notify-pending-prs.yml.j2 b/k8s/notify-pending-prs.yml.j2 index 8f0f670..ff4bf33 100644 --- a/k8s/notify-pending-prs.yml.j2 +++ b/k8s/notify-pending-prs.yml.j2 @@ -31,7 +31,7 @@ secretEnvironment: GITHUB_BOT_DB_USER: "{{ DB_USER }}" GITHUB_BOT_DB_PASS: "{{ DB_PASS }}" GITHUB_BOT_DB_NAME: "github-bot" - KEYBASE_WEBHOOK_URL: "https://alert-receiver.chiaops.com/teambottesting" + KEYBASE_WEBHOOK_URL: "https://alert-receiver.chiaops.com/devrel" WEBHOOK_AUTH_SECRET_TOKEN: "{{ WEBHOOK_AUTH_SECRET_TOKEN }}" networkPolicy: From b90ca322bb91c64313c97472ce719c023f07b0a3 Mon Sep 17 00:00:00 2001 From: Patrick Maslana Date: Mon, 5 Aug 2024 13:10:39 -0700 Subject: [PATCH 3/3] Add additional logging --- internal/github/checkUnsigned.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/github/checkUnsigned.go b/internal/github/checkUnsigned.go index ce49ba4..07cd4c0 100644 --- a/internal/github/checkUnsigned.go +++ b/internal/github/checkUnsigned.go @@ -121,7 +121,7 @@ func CheckAndComment(ctx context.Context, client *github.Client, owner, repo str comment := &github.IssueComment{ Body: github.String(commentBody), } - // + slogs.Logr.Info("Creating comment for unsigned commits", "repo", repo, "PR", prNumber) _, _, err = client.Issues.CreateComment(ctx, owner, repo, prNumber, comment) if err != nil { return fmt.Errorf("error creating comment: %v", err)