54 Commits

Author SHA1 Message Date
Charlie Egan b29b1dad76 docs/website: Markdown linting and spell checking for documentation (#8292)
* Add markdownlint tooling to docs

Install markdownlint-cli2 with configuration file and make targets for
auto fix etc too.

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Autofixable markdown issues

mainly, replace tabs with spaces for consistent 2-space indentation

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* MD059

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Fix a number of <link> issues

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* MD041

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* MD041

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* MD046

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* MD025

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* MD052

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* MD028

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* MD001

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Add GH action check in PRs

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Use 4 spaces for tabs

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Use 4 spaces for tabs

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* docs: Add spell checking using Vale

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Correct comment for space indentation rule

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

---------

Signed-off-by: Charlie Egan <charlie_egan@apple.com>
2026-02-05 10:20:13 +00:00
Charlie Egan b1eb646ddc docs/website: Add formatting and linting checks (#8288)
* Update baseline-browser-mapping to version 2.9.19

Addresses issue in build

[baseline-browser-mapping] The data in this module is over two
months old.  To ensure accurate Baseline data, please update: `npm i
baseline-browser-mapping@latest -D`

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Add fmt and lint config for docs

This is based on dprint and eslint. Some vendored paths are ignored.

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Format and lint docs project

Markdown linting will be added in another PR.

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

---------

Signed-off-by: Charlie Egan <charlie_egan@apple.com>
2026-02-03 17:01:54 +00:00
Johan Fylling 86b506b4c4 Adding note to rebase and not squash when merging patch release PR
to preserve cherry-picked commits.

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2026-01-15 14:54:44 +01:00
Charlie Egan efae5d1b58 Update a number of links to their new location (#8100)
* Update a number of links to their new location

https://github.com/open-policy-agent/opa/issues/8091 highlighted a
number of 'broken' links that are just redirects. I have updated many of
these in this PR.

Hopefully next time, the broken link report will be easier to parse.

Signed-off-by: Charlie Egan <charlie_egan@apple.com>

* Update docs/docs/policy-performance.md

Co-authored-by: Stephan Renatus <s_renatus@apple.com>
Signed-off-by: Charlie Egan <git@charlieegan3.com>

---------

Signed-off-by: Charlie Egan <charlie_egan@apple.com>
Signed-off-by: Charlie Egan <git@charlieegan3.com>
Co-authored-by: Stephan Renatus <s_renatus@apple.com>
2025-12-02 11:06:38 +00:00
Charlie Egan 9439e22dd9 docs: Address some broken links (#8022)
Addresses some items from https://github.com/open-policy-agent/opa/issues/8005

Signed-off-by: Charlie Egan <charlie_egan@apple.com>
2025-11-07 19:14:29 +01:00
Stephan Renatus ef9c6303fb docs/devel: update for removed vendor/
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2025-10-16 10:44:33 +02:00
Charlie Egan f72110de20 docs/build: Link checker fixes (#7743)
This action triggers on the first of the month, but seemed to have some
issues where the results were not shown in the issue.

I've tried to fix this and the existing errors i found running the tool
locally.

Fixes https://github.com/open-policy-agent/opa/issues/7741

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-07-01 18:31:43 +00:00
Charlie Egan 37d3310e02 website: Explain automation in RELEASE.md (#7721)
This is just a note to point the release engineer to the correct place.

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-06-24 12:27:59 +01:00
Charlie Egan 1c97dba92b docs: Address broken links (#7661)
Fixes https://github.com/open-policy-agent/opa/issues/7649

A number of pages have been removed where the project has ceased to
exist.

docs in internal/ have been ignored from link checking

Signed-off-by: Charlie Egan <charlie@styra.com>
2025-06-04 12:57:29 +00:00
Johan Fylling 3525f0ec20 Adding clarification to merge instructions when cutting a patch release (#7660)
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2025-06-04 12:54:50 +02:00
Charlie Egan 54a40f2f6c Add note about updating search index after release (#6143)
Signed-off-by: Charlie Egan <charlie@styra.com>
2023-08-08 16:59:05 +01:00
Ashutosh Narkar 9e8ad4937e docs: Document pre-release process (#5814)
This change updates the OPA release process and introduces the
creation of a release candidate prior to the stable release.
The goal is to minimize bugs and regressions in the stable
release and also give users early access to test out features
and bug fixes that will end up in the stable release.

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2023-04-05 10:59:32 +02:00
Ashutosh Narkar 3f933fadae docs: Fix patch file name in bugfix rel steps
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2023-02-21 16:27:05 -08:00
carabasdaniel 295d25111f Add OCI documentation (#4781)
This commit adds OCI-related docs, and includes a tutorial for managing policies via an OCI registry.

Signed-off-by: carabasdaniel <dani@aserto.com>
2022-08-12 13:08:45 -04:00
Philip Conrad a6420ab592 docs: Update RELEASE.md with branch/fork workflow.
Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
2022-08-09 09:36:15 -07:00
Stephan Renatus 687beb7541 build: integrate builtin_metadata.json handling in release process (#4763)
Fixes #4754.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2022-06-20 10:57:17 +02:00
carabasdaniel 39125a034c downloader: support for downloading bundles from an OCI registry (#4558)
Initial support for #4518.

Configuration uses the 'services' config for registries, via the "type: oci" field.
Bundles configured to pull from that service will then use OCI.

```
services:
  ghcr-registry:
    url: https://ghcr.io
    type: oci
bundles:
  authz:
    service: ghcr-registry
    resource: ghcr.io/${ORGANIZATION}/${REPOSITORY}:${TAG}
    persist: true
    polling:
      min_delay_seconds: 60
      max_delay_seconds: 120
persistence_directory: ${PERSISTENCE_PATH}
```

Service credentials are supported: if you want to pull from a private registry,
use
```
services:
  ghcr-registry:
    url: https://ghcr.io
    type: oci
    credentials:
      bearer:
        token: ${GH_PAT}
```

If no `persistence_directory` is configured, the data is stored in a directory under /tmp.

See docs/devel/OCI.md for manual steps to test this feature with some
OCI registry (like ghcr.io).

Signed-off-by: carabasdaniel <dani@aserto.com>
2022-04-28 11:27:58 +02:00
Anders Eknert c2b2c62aee Prepare v0.36.0 release (#4178)
Signed-off-by: Anders Eknert <anders@eknert.com>
2022-01-04 16:49:24 +01:00
Johan Fylling 209848514c docs/devel: Fixing broken link to development guide (#4085)
* docs/devel: Fixing broken link to development guide

DEVELOPMENT.md linked to non-existing development guide URL at https://www.openpolicyagent.org/docs/edge/development/; changing link to https://www.openpolicyagent.org/docs/edge/contrib-development/.

Fixes: #4083
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2021-12-03 10:56:24 +01:00
Torin Sandall 4747e22f22 docs/devel: Update release curl command to trigger site deploy (#3789)
This URL is tied to the branch name which we changed to main a few
months ago. Needed to update the URL.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2021-09-14 18:20:45 +02:00
Stephan Renatus c918a4bbe5 website: add contributing section from existing content (#3752)
This is taken as-is from CONTRIBUTING.md for starters. The subsection
markup has been adjusted as there can only be one "# header 1" in a
document. Also done some light copy-editing.

Also adds the DEVELOPMENT.md content, slightly reformatted because of
bugs in our old hugo version. Code blocks in lists would look all wonky.

Both CONTRIBUTING.md and DEVELOPMENT.md now refer to the corresponding
website sections. As of now, it'll be `edge`, we can flip it to `latest`
after the next release.

Fixes #3751.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2021-08-25 08:38:34 +02:00
Will Beason 52cf5b84b5 use golangci-lint run --fix instead of goimports
Signed-off-by: Will Beason <willbeason@google.com>
2021-06-03 16:09:02 -04:00
Torin Sandall 4405a766f8 docs/devel: Update RELEASE.md references to main branch
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2021-04-15 15:32:15 -04:00
Torin Sandall 64288ffaa4 docs/devel: Update DEVELOPMENT.md references to main branch
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2021-04-15 15:32:15 -04:00
Stephan Renatus aa95762c44 golang: 1.13.7 -> 1.14.9
With 1.13.x no longer supported, we should pick the latest 1.14 minor release.

Signed-off-by: Stephan Renatus <srenatus@chef.io>
2020-10-05 15:58:41 -07:00
Torin Sandall dd78d44524 capabilities: Add capabilities.json files for patch releases
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-08-26 10:03:52 -04:00
Torin Sandall b5f4c57638 test: Move test case loader utility into test package
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-08-20 12:48:20 -04:00
Torin Sandall de04593f4c docs: Add example test case implementation
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-08-20 12:48:20 -04:00
Torin Sandall 17972357e5 docs: Update release steps to use 'git add' to include capabilities
The release patch will include a new file in the repo so we need to
use git add to include that file.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-08-18 13:51:38 -04:00
Patrick East 35b78b8afb CI: Skip asset upload/push when missing config
Previously we had some required configuration for the Github Actions,
and forks of OPA would need to set them _and_ have the underlying
infra configured (eg, docker registries, s3 bucket, etc).

Now it will check if the secrets are set, and if any required ones
are missing it will skip the steps.

This significantly lowers the bar for OPA forks to be able to run the
normal action workflows without getting errors. The only lost
functionality is primarily around publishing release assets, which
is not required for dev forks, and other forks can opt int to pieces
they care about (eg, only want to publish docker images and no
s3 release assets).

Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-07-24 10:49:19 -04:00
Patrick East 8ce7c8a76a report: Support build-time telemetry URL
We previously supported overriding via an environment variable, but
this meant for anyone who wanted to run their own telemetry endpoint
they would _always_ have to specify it while running their OPA's.

This change allows for someone to build OPA and encode the custom
url as the default. Ex:

```
make build TELEMETRY_URL=http://localhost:9876/custom/
```

Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-07-22 11:07:17 -07:00
Patrick East 5227ed0923 CI: Add slack notifications for periodic jobs
We are using a 3rd party action to simplify this. It appears to be
relatively well used, and the code looked pretty safe. It only has
access to the slack webhook secret, which is itself restricted in
permissions, so the risk is minimal.

It is configured to post a message for jobs that fail to the OPA
slack in the #development channel.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-07-15 12:01:25 -07:00
Patrick East b399486a81 docs/dev: Update RELEASE.md bugfix release steps
With the new GitHub actions workflows the steps changed for releasing
bugfix changes. This commit updates to the latest steps and makes a
few clarifications/corrections.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-07-10 12:27:58 -07:00
Patrick East 26e939d719 Add nightly github workflow with race detector job
We will run the golang race detector nightly (to start with.. we'll
adjust the workflow as needed).

One thing to note is that currently cgo is required for the race
detector, so we have to enable it when running this make target.

Fixes: #2388
Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-07-10 11:03:29 -07:00
Patrick East afb1c4ca29 wasm: Automate builder image deployment and build
Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-07-10 11:00:25 -07:00
Patrick East fb5ff78c24 Migrate to GitHub actions
This includes some refactors to the build steps. High level items:

* Add variables for DOCKER_IMAGE, S3_RELEASE_BUCKET to allow for forks
  of OPA to re-use the GitHub actions with their own s3 buckets and
  docker orgs/image names.

* Unify the release build steps to use `make release` and the binaries
  being located under `_release/$(VERSION)`. All CI targets now rely
  on binaries being in that `RELEASE_DIR`, including image building
  steps The `make build` target is unaffected.

* Add a wrapper to allow the CI to run the various golang target
  stages separately, but sharing the same docker configuration.

* Conditionally specify `-it` for docker run commands based on whether
  A tty is available.

* Added scripts to automate drafting a release with binary assets vi
  the `hub` CLI.

* The release process triggered on a tag being pushed will now use the
  same binaries from `make release` for the docker images as well as
  the ones attached to the release (which are available under
  https://openpolicyagent.org/downloads/).

The actions themselves are split into 3 workflows:

pull-request.yaml:
  Triggers on pull requests. This will run all the normal tests/checks
  as before on Travis, however they are now split into separate jobs.
  In addition to what was done on Travis we will now have Codecov
  results included.

post-merge.yaml:
  Triggers after a change is pushed to master. This will run tests and
  build+publish the `edge` and `dev` artifacts to dockerhub and s3.

post-tag.yaml:
  Triggers after a tag has been pushed. Similar to post-merge.yaml it
  will run tests and build+publish release artifacts (for the tagged
  version). It will also create a draft release on GitHub with the
  same artifacts and notes from the CHANGELOG.md. If a release already
  exists it will be updated to include the assets, however the release
  notes will _not_ be added.

The RELEASE.md steps have been updated and include notes on the new
steps.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-07-08 16:49:16 -07:00
Patrick East b5ca241cbf docs: Update release process steps for bugfix releases
I realized the documented instructions, while valid, were not what I
have actually been doing (which IMO is both easier and produces a better
end result). This updates the steps to include using the helper to
generate the release patch and updating the CHANGELOG on both
branches.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-06-03 07:53:10 -04:00
Patrick East 71454de28a Update dev docs
Adds some additional links on some workflow steps and removes an older
unused section.

There is also a little bit more detail on the desired commit message
format.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-04-16 16:10:53 -07:00
Torin Sandall db030e0b14 ast: New parser implementation
This commit replaces the existing PEG generated parser with a parser
implemented by hand. The new parser is more efficient (avoiding old
problems with pathological input cases like {{{{{{{{{}}}}}}}} and
deeply-nested composites in general) and offers better opportunities
for improved error reporting (which has been improved already but
there is still room to grow.)

During the test process of implementing the new parser, we identified
a few issues that were present in the old parser. Those issues are
fixed by this commit.

Fixes #1251
Fixes #501
Fixes #2198
Fixes #2199
Fixes #2200
Fixes #2201
Fixes #2202
Fixes #2203

Co-authored-by: Torin Sandall <torinsandall@gmail.com>
Co-authored-by: Patrick East <east.patrick@gmail.com>

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-03-26 04:57:12 -07:00
Patrick East e6727cbdf2 Add opa bench and opa test --bench
This adds in a new CLI sub command `opa bench` which will load
and evaluate similar to `opa eval` but will perform benchmark testing
of the query.

There is also a new `--bench` option for `opa test` which will
similarly perform benchmarking, except on the unit tests.

Both use the golang testing frameworks benchmark tooling, and the
output format is compliant with the go benchmark standard when using
the newly added `gobench` output format option.

They both support specifying a `--count` to run the benchmark a
number of times and a `--benchmem` option to report memory statistics.

To help enable using the `opa test` command better with the benchmark
option there is now a `--run`/`-r` option that can be provided to
specify a regex for what test cases should be run. The regex supports
anything that is supported by re2:

https://github.com/google/re2/wiki/Syntax

These changes required updating to Go 1.13 to get the ability to
report custom metrics with the benchmark results
https://golang.org/pkg/testing/#B.ReportMetric To get Netlify on board
we needed to add a `.go-version` file to the root of the repo. This is
now the single source of truth for the OPA golang version.

Fixes: #1424
Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-02-24 14:03:42 -08:00
Patrick East 29008ffffd Use goimports instead of fmt
This switches to use goimports configured for the opa directory to
do the formatting checks (which now includes ordering of imports).

It will _not_ change imports, only the order of them.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-27 09:55:11 -04:00
Patrick East e5f7ef63dc Dev doc update for go modules
Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-26 15:30:13 -07:00
Stephan Renatus 818738539e build: use docker for golang
As discussed in #1639.

Note that .dockerignore had to be changed as to *not* skip what's needed
for the build: vendor, obviously, and .git for the compiled-in version
information.

parts:
- .travis.yml: don't bother about golang anymore
- docs/devel/DEVELOPMENT.md: update
- Makefile: update hint

Signed-off-by: Stephan Renatus <srenatus@chef.io>
2019-09-10 08:53:41 -04:00
Torin Sandall 1e40874c03 docs: Update RELEASE.md file to include bugfix process
Currently this is a bit manual. We can automate/improve it in the future.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-09-03 08:42:29 -07:00
Torin Sandall 1495033a55 docs: Add note about benchmark result page
Fixes #1275

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-22 14:49:12 -04:00
Torin Sandall bd0d89bede build: Remove the release-builder image
The release-builder image is no longer required because we only need
the base Go image to build the OPA binaries. The nodejs dependency was
only required for the docs which are handled by netlify now.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-14 14:03:50 -04:00
Patrick East 9228efb3da Update release process for newer docs
The process is pretty easy, just add a new line in RELEASES with the
version number. Once that git tag is available it will start to show
up on subsequent builds.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-04-26 19:19:28 -07:00
lucperkins bb0d4e271b New OPA website (Hugo + Netlify)
Signed-off-by: lucperkins <lucperkins@gmail.com>
2019-03-26 13:45:50 -07:00
Torin Sandall 0d15d537b5 docs: Add note about GOPATH and pigeon missing
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-02-21 16:04:28 -08:00
Torin Sandall 62ec12d492 chore: Update release-builder for Go 1.11
Also, remove gulp installation as that's not required with the new frontpage.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-01-11 09:47:27 -08:00