Skip to content

Commit 0488382

Browse files
authored
Merge branch 'v2' into feat/ui-rework
2 parents eb90ec0 + 773ed9b commit 0488382

File tree

98 files changed

+755
-8676
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+755
-8676
lines changed

.github/workflows/buf.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: buf.yaml
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
- v2
7+
paths:
8+
- 'buf.yaml'
9+
- 'buf.gen.yaml'
10+
- 'proto/**'
11+
push:
12+
branches:
13+
- main
14+
- v2
15+
paths:
16+
- 'buf.yaml'
17+
- 'buf.gen.yaml'
18+
- 'buf/**'
19+
- 'proto/**'
20+
21+
jobs:
22+
buf:
23+
name: Run buf
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
27+
pull-requests: write
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
32+
- uses: bufbuild/buf-action@v1
33+
with:
34+
github_token: ${{ github.token }}

.github/workflows/lint.yaml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- '.run/**'
1010
- 'docs/**'
1111
- 'deployments/**'
12+
- 'gen/**'
1213
- '*.md'
1314
- 'ui/**'
1415

@@ -21,6 +22,7 @@ on:
2122
- '.run/**'
2223
- 'docs/**'
2324
- 'deployments/**'
25+
- 'gen/**'
2426
- '*.md'
2527
- 'ui/**'
2628

@@ -42,17 +44,3 @@ jobs:
4244
with:
4345
version: v2.1
4446
args: --timeout=3m
45-
46-
buf:
47-
name: Run buf
48-
runs-on: ubuntu-latest
49-
permissions:
50-
contents: read
51-
pull-requests: write
52-
steps:
53-
- name: Checkout code
54-
uses: actions/checkout@v4
55-
56-
- uses: bufbuild/buf-action@v1
57-
with:
58-
github_token: ${{ github.token }}

cmd/root.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package cmd
33
import (
44
"github.com/ChargePi/ChargePi-go/internal/pkg/models/settings"
55
"github.com/ChargePi/ChargePi-go/pkg/observability/logging"
6-
log "github.com/sirupsen/logrus"
76
"github.com/spf13/cobra"
87
"github.com/spf13/viper"
8+
"go.uber.org/zap"
99
)
1010

1111
var rootCmd = &cobra.Command{
@@ -17,7 +17,8 @@ var rootCmd = &cobra.Command{
1717

1818
func init() {
1919
cobra.OnInitialize(func() {
20-
logging.Setup(log.StandardLogger(), settings.Logging{}, viper.GetBool(settings.Debug))
20+
logger := logging.SetupZap(settings.Logging{}, viper.GetBool(settings.Debug))
21+
zap.ReplaceGlobals(logger)
2122
})
2223

2324
rootCmd.AddCommand(runCommand())
@@ -32,6 +33,6 @@ func init() {
3233
func Execute() {
3334
err := rootCmd.Execute()
3435
if err != nil {
35-
log.WithError(err).Fatal("Unable to run")
36+
zap.L().Fatal("Unable to run", zap.Error(err))
3637
}
3738
}

cmd/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func runCommand() *cobra.Command {
2626
mainSettings := configuration.GetSettings()
2727

2828
// Run the charge point
29-
chargepoint.Run(debug, mainSettings)
29+
chargepoint.Run(cmd.Context(), debug, mainSettings)
3030
},
3131
}
3232

cmd/version.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package cmd
22

33
import (
44
chargePoint "github.com/ChargePi/ChargePi-go/internal/pkg/models/charge-point"
5-
log "github.com/sirupsen/logrus"
65
"github.com/spf13/cobra"
6+
"go.uber.org/zap"
77
)
88

99
// versionCmd represents the version command
@@ -13,7 +13,7 @@ func versionCommand() *cobra.Command {
1313
Short: "Version of ChargePi",
1414
Long: ``,
1515
Run: func(cmd *cobra.Command, args []string) {
16-
log.Infof("ChargePi version: %s", chargePoint.FirmwareVersion)
16+
zap.L().Info("ChargePi version", zap.String("version", chargePoint.FirmwareVersion))
1717
},
1818
}
1919
}

gen/mocks/internal/auth/cache/cache_mock.go

Lines changed: 0 additions & 218 deletions
This file was deleted.

0 commit comments

Comments
 (0)