Skip to content

Commit e9cee92

Browse files
authored
Merge pull request #1636 from Acepresso/regal-upgrade-EC-1617
Upgrade regal to v0.37.0 and fix resulting linting violations
2 parents f0dac4b + d096f58 commit e9cee92

File tree

16 files changed

+161
-120
lines changed

16 files changed

+161
-120
lines changed

.regal/config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,28 @@ rules:
7070
files:
7171
# Using fn(_) is a common pattern to mock functions in tests.
7272
- "*_test.rego"
73+
imports:
74+
# Since Regal does not scan any data file, we have to exclude
75+
# all references to data not in `lib`.
76+
unresolved-reference:
77+
level: error
78+
except-paths:
79+
- data.config
80+
- data.config.*
81+
- data.config.policy.*
82+
- data.rpm_repos.*
83+
- data.rule_data
84+
- data.rule_data.*
85+
- data.rule_data__configuration__
86+
- data.rule_data__configuration__.*
87+
- data.rule_data_custom
88+
- data.trusted_tasks
89+
- data.trusted_tasks.*
90+
- data.trusted_task_rules
91+
- data.trusted_task_rules.*
92+
# To fix this rule, in the policy/lib folder we need to remove the imports
93+
# from data.lib and use the fully qualified name when using function calls.
94+
# E.g.: from `lib.assert_equal` to `data.lib.assert_equal`
95+
# This rule is ignored until we decide if we want to fix it.
96+
pointless-import:
97+
level: ignore

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ lint: ## Runs Rego linter
213213
@go run github.com/google/addlicense -c '$(COPY)' -y '' -s -check $(LICENSE_IGNORE) . | sed 's/^/Missing license header in: /g'
214214
# piping to sed above looses the exit code, luckily addlicense is fast so we invoke it for the second time to exit 1 in case of issues
215215
@go run github.com/google/addlicense -c '$(COPY)' -y '' -s -check $(LICENSE_IGNORE) . >/dev/null 2>&1
216-
@go run github.com/styrainc/regal lint . $(if $(GITHUB_ACTIONS),--format=github)
216+
@go run github.com/open-policy-agent/regal lint . $(if $(GITHUB_ACTIONS),--format=github)
217217

218218
.PHONY: lint-fix
219219
lint-fix: ## Fix linting issues automagically

antora/docs/modules/ROOT/pages/packages/release_olm.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Every manifest in an OLM bundle must be of an allowed resource kind, as defined
5555
* Rule type: [rule-type-indicator failure]#FAILURE#
5656
* FAILURE message: `The %q manifest kind is not in the list of OLM allowed resource kinds.`
5757
* Code: `olm.allowed_resource_kinds`
58-
* https://github.com/conforma/policy/blob/{page-origin-refhash}/policy/release/olm/olm.rego#L361[Source, window="_blank"]
58+
* https://github.com/conforma/policy/blob/{page-origin-refhash}/policy/release/olm/olm.rego#L359[Source, window="_blank"]
5959

6060
[#olm__olm_bundle_multi_arch]
6161
=== link:#olm__olm_bundle_multi_arch[OLM bundle images are not multi-arch]

go.mod

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ go 1.25.3
55
require (
66
github.com/conforma/cli v0.8.92
77
github.com/google/addlicense v1.2.0
8-
github.com/open-policy-agent/conftest v0.63.0
9-
github.com/styrainc/regal v0.29.2
8+
github.com/open-policy-agent/conftest v0.66.0
9+
github.com/open-policy-agent/regal v0.37.0
1010
github.com/tektoncd/cli v0.42.0
1111
oras.land/oras v1.3.0
1212
)
@@ -77,9 +77,9 @@ require (
7777
github.com/alibabacloud-go/tea-xml v1.1.3 // indirect
7878
github.com/aliyun/credentials-go v1.3.9 // indirect
7979
github.com/anchore/go-struct-converter v0.0.0-20230627203149-c72ef8859ca9 // indirect
80-
github.com/anderseknert/roast v0.4.2 // indirect
8180
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
8281
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
82+
github.com/arl/statsviz v0.7.2 // indirect
8383
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
8484
github.com/avast/retry-go/v4 v4.6.1 // indirect
8585
github.com/aws/aws-sdk-go v1.55.7 // indirect
@@ -112,14 +112,16 @@ require (
112112
github.com/blendle/zapdriver v1.3.1 // indirect
113113
github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect
114114
github.com/bufbuild/protocompile v0.14.1 // indirect
115-
github.com/bytecodealliance/wasmtime-go/v3 v3.0.2 // indirect
115+
github.com/bytecodealliance/wasmtime-go/v39 v39.0.1 // indirect
116116
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
117117
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
118118
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
119119
github.com/cespare/xxhash/v2 v2.3.0 // indirect
120120
github.com/chainguard-dev/git-urls v1.0.2 // indirect
121121
github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589 // indirect
122122
github.com/clbanning/mxj/v2 v2.7.0 // indirect
123+
github.com/clipperhouse/stringish v0.1.1 // indirect
124+
github.com/clipperhouse/uax29/v2 v2.3.0 // indirect
123125
github.com/cloudflare/circl v1.6.1 // indirect
124126
github.com/cncf/xds/go v0.0.0-20251022180443-0feb69152e9f // indirect
125127
github.com/cockroachdb/apd/v3 v3.2.1 // indirect
@@ -134,13 +136,12 @@ require (
134136
github.com/containerd/stargz-snapshotter/estargz v0.17.0 // indirect
135137
github.com/containerd/typeurl/v2 v2.2.3 // indirect
136138
github.com/coreos/go-oidc/v3 v3.14.1 // indirect
137-
github.com/coreos/go-semver v0.3.1 // indirect
138139
github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467 // indirect
139-
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
140+
github.com/cyphar/filepath-securejoin v0.5.0 // indirect
140141
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
141142
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
142143
github.com/dgraph-io/badger/v4 v4.8.0 // indirect
143-
github.com/dgraph-io/ristretto/v2 v2.2.0 // indirect
144+
github.com/dgraph-io/ristretto/v2 v2.3.0 // indirect
144145
github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 // indirect
145146
github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7 // indirect
146147
github.com/dimchansky/utfbom v1.1.1 // indirect
@@ -176,7 +177,7 @@ require (
176177
github.com/go-errors/errors v1.5.1 // indirect
177178
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
178179
github.com/go-git/go-billy/v5 v5.6.2 // indirect
179-
github.com/go-git/go-git/v5 v5.13.2 // indirect
180+
github.com/go-git/go-git/v5 v5.16.3 // indirect
180181
github.com/go-ini/ini v1.67.0 // indirect
181182
github.com/go-jose/go-jose/v3 v3.0.4 // indirect
182183
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
@@ -206,7 +207,7 @@ require (
206207
github.com/google/btree v1.1.3 // indirect
207208
github.com/google/cel-go v0.26.0 // indirect
208209
github.com/google/certificate-transparency-go v1.3.2 // indirect
209-
github.com/google/flatbuffers v25.2.10+incompatible // indirect
210+
github.com/google/flatbuffers v25.9.23+incompatible // indirect
210211
github.com/google/gnostic-models v0.7.0 // indirect
211212
github.com/google/go-cmp v0.7.0 // indirect
212213
github.com/google/go-containerregistry v0.20.7 // indirect
@@ -216,7 +217,7 @@ require (
216217
github.com/google/go-github/v73 v73.0.0 // indirect
217218
github.com/google/go-jsonnet v0.21.0 // indirect
218219
github.com/google/go-querystring v1.1.0 // indirect
219-
github.com/google/pprof v0.0.0-20250820193118-f64d9cf942d6 // indirect
220+
github.com/google/pprof v0.0.0-20251007162407-5df77e3f7d1d // indirect
220221
github.com/google/s2a-go v0.1.9 // indirect
221222
github.com/google/safearchive v0.0.0-20241025131057-f7ce9d7b6f9c // indirect
222223
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
@@ -227,7 +228,7 @@ require (
227228
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
228229
github.com/grafeas/grafeas v0.2.3 // indirect
229230
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
230-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect
231+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect
231232
github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b // indirect
232233
github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.65 // indirect
233234
github.com/hashicorp/errwrap v1.1.0 // indirect
@@ -243,7 +244,7 @@ require (
243244
github.com/hashicorp/go-version v1.7.0 // indirect
244245
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
245246
github.com/hashicorp/hcl v1.0.1-vault-5 // indirect
246-
github.com/hashicorp/hcl/v2 v2.23.0 // indirect
247+
github.com/hashicorp/hcl/v2 v2.24.0 // indirect
247248
github.com/hashicorp/vault/api v1.16.0 // indirect
248249
github.com/huandu/go-clone v1.7.3 // indirect
249250
github.com/huandu/go-sqlbuilder v1.38.1 // indirect
@@ -270,8 +271,9 @@ require (
270271
github.com/jstemmer/go-junit-report v1.0.0 // indirect
271272
github.com/jstemmer/go-junit-report/v2 v2.1.0 // indirect
272273
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
273-
github.com/kevinburke/ssh_config v1.2.0 // indirect
274+
github.com/kevinburke/ssh_config v1.4.0 // indirect
274275
github.com/klauspost/compress v1.18.1 // indirect
276+
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
275277
github.com/konflux-ci/application-api v0.0.0-20240812090716-e7eb2ecfb409 // indirect
276278
github.com/ktr0731/go-ansisgr v0.1.0 // indirect
277279
github.com/ktr0731/go-fuzzyfinder v0.9.0 // indirect
@@ -287,12 +289,12 @@ require (
287289
github.com/letsencrypt/boulder v0.0.0-20240830194243-1fcf0ee08180 // indirect
288290
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
289291
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
290-
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
292+
github.com/lucasb-eyer/go-colorful v1.3.0 // indirect
291293
github.com/magiconair/properties v1.8.10 // indirect
292294
github.com/mailru/easyjson v0.9.0 // indirect
293295
github.com/mattn/go-colorable v0.1.14 // indirect
294296
github.com/mattn/go-isatty v0.0.20 // indirect
295-
github.com/mattn/go-runewidth v0.0.16 // indirect
297+
github.com/mattn/go-runewidth v0.0.19 // indirect
296298
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
297299
github.com/miekg/pkcs11 v1.1.1 // indirect
298300
github.com/mitchellh/copystructure v1.2.0 // indirect
@@ -315,8 +317,11 @@ require (
315317
github.com/nozzle/throttler v0.0.0-20180817012639-2ea982251481 // indirect
316318
github.com/nsf/termbox-go v1.1.1 // indirect
317319
github.com/oklog/ulid v1.3.1 // indirect
318-
github.com/olekukonko/tablewriter v0.0.5 // indirect
319-
github.com/open-policy-agent/opa v1.9.0 // indirect
320+
github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6 // indirect
321+
github.com/olekukonko/errors v1.1.0 // indirect
322+
github.com/olekukonko/ll v0.1.2 // indirect
323+
github.com/olekukonko/tablewriter v1.1.0 // indirect
324+
github.com/open-policy-agent/opa v1.12.1 // indirect
320325
github.com/opencontainers/go-digest v1.0.0 // indirect
321326
github.com/opencontainers/image-spec v1.1.1 // indirect
322327
github.com/opentracing/opentracing-go v1.2.0 // indirect
@@ -327,23 +332,23 @@ require (
327332
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
328333
github.com/peterh/liner v1.2.2 // indirect
329334
github.com/pierrec/lz4/v4 v4.1.22 // indirect
330-
github.com/pjbgf/sha1cd v0.3.2 // indirect
335+
github.com/pjbgf/sha1cd v0.5.0 // indirect
331336
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
332337
github.com/pkg/errors v0.9.1 // indirect
333338
github.com/pkg/profile v1.7.0 // indirect
334339
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
335340
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
336341
github.com/prometheus/client_golang v1.23.2 // indirect
337342
github.com/prometheus/client_model v0.6.2 // indirect
338-
github.com/prometheus/common v0.66.1 // indirect
339-
github.com/prometheus/procfs v0.17.0 // indirect
343+
github.com/prometheus/common v0.67.2 // indirect
344+
github.com/prometheus/procfs v0.19.2 // indirect
340345
github.com/prometheus/statsd_exporter v0.27.1 // indirect
341346
github.com/protocolbuffers/txtpbfmt v0.0.0-20251016062345-16587c79cd91 // indirect
342347
github.com/qri-io/jsonpointer v0.1.1 // indirect
343348
github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 // indirect
344349
github.com/rivo/uniseg v0.4.7 // indirect
345350
github.com/ryanuber/go-glob v1.0.0 // indirect
346-
github.com/sagikazarmark/locafero v0.11.0 // indirect
351+
github.com/sagikazarmark/locafero v0.12.0 // indirect
347352
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
348353
github.com/sassoftware/relic v7.2.1+incompatible // indirect
349354
github.com/secure-systems-lab/go-securesystemslib v0.9.1 // indirect
@@ -366,10 +371,9 @@ require (
366371
github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.9.5 // indirect
367372
github.com/sigstore/timestamp-authority v1.2.8 // indirect
368373
github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af // indirect
369-
github.com/skeema/knownhosts v1.3.0 // indirect
374+
github.com/skeema/knownhosts v1.3.2 // indirect
370375
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
371-
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
372-
github.com/sourcegraph/jsonrpc2 v0.2.0 // indirect
376+
github.com/sourcegraph/jsonrpc2 v0.2.1 // indirect
373377
github.com/spdx/tools-golang v0.5.5 // indirect
374378
github.com/spf13/afero v1.15.0 // indirect
375379
github.com/spf13/cast v1.10.0 // indirect
@@ -398,6 +402,7 @@ require (
398402
github.com/transparency-dev/formats v0.0.0-20250421220931-bb8ad4d07c26 // indirect
399403
github.com/transparency-dev/merkle v0.0.2 // indirect
400404
github.com/transparency-dev/tessera v0.2.1-0.20250610150926-8ee4e93b2823 // indirect
405+
github.com/tzrikka/xdg v1.3.2 // indirect
401406
github.com/ulikunitz/xz v0.5.15 // indirect
402407
github.com/valyala/fastjson v1.6.4 // indirect
403408
github.com/vbatts/tar-split v0.12.2 // indirect
@@ -412,7 +417,7 @@ require (
412417
github.com/xlab/treeprint v1.2.0 // indirect
413418
github.com/yashtewari/glob-intersection v0.2.0 // indirect
414419
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
415-
github.com/zclconf/go-cty v1.16.2 // indirect
420+
github.com/zclconf/go-cty v1.16.3 // indirect
416421
gitlab.com/gitlab-org/api/client-go v0.134.0 // indirect
417422
go.mongodb.org/mongo-driver v1.17.3 // indirect
418423
go.opencensus.io v0.24.0 // indirect
@@ -428,12 +433,12 @@ require (
428433
go.opentelemetry.io/otel/sdk v1.38.0 // indirect
429434
go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect
430435
go.opentelemetry.io/otel/trace v1.38.0 // indirect
431-
go.opentelemetry.io/proto/otlp v1.7.1 // indirect
436+
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
432437
go.starlark.net v0.0.0-20240123142251-f86470692795 // indirect
433438
go.uber.org/automaxprocs v1.6.0 // indirect
434439
go.uber.org/multierr v1.11.0 // indirect
435440
go.uber.org/zap v1.27.0 // indirect
436-
go.yaml.in/yaml/v2 v2.4.2 // indirect
441+
go.yaml.in/yaml/v2 v2.4.3 // indirect
437442
go.yaml.in/yaml/v3 v3.0.4 // indirect
438443
goa.design/goa/v3 v3.21.1 // indirect
439444
gocloud.dev v0.40.0 // indirect
@@ -454,8 +459,8 @@ require (
454459
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
455460
google.golang.org/api v0.241.0 // indirect
456461
google.golang.org/genproto v0.0.0-20250505200425-f936aa4a68b2 // indirect
457-
google.golang.org/genproto/googleapis/api v0.0.0-20251022142026-3a174f9686a8 // indirect
458-
google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8 // indirect
462+
google.golang.org/genproto/googleapis/api v0.0.0-20251103181224-f26f9409b101 // indirect
463+
google.golang.org/genproto/googleapis/rpc v0.0.0-20251103181224-f26f9409b101 // indirect
459464
google.golang.org/grpc v1.77.0 // indirect
460465
google.golang.org/protobuf v1.36.10 // indirect
461466
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect

0 commit comments

Comments
 (0)