Commit Graph

25 Commits

Author SHA1 Message Date
cli-docs-updater fff3e0aeff docs: Update generated CLI docs 2022-10-26 08:45:26 +00:00
Byron Lagrone 235ee309da cmd/exec: add --fail and --fail-defined flags (#5295)
Adds the ability to exit with a non-zero exit code for 'opa exec' by adding the
--fail and --fail-defined flags matching their respective behaviors in 'opa eval':

- Setting the --fail-defined flag allows exit of opa exec with a zero code if all
   results are undefined and there are no errors, or a non-zero code in the
   event of any defined results and/or errors.
   On non-zero exits the error message includes the number of failures/errors
   as well as a reference to the --fail-defined flag being set.
- The --fail flag behaves as the inverse of --fail-defined.

Fixes: #5007

Signed-off-by: Byron Lagrone <byron.lagrone@seqster.com>
2022-10-26 10:43:07 +02:00
cli-docs-updater 476e04f377 docs: Update generated CLI docs 2022-10-24 18:37:46 +00:00
Philip Conrad e2eabe88c1 ast+compile+cmd: Support entrypoint annotations. (#5246)
This commit adds support to the `compile` package for extracting
entrypoints from Rego `entrypoint` metadata annotations. The new
entrypoint annotations can be applied to any valid entrypoint target,
e.g. rules and packages.

An example policy using the new entrypoint annotations:

    package test

    # METADATA
    # entrypoint: true
    allow {
        input.x
    }

The `build` and `eval` CLI commands have been updated so that they do
not require an entrypoint to be explicitly provided with `-e`, so long
as at least one valid rule/package is marked with an entrypoint
annotation.

The new feature is additive; entrypoints can still be explicitly
provided to these commands by `-e`, and those will be used alongside the
entrypoints discovered from the metadata annotations.

Fixes: #3459

Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
2022-10-24 14:35:17 -04:00
Jasper Van der Jeugt a56c231269 feature: add UnifyOp to tracer events (#5203)
This would be useful for us for two immediate use cases:

1.  Show how and why rules failed in more detail in verbose tooling,
    we can show the unification happening step by step.
2.  We can trace which parts of the input document were used, if we
    add `Location` info those terms.

However, I think it's generally useful for debugging tools.

This increases verbosity in the explain logs, so we decided to add a new explain
mode `debug` in addition to the existing `full`, `notes`, `fails`, `off` modes.
This can be set using the `--explain=debug` flag on the CLI, or by using `trace
debug` in the REPL.

Signed-off-by: Jasper Van der Jeugt <m@jaspervdj.be>
2022-10-10 11:57:31 +02:00
cli-docs-updater fc328b43e1 docs: Update generated CLI docs 2022-09-23 18:38:53 +00:00
Ashutosh Narkar 6c6494e42e internal/report: Include heap usage in the telemetry report
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
2022-09-23 11:36:53 -07:00
cli-docs-updater f266848ffe docs: Update generated CLI docs 2022-09-21 12:32:01 +00:00
cli-docs-updater 1919dc07f0 docs: Update generated CLI docs 2022-09-20 12:52:18 +00:00
cli-docs-updater b0579bc16a docs: Update generated CLI docs 2022-08-29 12:26:03 +00:00
Sergey Vilgelm 5e51af9244 logger: Configure timestamp format (#5050)
With this, we allow the user to configure the logger's timestamp format by:
* cli argument `log-timestamp-format`
* environment variable `OPA_LOG_TIMESTAMP_FORMAT`

Fixes #2413.

Signed-off-by: Sergey Vilgelm <sergey@vilgelm.com>
2022-08-29 14:23:48 +02:00
cli-docs-updater 54041985ec docs: Update generated CLI docs 2022-08-23 08:34:05 +00:00
cli-docs-updater eaea98c4ad docs: Update generated CLI docs 2022-08-22 21:27:56 +00:00
cli-docs-updater 3694eb1341 docs: Update generated CLI docs 2022-06-22 18:32:18 +00:00
cli-docs-updater 1ff8f00729 docs: Update generated CLI docs 2022-05-24 21:12:21 +00:00
Anders Eknert af5141bfa0 Update docs to prefer := over = (#4706)
Seems like we missed this in a "few" places :)

Signed-off-by: Anders Eknert <anders@eknert.com>
2022-05-24 23:10:11 +02:00
IoannisMatzaris d71e3bb6c2 cmd/capabilities: expose capabilities through CLI (#4588)
There is a new command argument "capabilities". With this, it is
possible to print the current capabilities version, show all
capabilities versions & print any capabilities version, without the need
of a file. Moreover, for the other commands which use the --capabilities
flag, it is possible to give only the version number, without specifying
a file. However, there are no breaking changes for those who use the
capabilities file as an input for the flag. Unit tests were also
written, in order to test the new argument and the changes made in ast.

Fixes: #4236

Signed-off-by: IoannisMatzaris <matzarisioannis@gmail.com>
2022-04-26 10:57:48 +02:00
cli-docs-updater aaf167db99 docs: Update generated CLI docs 2022-04-20 16:29:21 +00:00
Torin Sandall 54827f3ef4 docs/content: Update docs to use := at the file-level
This partially addresses #4599.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2022-04-20 09:27:39 -07:00
cli-docs-updater 521cd2369c docs: Update generated CLI docs 2022-03-03 10:20:32 +00:00
cli-docs-updater 64a03c1a19 docs: Update generated CLI docs 2022-03-03 09:12:40 +00:00
cli-docs-updater fefc27c691 docs: Update generated CLI docs 2022-02-12 16:42:43 +00:00
cli-docs-updater d12fb7c445 docs: Update generated CLI docs 2022-01-29 14:27:07 +00:00
Stephan Renatus 1f01a2666c docs: de-evaluate $HOME in CLI docs (#4256)
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2022-01-20 11:29:05 +01:00
cli-docs-updater 70bbb6380e docs: Update generated CLI docs 2022-01-19 12:01:05 +00:00