31 Commits

Author SHA1 Message Date
Sebastian Spaink f6092b9ce4 add --format flag for proto/JSON plan bundles (#8825)
This change adds a new flag for emitting plan bundles in the new protobuf wire format. `opa build --format=json|proto`. With `--format=proto`, the bundle contains `/plan.pb` and `/.manifest.pb` in place of `/plan.json`and `/.manifest`. Bundle Reader auto-detects both forms; mixed-format bundles are rejected at read, merge, and write time.

Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
2026-07-06 12:50:33 -05:00
Sebastian Spaink 804dcc1c98 feat: add version and icon to opa_windows_amd64.exe (#7501)
Signed-off-by: sspaink <sspaink@styra.com>
Co-authored-by: Philip Conrad <philip@chariot-chaser.net>
2025-04-10 07:41:59 -05:00
Charlie Egan a7fa31d56e [docs] Fix unversioned built-in docs issue (#6274)
Fixes https://github.com/open-policy-agent/opa/issues/6269

This fixes the issue by using the builtin_metadata.json file from each
version, the assumption that docs content that depends on the data
doesn't exist before this file was introduced.

I have removed the 'available' check since we haven't consistently
updated the file in the past, e.g.

* https://github.com/open-policy-agent/opa/blob/v0.41.0/builtin_metadata.json#L12710
* https://github.com/open-policy-agent/opa/blob/v0.57.0/builtin_metadata.json#L563

These examples show that sometimes the current version is included,
other times the file is updated after the release.

Video showing the correct content being displayed for various versions:

https://github.com/open-policy-agent/opa/assets/1774239/abf1af7d-9c59-4223-a019-c73d7550b322

To locally test this:

```
git clean -dfx
cd docs
make generate hugo-production-build
hugo server --source website --contentDir generated --ignoreCache --minify
```

Signed-off-by: Charlie Egan <charlie@styra.com>
2023-10-05 09:28:40 +01:00
Peter ONeill 6991b00f08 website: Community Webpage Updates (#4390)
- Added two more community champions
- Removed enterprise support from community page
- Changed blurry line to solid line
- Updated newsletter signup from Medium to Mailchimp
- add hugo lock to gitignore

Signed-off-by: Peter ONeill <peteroneilljr@gmail.com>
2022-03-01 07:30:12 +01:00
Johan Fylling f7a084e688 Adding unused local assignment check to compiler strict mode (#4262)
Fixes: #2514
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2022-01-28 13:32:36 +01:00
Torin Sandall 50af12bb5f Add bundle.tar.gz to gitignore (#3384)
Otherwise running opa build in the directory dirties the working copy.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2021-04-14 21:04:45 +02:00
Grant Shively ee9dc91767 bundle: refactor sign/verify to use interface (#3336)
It is now possible to register a custom implementation of the sign and
verify functions.

Signed-off-by: Grant Shively <gshively@godaddy.com>
2021-04-14 09:50:52 +02:00
Patrick East ba54066192 Move golang-opa-wasm into opa
This moves the package from:

github.com/open-policy-agent/golang-opa-wasm/opa

to:

github.com/open-policy-agent/opa/wasm/sdk/opa

This avoids callers from having to do much in the way of changes
besides adjusting the import path.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-11-06 15:12:38 -05: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
Olivier Lemasle 4c81aa75c0 Add man pages generation
Signed-off-by: Olivier Lemasle <o.lemasle@gmail.com>
2020-04-09 10:46:13 -07:00
Patrick East 1ebe25dd2f docs: Update dev instructions and make targets
This updates the Makefile targets to remove the hugo-only options for
development, as well as clarifying/simplifying the requirements for
a dev environment. There are now really two options: just look at the
markdown preview with your editor/ide, or install the tools locally
and deploy the full site.

We can likely improve the dev experience some more (would be nice to
get back to the live content updating dev experience) but for now this
should help remove some confusion about how to build and run the site.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-03-26 07:39:36 -07:00
Torin Sandall daff1b4abc build: Fix dirty working copy on travis build and more
This commit combines a few changes to the build. Namely:

1. The travis build no longer works off a dirty working copy. The
.dockerignore file was excluding the docs directory which caused the
working copy to become dirty during the build process. While this
isn't a huge issue it does make it harder to be confident about the
state of the source that Travis binaries are built from. As part of
this change, we remove the builder image in favour of running the
golang image and volume mounting the working copy. This is avoids the
copy that is quite expensive in the OPA repo.

2. In the recent build refactoring, the wasm development workflow was
broken. Changes to the wasm library were not getting picked up
automatically when running the wasm/rego tests. This commit fixes the
makefile so that the wasm libary is rebuilt and the wasm blob is
copied and regenerated each time the wasm/rego tests are run.

Finally, this commit leans into modules a bit more removing the
scheduler test dependency on GOPATH.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-09-27 15:52:58 -04:00
Torin Sandall eb0df1944a build: Move fuzzer build into Docker image
The build was broken becasue the fuzzer artifacts were showing up in
the working copy and were owned by root once they got built inside of
a Docker image. This change updates the build to create an image for
the fuzzer to run inside of. The image can be shared across both
fuzzer runs and the artifacts are contained inside the image and don't
pollute the working copy.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-09-10 15:38:48 -04:00
Torin Sandall 650930d717 Update .gitignore for emacs backup files
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-01-10 14:52:14 -08:00
Torin Sandall ce9a6e0c9a Update docs build process for new front page
These changes just update the build process for the new front page. As
part of these changes, the build should now be run under the host user
account instead of as root (this fixes the issue for site build
artifacts being owned by root.) To make that work the gitbook and npm
directories used by the docs build process need to be located under the
root directory so that they're writable by the user.

With these changes, the first time you build the site locally gitbook
needs to be installed but after that it's cached locally in the .gitbook
directory (so subsequent builds are fast when coupled with the vendored
node_modules for the gitbook plugins).

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2018-11-26 15:10:14 -08:00
Torin Sandall 7cd257bcf5 Add simple test framework for WASM policies
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2018-10-08 17:29:18 -07:00
Torin Sandall 90bda056b4 Add C library implementing operations for WASM
These changes add a C library that implements low-level data operations
and JSON parsing for WASM policies. The output of the WASM build process
are checked into the repository so that OPA can easily access the
bytecode for test and other purposes.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2018-10-08 17:29:18 -07:00
Torin Sandall 09acbbdc7f Add build subcommand and expose compiler
These changes add a build command that writes out a policy.wasm file by
compiling an input query to WASM. These changes also add a simple
compile interface to the rego package.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2018-10-08 17:29:18 -07:00
repenno 009c06f171 Modified .gitignore to ignore GoLand IDE files 2017-12-22 11:09:43 -08:00
Eva Xiaohui Luo 25ba04c980 Refresh OPA website
These changes contain a redesign of the OPA website. The main changes
are (1) new frontpage w/ refreshed messaging and assets and (2) docs
ported to gitbook.
2017-07-05 15:39:45 -07:00
Torin Sandall 3bc5f04b47 Improve release infrastructure
- Add script to build release artifacts from inside a container. In the past,
release artifacts have been created from a clean checkout, but this should be
much more reliable.

- Add script to generate release patch from tip. In the past, the release
patch changes have been made manually.
2016-12-22 15:54:00 -08:00
Torin Sandall 4dfa7acf21 Add support for Docker image build 2016-10-18 08:21:05 -07:00
Torin Sandall 5e835a7e2f Add generated parser code
This is required to use "go get github.com/open-policy-agent/opa".
2016-07-14 10:42:58 -07:00
Torin Sandall ac3f177ac0 Update build to cross compile
Currently targeting linux/amd64 and darwin/amd64
2016-05-25 16:36:12 -07:00
Torin Sandall 12dad370d5 Add basic REST API support to server mode
- REST APIs

    * CRUDL on policy modules
    * Ad-hoc queries
    * Query and patch base documents
    * Query virtual documents

- Add PolicyStore to manage policy definition/module CRUDL operations.

    * Supports persistence of policy definitons.
    * Serve REST API CRUDL operations.
    * Manage install/uninstall of rules into data store.
    * Manage persistence of policy definitions.

- Misc. refactoring

    * Move storage creation into runtime Init.
    * Make AST types JSON serializable. Tweaked ast.Import to use Term instead
    of Value for the path.
2016-05-13 15:34:02 -07:00
Torin Sandall 299606cdac Rename the language to Rego
Rego: Latin verb for rule/govern/control.
2016-05-09 08:56:55 -07:00
Torin Sandall d1c3ca5191 Add basic run command
- Introduced new run command that lets users start an instance of OPA.
- Added basic REPL as first mode that can be run, server mode coming soon.
- Extended Storage to support a JSON Patch like interface.
2016-05-02 08:43:19 -07:00
Torin Sandall cf1caf8b92 Add Makefile target to run coverage
For now the target fails because there are no tests for the "cmd" package.
Since this is being used manually for now, this is acceptable.
2016-04-13 18:00:51 -07:00
Torin Sandall 157e4f083a Add references to the grammar
The special iterator variable ("_") is not supported yet. The _ variable will
be handled by mangling the variable name while parsing the rules (which are
still to come).

Also refactored terms to use type declaration and type switches. All terms are
now represented by underlying Go types without relying on extra structs. The
Kind attribute on Term has been removed in favour of type switches.

Lastly, removing the generated parser from the repository for now. Once the
grammar has stabilized, we can add the generated code back. The diffs were
unpleasant.
2016-04-02 12:03:31 -07:00
Torin Sandall e2297a7833 Basic infrastructure and process documentation
- Updated source code layout to use standard Go project structure.
- Makefile for build and test execution.
- Glide for dependency management.
- Integrated spf13/cobra for command line entry point.
- Added docs on release and development process.
2016-03-30 08:58:21 -07:00
Torin Sandall 190b73984f Add ignore for Visual Studio Code 2016-03-23 14:32:38 -07:00