Skip to content

Commit 87e2e1d

Browse files
committed
rm wire dependency
1 parent 04056ca commit 87e2e1d

File tree

16 files changed

+138
-339
lines changed

16 files changed

+138
-339
lines changed

.github/workflows/ci.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ on:
1919
env:
2020
PRE_RELEASE: ${{ github.ref == 'refs/heads/main' && 'development' || '' }}
2121
GO_VERSION: "1.25"
22-
GO_RELEASER_VERSION: "v2.8.2"
23-
GO_LANGCI_LINT_VERSION: "v2.6.0"
22+
GO_RELEASER_VERSION: "v2.9.0"
23+
GO_LANGCI_LINT_VERSION: "v2.6.2"
2424
GO_TESTSUM_VERSION: "1.13.0"
2525

2626
jobs:
2727
test:
2828
runs-on: ubuntu-latest
2929
steps:
3030
-
31-
uses: actions/checkout@v5
31+
uses: actions/checkout@v6
3232
-
3333
name: Setup Go
3434
uses: actions/setup-go@v6
@@ -45,7 +45,7 @@ jobs:
4545
args: build --clean --snapshot --single-target
4646
-
4747
name: Lint
48-
uses: golangci/golangci-lint-action@v8
48+
uses: golangci/golangci-lint-action@v9
4949
with:
5050
version: ${{ env.GO_LANGCI_LINT_VERSION }}
5151
args: --timeout=30m
@@ -75,7 +75,7 @@ jobs:
7575
if: github.event_name == 'push' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') )
7676
steps:
7777
-
78-
uses: actions/checkout@v5
78+
uses: actions/checkout@v6
7979
with:
8080
fetch-depth: 0
8181
-
@@ -117,7 +117,7 @@ jobs:
117117
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
118118
steps:
119119
-
120-
uses: actions/checkout@v5
120+
uses: actions/checkout@v6
121121
with:
122122
fetch-depth: 0
123123
-
@@ -171,7 +171,7 @@ jobs:
171171
steps:
172172
-
173173
name: Checkout
174-
uses: actions/checkout@v5
174+
uses: actions/checkout@v6
175175
with:
176176
fetch-depth: 0
177177
-

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
steps:
3030
- name: Checkout repository
31-
uses: actions/checkout@v5
31+
uses: actions/checkout@v6
3232

3333
# Initializes the CodeQL tools for scanning.
3434
- name: Initialize CodeQL

.github/workflows/gitleaks-check.yml

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

.github/workflows/gitleaks.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: gitleaks
2+
on:
3+
pull_request:
4+
push:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: "0 4 * * *" # run once a day at 4 AM
8+
jobs:
9+
scan:
10+
name: gitleaks
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v6
14+
with:
15+
fetch-depth: 0
16+
- uses: gitleaks/gitleaks-action@v2
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
2+
"go.useLanguageServer": true,
3+
"gopls": {
4+
"formatting.gofumpt": true
5+
},
26
"cSpell.words": [
37
"accnt",
48
"alecthomas",

go.mod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/opcr-io/policy
22

3-
go 1.24.9
3+
go 1.24.11
44

5-
toolchain go1.25.3
5+
toolchain go1.25.5
66

77
require (
88
github.com/Masterminds/sprig v2.22.0+incompatible
@@ -17,7 +17,6 @@ require (
1717
github.com/docker/cli v28.5.1+incompatible
1818
github.com/dustin/go-humanize v1.0.1
1919
github.com/go-viper/mapstructure/v2 v2.4.0
20-
github.com/google/wire v0.7.0
2120
github.com/magefile/mage v1.15.0
2221
github.com/opcr-io/oras-go/v2 v2.0.0-20231122155130-eb4260d8a0ae
2322
github.com/open-policy-agent/opa v1.9.0

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J
103103
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
104104
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
105105
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
106-
github.com/google/wire v0.7.0 h1:JxUKI6+CVBgCO2WToKy/nQk0sS+amI9z9EjVmdaocj4=
107-
github.com/google/wire v0.7.0/go.mod h1:n6YbUQD9cPKTnHXEBN2DXlOp/mVADhVErcMFb0v3J18=
108106
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 h1:8Tjv8EJ+pM1xP8mK6egEbD1OgnVTyacbefKhmbLhIhU=
109107
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2/go.mod h1:pkJQ2tZHJ0aFOVEEot6oZmaVEZcRme73eIFmhiVuRWs=
110108
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=

go.work

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
go 1.24.9
1+
go 1.24.11
22

3-
toolchain go1.25.3
3+
toolchain go1.25.5
44

55
use .

makefile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,17 @@ EXT_BIN_DIR := ${EXT_DIR}/bin
1616
EXT_TMP_DIR := ${EXT_DIR}/tmp
1717

1818
GO_VER := 1.25
19-
SVU_VER := 3.2.4
19+
SVU_VER := 3.3.0
2020
GOTESTSUM_VER := 1.13.0
21-
GOLANGCI-LINT_VER := 2.6.0
22-
GORELEASER_VER := 2.8.2
23-
WIRE_VER := 0.7.0
21+
GOLANGCI-LINT_VER := 2.6.2
22+
GORELEASER_VER := 2.9.0
2423

2524
RELEASE_TAG := $$(${EXT_BIN_DIR}/svu current)
2625

2726
.DEFAULT_GOAL := build
2827

2928
.PHONY: deps
30-
deps: info install-svu install-goreleaser install-golangci-lint install-gotestsum install-wire
29+
deps: info install-svu install-goreleaser install-golangci-lint install-gotestsum
3130
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"
3231

3332
.PHONY: build
@@ -116,11 +115,6 @@ install-goreleaser: ${EXT_TMP_DIR} ${EXT_BIN_DIR}
116115
@chmod +x ${EXT_BIN_DIR}/goreleaser
117116
@${EXT_BIN_DIR}/goreleaser --version
118117

119-
.PHONY: install-wire
120-
install-wire: ${EXT_TMP_DIR} ${EXT_BIN_DIR}
121-
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"
122-
@GOBIN=${EXT_BIN_DIR} go install github.com/google/wire/cmd/wire@v${WIRE_VER}
123-
124118
.PHONY: clean
125119
clean:
126120
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"

pkg/app/app.go

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package app
2+
3+
import (
4+
"github.com/aserto-dev/clui"
5+
"github.com/aserto-dev/logger"
6+
"github.com/opcr-io/policy/pkg/cc"
7+
"github.com/opcr-io/policy/pkg/cc/config"
8+
)
9+
10+
func BuildPolicyApp(
11+
logOutput logger.Writer,
12+
errOutput logger.ErrWriter,
13+
configPath config.Path,
14+
overrides config.Overrider,
15+
) (
16+
*PolicyApp, func(), error,
17+
) {
18+
ccCC, cleanup, err := cc.NewCC(logOutput, errOutput, configPath, overrides)
19+
if err != nil {
20+
return nil, nil, err
21+
}
22+
23+
context := ccCC.Context
24+
cancelFunc := ccCC.CancelFunc
25+
zerologLogger := ccCC.Log
26+
configConfig := ccCC.Config
27+
28+
ui := clui.NewUI()
29+
policyApp := &PolicyApp{
30+
Context: context,
31+
Cancel: cancelFunc,
32+
Logger: zerologLogger,
33+
Configuration: configConfig,
34+
UI: ui,
35+
}
36+
37+
return policyApp, func() {
38+
cleanup()
39+
}, nil
40+
}

0 commit comments

Comments
 (0)