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

chore: rename to reviewbot #17

Merged
merged 1 commit into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cr-bot
reviewbot
.vscode
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand All @@ -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
Expand All @@ -43,4 +43,4 @@ RUN git config --global url."[email protected]:".insteadOf https://github.com/ \

EXPOSE 8888

ENTRYPOINT [ "/cr-bot" ]
ENTRYPOINT [ "/reviewbot" ]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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)
34 changes: 17 additions & 17 deletions deploy/cr-bot.yaml → deploy/reviewbot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -85,17 +85,17 @@ 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
port: 8888
protocol: TCP
targetPort: 8888
selector:
app: cr-bot
app: reviewbot
type: ClusterIP
---
apiVersion: networking.k8s.io/v1
Expand All @@ -104,17 +104,17 @@ 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
http:
paths:
- backend:
service:
name: cr-bot
name: reviewbot
port:
number: 8888
path: /
Expand All @@ -124,7 +124,7 @@ spec:
paths:
- backend:
service:
name: cr-bot
name: reviewbot
port:
number: 8888
path: /hook
Expand Down
2 changes: 1 addition & 1 deletion github.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/cr-bot
module github.com/reviewbot

go 1.21.4

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -69,7 +69,7 @@ Which seems insignificant, recommend to use ` + "`git rebase <upstream> <branch>

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

</details>
`
Expand Down
4 changes: 2 additions & 2 deletions internal/linters/go/staticcheck/staticcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/linters/go/staticcheck/staticcheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package staticcheck
import (
"testing"

"github.com/cr-bot/internal/linters"
"github.com/reviewbot/internal/linters"
)

func TestFormatStaticcheckLine(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions internal/linters/linters.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions kustomization.yml
Original file line number Diff line number Diff line change
@@ -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

6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ 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"
"github.com/sirupsen/logrus"
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 {
Expand Down
4 changes: 2 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down