Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add tool for config file validation and envvar replacement #94

Merged
merged 31 commits into from
Aug 30, 2024
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
413b276
add tool for config file validation and envvar replacement
tsloughter May 28, 2024
bc14393
don't replace inserted vars and support different defaults
tsloughter Jul 20, 2024
53deccd
remove subdir LICENSE of validator
tsloughter Jul 20, 2024
30b35a4
include validator makefile in top level makefile
tsloughter Jul 20, 2024
a468c11
add github action to test validator cli
tsloughter Jul 20, 2024
15fd457
add validation of examples to makefile for validator cli
tsloughter Jul 20, 2024
b7018e9
fix typing of replaced variables in yaml configs
tsloughter Jul 23, 2024
61503b6
add test of examples with otel_config_validator cli
tsloughter Jul 23, 2024
0c38c52
shelltests output to out dir
tsloughter Jul 23, 2024
1ba6214
fix replacement of multiple variables in a single value
tsloughter Jul 23, 2024
fd51c25
fix up validator makefile and add docker build to github action
tsloughter Jul 23, 2024
a42e1ca
support ${env:VAR} syntax for env var substitution
tsloughter Jul 23, 2024
5f68365
support integer written as hex with 0x prefix
tsloughter Jul 23, 2024
c32dc71
tag docker image with :current and add example to readme
tsloughter Jul 23, 2024
1bdb2bf
docker: add gomod and gobuild cache to buildx
tsloughter Jul 23, 2024
e0b5940
github action: sudo apt-get commands in validator tests
tsloughter Jul 23, 2024
79cbf67
add sort of validator example files in makefile so shelltests pass
tsloughter Jul 23, 2024
95975aa
remove support for json as input config file
tsloughter Jul 27, 2024
d15ea08
add binary and docker image publishing
tsloughter Jul 23, 2024
c71308b
add schema option to validator cli
tsloughter Aug 16, 2024
772de78
validator: disconnect version of cli from schema version
tsloughter Aug 20, 2024
bfd845a
validator: update readme docs for -s/--schema option
tsloughter Aug 20, 2024
cb25f5c
validator: add tag prefix to seperate cli tags from schema tags
tsloughter Aug 20, 2024
429b6ef
validator: fix test for help output for validator
tsloughter Aug 20, 2024
58c6e5a
validator: add to readme opening that a json/yaml file can be written
tsloughter Aug 22, 2024
a886bce
validator readme: link to otel-spec when describing var subs
tsloughter Aug 22, 2024
f34e911
validator: add note that Go 1.20+ is required to build
tsloughter Aug 22, 2024
aacbdcf
validator: fix readme reference to makefile target for docker
tsloughter Aug 22, 2024
c3b2f7c
validator: use shelltest docker image to run shelltests
tsloughter Aug 22, 2024
1f31826
validator: update docker builds to use scratch
tsloughter Aug 30, 2024
80465f8
Merge branch 'main' into add-validator
jack-berg Aug 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
validator: add tag prefix to seperate cli tags from schema tags
tsloughter committed Aug 20, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit cb25f5c2da9d8e9adba4255cd8772f96b3c9c542
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ on:
pull_request:
push:
tags:
- '**[0-9]+.[0-9]+.[0-9]+*'
- 'validator**[0-9]+.[0-9]+.[0-9]+*'

jobs:
# Run 'cargo dist plan' (or host) to determine what tasks we need to do
2 changes: 2 additions & 0 deletions dist.toml
Original file line number Diff line number Diff line change
@@ -22,6 +22,8 @@ targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-
install-path = ["$OTEL_CONFIG_VALIDATOR_HOME/bin", "~/.local/bin"]
# Publish jobs to run in CI
pr-run-mode = "plan"
# A prefix git tags must include for cargo-dist to care about them
tag-namespace = "validator"
# Whether to install an updater program
install-updater = false

10 changes: 10 additions & 0 deletions validator/README.md
Original file line number Diff line number Diff line change
@@ -80,3 +80,13 @@ Running the tests of the compiled CLI requires
$ shelltest -c --diff --all shelltests/*.test
```

### Releasing

To release a new version of `otel_config_validator` the version in `dist.toml`
and the `Version` property of `cli.Comamnd` in `main.go` must be bumped. Next, a
tag prefixed with `validator-` must be created and pushed to the repository, for
example `validator-0.1.0`. Then, the `cargo-dist` Github Action will create a
Github release, build binaries for multiple platforms and publish them to the
new release.

Docker image are published on merge to `main`.
1 change: 1 addition & 0 deletions validator/main.go
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ func main() {
cmd := &cli.Command{
Name: "otel_config_validator",
Usage: "Validate a configuration file against the OpenTelemetry Configuration Schema",
Version: "0.1.0",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "output",