From c1573821fba458526d859de68fb7c02aa3856134 Mon Sep 17 00:00:00 2001 From: jichangjun Date: Sat, 20 Jan 2024 17:03:21 +0800 Subject: [PATCH] rename to reviewbot --- .gitignore | 2 +- Dockerfile | 6 ++-- Makefile | 2 +- README.md | 14 ++++---- deploy/{cr-bot.yaml => reviewbot.yaml} | 34 +++++++++---------- github.go | 2 +- go.mod | 2 +- .../rebase-suggestion/rebase_suggestion.go | 6 ++-- .../linters/go/staticcheck/staticcheck.go | 4 +-- .../go/staticcheck/staticcheck_test.go | 2 +- internal/linters/linters.go | 4 +-- kustomization.yml | 6 ++-- main.go | 6 ++-- server.go | 4 +-- 14 files changed, 47 insertions(+), 47 deletions(-) rename deploy/{cr-bot.yaml => reviewbot.yaml} (85%) diff --git a/.gitignore b/.gitignore index 95c3b1ac..520152c6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -cr-bot +reviewbot .vscode diff --git a/Dockerfile b/Dockerfile index 4a37ce30..f332bf18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ COPY go.mod go.sum ./ RUN go mod download COPY . ./ -RUN CGO_ENABLED=0 GOOS=linux go build -o /cr-bot . +RUN CGO_ENABLED=0 GOOS=linux go build -o /reviewbot . # install lint tools RUN GOPATH=/go go install honnef.co/go/tools/cmd/staticcheck@2023.1.6 @@ -31,7 +31,7 @@ ENV PATH /usr/local/go/bin:$PATH WORKDIR / -COPY --from=builder /cr-bot /cr-bot +COPY --from=builder /reviewbot /reviewbot COPY --from=builder /go/bin/staticcheck /usr/local/bin/staticcheck # SSH config @@ -43,4 +43,4 @@ RUN git config --global url."git@github.com:".insteadOf https://github.com/ \ EXPOSE 8888 -ENTRYPOINT [ "/cr-bot" ] \ No newline at end of file +ENTRYPOINT [ "/reviewbot" ] \ No newline at end of file diff --git a/Makefile b/Makefile index 3157207c..c48bc473 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ ifeq (, $(shell which kubectl)) $(error "No kubectl in $(PATH)) endif -DOCKER_IMAGE ?= aslan-spock-register.qiniu.io/qa/cr-bot +DOCKER_IMAGE ?= aslan-spock-register.qiniu.io/qa/reviewbot VERSION ?= v0.1.1 default: all diff --git a/README.md b/README.md index 016ef48a..003dead7 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# cr-bot +# reviewbot -[![Build Status](https://github.com/qiniu/cr-bot/actions/workflows/go.yml/badge.svg)](https://github.com/qiniu/cr-bot/actions/workflows/go.yml) -[![Go Report Card](https://goreportcard.com/badge/github.com/qiniu/cr-bot)](https://goreportcard.com/report/github.com/qiniu/cr-bot) -[![GitHub release](https://img.shields.io/github/v/tag/qiniu/cr-bot.svg?label=release)](https://github.com/qiniu/cr-bot/releases) +[![Build Status](https://github.com/qiniu/reviewbot/actions/workflows/go.yml/badge.svg)](https://github.com/qiniu/reviewbot/actions/workflows/go.yml) +[![Go Report Card](https://goreportcard.com/badge/github.com/qiniu/reviewbot)](https://goreportcard.com/report/github.com/qiniu/reviewbot) +[![GitHub release](https://img.shields.io/github/v/tag/qiniu/reviewbot.svg?label=release)](https://github.com/qiniu/reviewbot/releases) Thank for the community, there is a wide range of lint tools available for almost every programming language. However, many of these tools rely on a command-line interface (CLI) and require configuring jobs in CI systems like Github Action, Travis, and others. While this is typically manageable, it can become tedious when dealing with a large number of repositories that need to be configured. @@ -11,10 +11,10 @@ Additionally, when working with repositories that already have numerous existing Furthermore, traditional CI errors are often only displayed in the console, necessitating manual identification. However, automating the process by providing specific line-level comments for detected issues offers a more elegant and user-friendly approach for developers. -In such scenarios, cr-bot is an ideal service to consider. It allows you to set up your own service that can receive events from GitHub and automatically perform various linting checks, providing precise feedback on specific lines of code that require attention. Enjoy the benefits of safety, customization, and powerful linting capabilities. +In such scenarios, reviewbot is an ideal service to consider. It allows you to set up your own service that can receive events from GitHub and automatically perform various linting checks, providing precise feedback on specific lines of code that require attention. Enjoy the benefits of safety, customization, and powerful linting capabilities. -Please note that cr-bot is still in its early stages, and we have plans to integrate more lint tools and support additional code hosting platforms such as GitLab. We are also exploring the possibility of incorporating AI for code review purposes. +Please note that reviewbot is still in its early stages, and we have plans to integrate more lint tools and support additional code hosting platforms such as GitLab. We are also exploring the possibility of incorporating AI for code review purposes. -Lastly, we welcome any contributions to the project! Your bug reports, feature suggestions, and active participation in the development process are greatly appreciated. Together, we can make cr-bot even better. +Lastly, we welcome any contributions to the project! Your bug reports, feature suggestions, and active participation in the development process are greatly appreciated. Together, we can make reviewbot even better. ![Alt text](docs/static/image.png) diff --git a/deploy/cr-bot.yaml b/deploy/reviewbot.yaml similarity index 85% rename from deploy/cr-bot.yaml rename to deploy/reviewbot.yaml index 5cfa5a6a..a31b7c93 100644 --- a/deploy/cr-bot.yaml +++ b/deploy/reviewbot.yaml @@ -3,22 +3,22 @@ apiVersion: apps/v1 kind: Deployment metadata: labels: - app: cr-bot - name: cr-bot - namespace: cr-bot + app: reviewbot + name: reviewbot + namespace: reviewbot spec: replicas: 2 selector: matchLabels: - app: cr-bot + app: reviewbot template: metadata: labels: - app: cr-bot + app: reviewbot spec: containers: - command: - - /cr-bot + - /reviewbot args: - -log-level=1 - -webhook-secret=$(GITHUB_WEBHOOK_SECRET) @@ -42,9 +42,9 @@ spec: secretKeyRef: key: app-installation-id name: github-app - image: aslan-spock-register.qiniu.io/qa/cr-bot:latest # use your own built image instead + image: aslan-spock-register.qiniu.io/qa/reviewbot:latest # use your own built image instead imagePullPolicy: Always - name: cr-bot + name: reviewbot ports: - containerPort: 8888 name: http @@ -85,9 +85,9 @@ apiVersion: v1 kind: Service metadata: labels: - app: cr-bot - name: cr-bot - namespace: cr-bot + app: reviewbot + name: reviewbot + namespace: reviewbot spec: ports: - name: http @@ -95,7 +95,7 @@ spec: protocol: TCP targetPort: 8888 selector: - app: cr-bot + app: reviewbot type: ClusterIP --- apiVersion: networking.k8s.io/v1 @@ -104,9 +104,9 @@ metadata: annotations: kubernetes.io/ingress.class: nginx labels: - app: cr-bot - name: cr-bot - namespace: cr-bot + app: reviewbot + name: reviewbot + namespace: reviewbot spec: rules: - host: cr-bot.qiniu.io @@ -114,7 +114,7 @@ spec: paths: - backend: service: - name: cr-bot + name: reviewbot port: number: 8888 path: / @@ -124,7 +124,7 @@ spec: paths: - backend: service: - name: cr-bot + name: reviewbot port: number: 8888 path: /hook diff --git a/github.go b/github.go index 827ba869..a3dd9a91 100644 --- a/github.go +++ b/github.go @@ -23,7 +23,7 @@ import ( "strings" "time" - "github.com/cr-bot/internal/linters" + "github.com/reviewbot/internal/linters" "github.com/google/go-github/v57/github" "github.com/qiniu/x/log" ) diff --git a/go.mod b/go.mod index c80e3723..2be9ff79 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/cr-bot +module github.com/reviewbot go 1.21.4 diff --git a/internal/linters/git-flow/rebase-suggestion/rebase_suggestion.go b/internal/linters/git-flow/rebase-suggestion/rebase_suggestion.go index cc8b92f0..9a961f40 100644 --- a/internal/linters/git-flow/rebase-suggestion/rebase_suggestion.go +++ b/internal/linters/git-flow/rebase-suggestion/rebase_suggestion.go @@ -24,8 +24,8 @@ import ( "strings" "text/template" - "github.com/cr-bot/config" - "github.com/cr-bot/internal/linters" + "github.com/reviewbot/config" + "github.com/reviewbot/internal/linters" "github.com/google/go-github/v57/github" "github.com/qiniu/x/log" ) @@ -69,7 +69,7 @@ Which seems insignificant, recommend to use ` + "`git rebase If you have any questions about this comment, feel free to raise an issue here: -- **https://github.com/qiniu/cr-bot/issues** +- **https://github.com/qiniu/reviewbot/issues** ` diff --git a/internal/linters/go/staticcheck/staticcheck.go b/internal/linters/go/staticcheck/staticcheck.go index 312396f6..aa3665ed 100644 --- a/internal/linters/go/staticcheck/staticcheck.go +++ b/internal/linters/go/staticcheck/staticcheck.go @@ -23,8 +23,8 @@ import ( "strconv" "strings" - "github.com/cr-bot/config" - "github.com/cr-bot/internal/linters" + "github.com/reviewbot/config" + "github.com/reviewbot/internal/linters" "github.com/google/go-github/v57/github" "github.com/qiniu/x/log" ) diff --git a/internal/linters/go/staticcheck/staticcheck_test.go b/internal/linters/go/staticcheck/staticcheck_test.go index 8e220069..005fde7f 100644 --- a/internal/linters/go/staticcheck/staticcheck_test.go +++ b/internal/linters/go/staticcheck/staticcheck_test.go @@ -19,7 +19,7 @@ package staticcheck import ( "testing" - "github.com/cr-bot/internal/linters" + "github.com/reviewbot/internal/linters" ) func TestFormatStaticcheckLine(t *testing.T) { diff --git a/internal/linters/linters.go b/internal/linters/linters.go index 75f5d6b2..421267e5 100644 --- a/internal/linters/linters.go +++ b/internal/linters/linters.go @@ -17,7 +17,7 @@ package linters import ( - "github.com/cr-bot/config" + "github.com/reviewbot/config" "github.com/google/go-github/v57/github" gitv2 "k8s.io/test-infra/prow/git/v2" ) @@ -90,7 +90,7 @@ type LinterOutput struct { Message string } -// Agent knows necessary information from cr-bot. +// Agent knows necessary information from reviewbot. type Agent struct { gc *github.Client gitClientFactory gitv2.ClientFactory diff --git a/kustomization.yml b/kustomization.yml index f5a1c6c9..47178814 100644 --- a/kustomization.yml +++ b/kustomization.yml @@ -1,7 +1,7 @@ resources: -- deploy/cr-bot.yaml +- deploy/reviewbot.yaml images: -- name: aslan-spock-register.qiniu.io/qa/cr-bot:latest - newName: aslan-spock-register.qiniu.io/qa/cr-bot +- name: aslan-spock-register.qiniu.io/qa/reviewbot:latest + newName: aslan-spock-register.qiniu.io/qa/reviewbot newTag: v0.3.0 diff --git a/main.go b/main.go index e8aa3ce5..d6967045 100644 --- a/main.go +++ b/main.go @@ -24,7 +24,7 @@ import ( "os" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/cr-bot/config" + "github.com/reviewbot/config" "github.com/google/go-github/v57/github" "github.com/gregjones/httpcache" "github.com/qiniu/x/log" @@ -32,8 +32,8 @@ import ( gitv2 "k8s.io/test-infra/prow/git/v2" // linters import - _ "github.com/cr-bot/internal/linters/git-flow/rebase-suggestion" - _ "github.com/cr-bot/internal/linters/go/staticcheck" + _ "github.com/reviewbot/internal/linters/git-flow/rebase-suggestion" + _ "github.com/reviewbot/internal/linters/go/staticcheck" ) type options struct { diff --git a/server.go b/server.go index de2f86ef..c7e8932a 100644 --- a/server.go +++ b/server.go @@ -21,8 +21,8 @@ import ( "fmt" "net/http" - "github.com/cr-bot/config" - "github.com/cr-bot/internal/linters" + "github.com/reviewbot/config" + "github.com/reviewbot/internal/linters" "github.com/google/go-github/v57/github" "github.com/qiniu/x/xlog" gitv2 "k8s.io/test-infra/prow/git/v2"