Skip to content

Commit 5d7fb26

Browse files
authored
Merge branch 'open-policy-agent:main' into main
2 parents c295eaa + c6dd317 commit 5d7fb26

File tree

264 files changed

+6618
-6502
lines changed

Some content is hidden

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

264 files changed

+6618
-6502
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ updates:
33
- package-ecosystem: gomod
44
directory: /
55
schedule:
6-
interval: daily
6+
interval: monthly
77
groups:
88
go.opentelemetry.io:
99
patterns:
1010
- "go.opentelemetry.io/*"
1111
- package-ecosystem: github-actions
1212
directory: /
1313
schedule:
14-
interval: daily
14+
interval: monthly

.github/workflows/nightly.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010
jobs:
1111
race-detector:
1212
name: Go Race Detector
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-24.04
1414
steps:
1515
- name: Check out code
1616
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -29,7 +29,7 @@ jobs:
2929

3030
native-fuzzer:
3131
name: Go Fuzzer (native)
32-
runs-on: ubuntu-22.04
32+
runs-on: ubuntu-24.04
3333
steps:
3434
- name: Check out code
3535
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -61,7 +61,7 @@ jobs:
6161

6262
go-perf:
6363
name: Go Perf
64-
runs-on: ubuntu-22.04
64+
runs-on: ubuntu-24.04
6565
steps:
6666
- name: Check out code
6767
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -83,7 +83,7 @@ jobs:
8383

8484
trivy-scan-image:
8585
name: Trivy security scan image
86-
runs-on: ubuntu-22.04
86+
runs-on: ubuntu-24.04
8787
steps:
8888
- name: Checkout code # needed for .trivyignore file
8989
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -115,7 +115,7 @@ jobs:
115115

116116
trivy-scan-repo:
117117
name: Trivy security scan repo
118-
runs-on: ubuntu-22.04
118+
runs-on: ubuntu-24.04
119119
steps:
120120
- name: Checkout code
121121
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -145,7 +145,7 @@ jobs:
145145

146146
govulncheck:
147147
name: Go vulnerability check
148-
runs-on: ubuntu-22.04
148+
runs-on: ubuntu-24.04
149149
steps:
150150
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
151151
- id: go_version

.github/workflows/post-merge.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
permissions:
1414
contents: write # for Git to git push
1515
name: Sync Generated Code and Docs
16-
runs-on: ubuntu-22.04
16+
runs-on: ubuntu-24.04
1717
steps:
1818
- name: Check out code
1919
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -73,7 +73,7 @@ jobs:
7373
7474
code-coverage:
7575
name: Update Go Test Coverage
76-
runs-on: ubuntu-22.04
76+
runs-on: ubuntu-24.04
7777
needs: generate
7878
steps:
7979
- name: Check out code
@@ -85,7 +85,7 @@ jobs:
8585

8686
release-build:
8787
name: Release Build (linux, windows)
88-
runs-on: ubuntu-22.04
88+
runs-on: ubuntu-24.04
8989
needs: generate
9090
steps:
9191
- name: Check out code
@@ -157,7 +157,7 @@ jobs:
157157

158158
deploy-edge:
159159
name: Push Edge Release
160-
runs-on: ubuntu-22.04
160+
runs-on: ubuntu-24.04
161161
needs: [release-build, release-build-darwin]
162162
steps:
163163
- name: Check out code
@@ -175,7 +175,7 @@ jobs:
175175
path: _release
176176

177177
- name: Set up Docker Buildx
178-
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3.9.0
178+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
179179

180180
- name: Deploy OPA Edge
181181
env:
@@ -191,7 +191,7 @@ jobs:
191191

192192
deploy-wasm-builder:
193193
name: Deploy WASM Builder
194-
runs-on: ubuntu-22.04
194+
runs-on: ubuntu-24.04
195195
needs: generate
196196
steps:
197197
- name: Check out code

.github/workflows/post-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010
jobs:
1111
kick-netlify:
1212
name: Kick Netlify
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-24.04
1414
steps:
1515
- name: Trigger Netlify Deploy
1616
env:

.github/workflows/post-tag.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
generate:
1010
name: Generate Code
11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-24.04
1212
steps:
1313
- name: Check out code
1414
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -20,7 +20,7 @@ jobs:
2020

2121
release-build:
2222
name: Release Build (linux, windows)
23-
runs-on: ubuntu-22.04
23+
runs-on: ubuntu-24.04
2424
needs: generate
2525
steps:
2626
- name: Check out code
@@ -93,7 +93,7 @@ jobs:
9393
build:
9494
name: Push Latest Release
9595
needs: [release-build, release-build-darwin]
96-
runs-on: ubuntu-22.04
96+
runs-on: ubuntu-24.04
9797
steps:
9898
- name: Check out code
9999
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -110,7 +110,7 @@ jobs:
110110
path: _release
111111

112112
- name: Set up Docker Buildx
113-
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3.9.0
113+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
114114

115115
- name: Build and Deploy OPA Docker Images
116116
id: build-and-deploy

.github/workflows/pull-request.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
# up for parallel runners for faster PR feedback and a nicer UX.
1414
generate:
1515
name: Generate Code
16-
runs-on: ubuntu-22.04
16+
runs-on: ubuntu-24.04
1717
steps:
1818
- name: Check out code
1919
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -38,21 +38,21 @@ jobs:
3838
matrix:
3939
include:
4040
- os: linux
41-
run: ubuntu-22.04
41+
run: ubuntu-24.04
4242
targets: ci-go-ci-build-linux ci-go-ci-build-linux-static
4343
arch: amd64
4444
- os: linux
45-
run: ubuntu-22.04
45+
run: ubuntu-24.04
4646
targets: ci-go-ci-build-linux-static
4747
arch: arm64
4848
- os: linux
49-
run: ubuntu-22.04
49+
run: ubuntu-24.04
5050
targets: ci-go-ci-build-linux-static
5151
go_tags: GO_TAGS="-tags=opa_no_oci"
5252
variant_name: opa_no_ci
5353
arch: arm64
5454
- os: windows
55-
run: ubuntu-22.04
55+
run: ubuntu-24.04
5656
targets: ci-go-ci-build-windows
5757
arch: amd64
5858
- os: darwin
@@ -111,7 +111,7 @@ jobs:
111111
matrix:
112112
include:
113113
- os: linux
114-
run: ubuntu-22.04
114+
run: ubuntu-24.04
115115
- os: darwin
116116
run: macos-14
117117
steps:
@@ -138,7 +138,7 @@ jobs:
138138

139139
go-lint:
140140
name: Go Lint
141-
runs-on: ubuntu-22.04
141+
runs-on: ubuntu-24.04
142142
steps:
143143
- name: Check out code
144144
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -149,7 +149,7 @@ jobs:
149149

150150
yaml-lint:
151151
name: YAML Lint
152-
runs-on: ubuntu-22.04
152+
runs-on: ubuntu-24.04
153153
steps:
154154
- name: Check out code
155155
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -162,7 +162,7 @@ jobs:
162162

163163
wasm:
164164
name: WASM
165-
runs-on: ubuntu-22.04
165+
runs-on: ubuntu-24.04
166166
needs: generate
167167
steps:
168168
- name: Check out code
@@ -203,7 +203,7 @@ jobs:
203203

204204
check-generated:
205205
name: Check Generated
206-
runs-on: ubuntu-22.04
206+
runs-on: ubuntu-24.04
207207
needs: generate
208208
steps:
209209
- name: Check out code
@@ -222,7 +222,7 @@ jobs:
222222

223223
race-detector:
224224
name: Go Race Detector
225-
runs-on: ubuntu-22.04
225+
runs-on: ubuntu-24.04
226226
needs: generate
227227
steps:
228228
- name: Check out code
@@ -240,14 +240,14 @@ jobs:
240240

241241
smoke-test-docker-images:
242242
name: docker image smoke test
243-
runs-on: ubuntu-22.04
243+
runs-on: ubuntu-24.04
244244
needs: go-build
245245
steps:
246246
- name: Check out code
247247
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
248248

249249
- name: Set up QEMU
250-
uses: docker/setup-qemu-action@4574d27a4764455b42196d70a065bc6853246a25 # v3.4.0
250+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
251251
with:
252252
platforms: arm64
253253

@@ -274,11 +274,11 @@ jobs:
274274
matrix:
275275
include:
276276
- os: linux
277-
run: ubuntu-22.04
277+
run: ubuntu-24.04
278278
exec: opa_linux_amd64
279279
arch: amd64
280280
- os: linux
281-
run: ubuntu-22.04
281+
run: ubuntu-24.04
282282
exec: opa_linux_amd64_static
283283
arch: amd64
284284
wasm: disabled
@@ -320,7 +320,7 @@ jobs:
320320
strategy:
321321
fail-fast: false
322322
matrix:
323-
os: [ubuntu-22.04, macos-14]
323+
os: [ubuntu-24.04, macos-14]
324324
version: ["1.21"]
325325
steps:
326326
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -341,7 +341,7 @@ jobs:
341341
# Run PR metadata against Rego policies
342342
rego-check-pr:
343343
name: Rego PR checks
344-
runs-on: ubuntu-22.04
344+
runs-on: ubuntu-24.04
345345
steps:
346346
- name: Checkout code
347347
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
All notable changes to this project will be documented in this file. This
44
project adheres to [Semantic Versioning](http://semver.org/).
55

6+
## Unreleased
7+
68
## 1.2.0
79

810
This release contains a mix of features, performance improvements, and bugfixes.

cmd/fmt.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,13 @@ func formatStdin(params *fmtCommandParams, r io.Reader, w io.Writer) error {
242242
opts.ParserOptions = &ast.ParserOptions{RegoVersion: ast.RegoV0}
243243
}
244244

245+
if params.v0Compatible {
246+
// v0 takes precedence over v1
247+
opts.ParserOptions = &ast.ParserOptions{RegoVersion: ast.RegoV0}
248+
} else if params.v1Compatible {
249+
opts.ParserOptions = &ast.ParserOptions{RegoVersion: ast.RegoV1}
250+
}
251+
245252
formatted, err := format.SourceWithOpts("stdin", contents, opts)
246253
if err != nil {
247254
return err

0 commit comments

Comments
 (0)