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(collector): Add fmt job for collector CI #1833

Merged
merged 2 commits into from
Jan 5, 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
19 changes: 19 additions & 0 deletions .github/workflows/lint_and_test_collector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,32 @@ on:
paths:
- .github/workflows/lint_and_test_collector.yml
- collector/**
- go-client/**

# for manually triggering workflow
workflow_dispatch:

# workflow tasks
jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Format
working-directory: ./go-client
run: |
gofmt -d .
test -z "$(gofmt -d .)"

lint:
name: Lint
needs: format
runs-on: ubuntu-20.04
steps:
- name: Checkout
Expand All @@ -58,6 +76,7 @@ jobs:

build:
name: Build
needs: lint
runs-on: ubuntu-20.04
steps:
- name: Checkout
Expand Down
16 changes: 16 additions & 0 deletions collector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,19 @@ Collector is a part of the Pegasus ecosystem that serves as:
1. the service availability detector
2. the hotkey detector
3. the capacity units recorder

## Requirement

- Go1.18+

## Development

Build the collector:
```bash
make build
```

Format the code:
```bash
make fmt
```
2 changes: 1 addition & 1 deletion collector/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

module github.com/pegasus-kv/collector
module github.com/apache/incubator-pegasus/collector

go 1.18

Expand Down
6 changes: 3 additions & 3 deletions collector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
"strings"
"syscall"

"github.com/pegasus-kv/collector/avail"
"github.com/pegasus-kv/collector/metrics"
"github.com/pegasus-kv/collector/webui"
"github.com/apache/incubator-pegasus/collector/avail"
"github.com/apache/incubator-pegasus/collector/metrics"
"github.com/apache/incubator-pegasus/collector/webui"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
"gopkg.in/natefinch/lumberjack.v2"
Expand Down
2 changes: 1 addition & 1 deletion collector/sink/falcon_sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"net/http"
"time"

"github.com/pegasus-kv/collector/aggregate"
"github.com/apache/incubator-pegasus/collector/aggregate"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/sink/prometheus_sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package sink
import (
"sync"

"github.com/pegasus-kv/collector/aggregate"
"github.com/apache/incubator-pegasus/collector/aggregate"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
2 changes: 1 addition & 1 deletion collector/sink/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package sink

import (
"github.com/pegasus-kv/collector/aggregate"
"github.com/apache/incubator-pegasus/collector/aggregate"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/usage/usage_recorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"fmt"
"time"

"github.com/apache/incubator-pegasus/collector/aggregate"
"github.com/apache/incubator-pegasus/go-client/pegasus"
"github.com/pegasus-kv/collector/aggregate"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
"gopkg.in/tomb.v2"
Expand Down
2 changes: 1 addition & 1 deletion collector/webui/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
package webui

import (
"github.com/apache/incubator-pegasus/collector/aggregate"
"github.com/kataras/iris/v12"
"github.com/pegasus-kv/collector/aggregate"
)

var indexPageClusterStats = []string{
Expand Down
Loading