Commit Graph

228 Commits

Author SHA1 Message Date
Torin Sandall 1095b391ec build: Catch uncommitted generated files during CI
Fixes #2355

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-04-30 14:53:20 -04:00
Torin Sandall 12d1afbff2 build: Do not try to install wasm-rego-testgen binary deps
go install -i requires permission to locations outside the src dir so
just remove it--we don't need it anyway. See https://github.com/golang/go/issues/18981.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-04-30 14:53:20 -04:00
Torin Sandall 8becfb8b39 Dockerfile: Go back to scratch
Now that we can build with CGO_ENABLED=0 we do not have to use a base
image that provides libc. Remove distroless for the normal and
rootless images and use scratch instead.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-04-30 14:53:20 -04:00
Torin Sandall 7db82e7aa3 cmd: Remove support for shared library loading
Shared library loading was removed in v0.14.0. This commit removes the
deprecated code and moves the test coverage for plugin registration
via the runtime package global into the runtime package.

Fixes #2049

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-04-30 14:53:20 -04:00
Torin Sandall 965723c736 topdown: Fix data race in the http.send timeout tests
Also, since these tests are slow, move them into another flag and gate
them with a build flag.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-04-23 16:29:50 -04:00
Krsna Mahapatra bd3a25ab2d Add deb packaging
Signed-off-by: Krsna Mahapatra <keshto@gmail.com>
2020-04-21 16:25:17 -07:00
Patrick East 25029dffe9 Prepare v0.20.0 development
Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-04-13 17:26:31 -07:00
Patrick East 5bb89af285 Prepare v0.19.1 release
Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-04-13 17:22:51 -07:00
Torin Sandall 22f93e2fca Prepare v0.20.0 development
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-04-13 17:06:58 -04:00
Torin Sandall f76710ae43 Prepare v0.19.0 release
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-04-13 17:05:53 -04: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
Torin Sandall 0c5de05e5f Prepare v0.19.0 development
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-04-01 14:57:48 -04:00
Torin Sandall 86ad244a69 Prepare v0.19.0-rc1 release
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-04-01 14:56:45 -04:00
Patrick East 7002b6f92b Add support for release candidate version tags
Any release tag with a `rc` string in the the semver
will be ignored for the docs on the website and will _not_ update the
"latest" docker image tag, or "latest" downloads url.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-03-26 11:55:49 -07:00
Patrick East ae42afdb17 Prepare v0.19.0 development
Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-03-16 19:11:34 -07:00
Patrick East 659a0f73c6 Prepare for v0.18.0 release
Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-03-16 19:09:48 -07:00
Patrick East 015e1b5291 docs: Update acorn to fix CVE with dev tooling
Fixing https://github.com/advisories/GHSA-7fhm-mqm4-2wp7

This also fixes the unit tests (not sure how long they've been borken)
and makes them run as part of the netlify preview build, so any
regressions should be seen in PR's.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-03-16 17:52:02 -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 f771468251 Prepare v0.18.0 development
Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-02-20 14:14:33 -08:00
Patrick East 525b1ab399 Prepare v0.17.2 release
Signed-off-by: Patrick East <east.patrick@gmail.com>
2020-02-20 14:04:17 -08:00
Torin Sandall f7860061c4 Prepare v0.18.0 development
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-02-09 10:22:02 -05:00
Torin Sandall 6bafed32f8 Prepare v0.17.1 release
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-02-09 10:20:36 -05:00
Torin Sandall d4c708c3e6 Prepare v0.18.0 development
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-02-07 13:37:45 -05:00
Torin Sandall e128a3fb11 Prepare v0.17.0 release
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-02-07 13:36:53 -05:00
Armin Felder 9ba923d585 changes user id form 1 to 1000
Signed-off-by: Armin Felder <armin.felder@osalliance.com>
2020-01-13 12:18:25 -08:00
Torin Sandall 2d1dabe10e make: Remove 'v' in Makefile VERSION
This was added accidentally during the last release cut. This only
affects the dev build so it's not a big deal.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-12-20 15:11:47 -05:00
Torin Sandall e1797e263e Prepare v0.17.0 development
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-12-19 08:12:48 -05:00
Torin Sandall b50e626620 Prepare v0.16.0 release
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-12-19 08:07:31 -05:00
Torin Sandall 37397c5a3d Prepare v0.16.0 development
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-11-18 10:22:32 -05:00
Torin Sandall 62bb63dd3b Prepare v0.15.1 release
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-11-18 10:21:16 -05:00
Torin Sandall 9df65ea93e Prepare v0.16.0 development
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-10-30 11:13:26 -04:00
Torin Sandall 85a531512b Prepare v0.15.0 release
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-10-30 11:12:40 -04:00
Torin Sandall 57e8238126 travis: Remove dead code related to fuzzer
Once the underlying parser issues are resolved, we can revisit the
fuzzit integration. Until then, it's not providing value for us.

Tracking issue: https://github.com/open-policy-agent/opa/issues/1843#issuecomment-544640860

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-10-22 10:11:54 -04:00
Ashutosh Narkar b30c7fc8c0 travis: Remove Fuzzit testing and Regression from CI
Fuzzit targets are failing as the libFuzzer is running into out-of-memory errors. This is causing the CI to fail on master.

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2019-10-14 09:06:10 -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
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 5c1c232353 Remove install-deps, instead go run from vendor
This avoids the need to go-install anything.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-26 15:30:13 -07:00
Patrick East de842689c3 Force modules to be enabled when using make
Without this, if someone has opa checked out in their gosrc path
it would _not_ default to using modules. This will force the build
commands to treat the repo as a module at all times.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-26 15:30:13 -07:00
Patrick East 36c1374b82 Update Makefile to always use vendor dir for dependencies
This will keep us honest with having the vendor directory up to date
with the go.mod/go.sum configuration. The vendor directory will always
be an archive of the dependencies used to build the project.

Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-26 15:30:13 -07:00
Torin Sandall d64568ec20 Prepare v0.15.0 development
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-09-12 18:31:25 -04:00
Torin Sandall 8d1cc7e7e9 Prepare v0.14.0 release
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-09-12 18:28:41 -04:00
Torin Sandall 5628df23e7 build: Pass FUZZIT_API_KEY to container
The fuzzer wasn't receiving the API key so it was bailing out.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-09-10 16:27:40 -04:00
Torin Sandall ae582c74fc build: Fix bad makefile target
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-09-10 15:58:13 -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 dfd2c99221 build: Refactor build to remove host dependencies
Remove dependencies on build server host, relying on Docker execution
for everything. These changes reorganize the wasm development
targets. The wasm-build/test/clean targets operate on the C code in
the wasm/ directory. The wasm-rego-test target runs the wasm
integration test cases from the asset files under the test/
directory. The wasm-rego-test asset generation step has been
refactored to use proper Makefile dependencies. This _should_ allow us
to share the same wasm-rego-target in development and on Travis.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-09-10 13:05:06 -04:00
Stephan Renatus 82f43a416b Makefile: rearrange targets for wasm test cases
Signed-off-by: Stephan Renatus <srenatus@chef.io>
2019-09-10 08:53:41 -04:00
Stephan Renatus 33a2c8e88c Makefile: rearrange targets for wasm in travis
This is crude, and unfinished: the fuzzing stuff still uses go and
wasn't moved into a container.

Signed-off-by: Stephan Renatus <srenatus@chef.io>
2019-09-10 08:53:41 -04:00
Stephan Renatus 26d373698e Makefile: docker => $(DOCKER) for consistency
Signed-off-by: Stephan Renatus <srenatus@chef.io>
2019-09-10 08:53:41 -04: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
Yevgeny Pats ec1d9f8107 Adding Fuzzit testing & regression to CI
Signed-off-by: Yevgeny Pats <yp@fuzzit.dev>
2019-08-29 10:21:01 -07:00