Skip to content

Commit

Permalink
Validate dev cluster config in CI (grafana#11642)
Browse files Browse the repository at this point in the history
**What this PR does / why we need it**:
The configuration in `tools/dev/loki-boltdb-storage-s3` was broken in
the past because it's easy to miss. This change covers the validation in
the CI to raise awareness.

**Checklist**
- [ ] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [ ] Tests updated
- [ ] `CHANGELOG.md` updated
- [ ] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/setup/upgrade/_index.md`
- [ ] For Helm chart changes bump the Helm chart version in
`production/helm/loki/Chart.yaml` and update
`production/helm/loki/CHANGELOG.md` and
`production/helm/loki/README.md`. [Example
PR](grafana@d10549e)
- [ ] If the change is deprecating or removing a configuration option,
update the `deprecated-config.yaml` and `deleted-config.yaml` files
respectively in the `tools/deprecated-config-checker` directory.
[Example
PR](grafana@0d4416a)
  • Loading branch information
jeschkies authored and rhnasc committed Apr 12, 2024
1 parent 730a3d5 commit 8456d53
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions .drone/drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ local build_image_tag = '0.33.0';
'GIT_TARGET_BRANCH="$DRONE_TARGET_BRANCH"',
]) { depends_on: ['loki'], when: onPRs },
make('validate-example-configs', container=false) { depends_on: ['loki'] },
make('validate-dev-cluster-config', container=false) { depends_on: ['loki'] },
make('check-example-config-doc', container=false) { depends_on: ['clone'] },
{
name: 'build-docs-website',
Expand Down
9 changes: 8 additions & 1 deletion .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,13 @@ steps:
environment: {}
image: grafana/loki-build-image:0.33.0
name: validate-example-configs
- commands:
- make BUILD_IN_CONTAINER=false validate-dev-cluster-config
depends_on:
- loki
environment: {}
image: grafana/loki-build-image:0.33.0
name: validate-dev-cluster-config
- commands:
- make BUILD_IN_CONTAINER=false check-example-config-doc
depends_on:
Expand Down Expand Up @@ -2106,6 +2113,6 @@ kind: secret
name: gpg_private_key
---
kind: signature
hmac: 30f2fb121d8271e00dc2ae8fe83a32e0e22fd2bd268609d0c3f295033fcd4fb6
hmac: fe7669a21410ae5f2d1ad6b6205fdc582af874f65f7bd6a679731a88174e3a1c

...
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,9 @@ EXAMPLES_SKIP_VALIDATION_FLAG := "doc-example:skip-validation=true"
validate-example-configs: loki
for f in $$(grep -rL $(EXAMPLES_SKIP_VALIDATION_FLAG) $(EXAMPLES_YAML_PATH)/*.yaml); do echo "Validating provided example config: $$f" && ./cmd/loki/loki -config.file=$$f -verify-config || exit 1; done

validate-dev-cluster-config: loki
./cmd/loki/loki -config.file=./tools/dev/loki-boltdb-storage-s3/config/loki.yaml -verify-config

# Dynamically generate ./docs/sources/configure/examples.md using the example configs that we provide.
# This target should be run if any of our example configs change.
generate-example-config-doc:
Expand Down

0 comments on commit 8456d53

Please sign in to comment.