configure yamllint pre-commit step (#2728)

# What this PR does

Add [`yamllint`](https://github.com/adrienverge/yamllint) to
`pre-commit` configuration + fix pre-existing errors

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
This commit is contained in:
Joey Orlando 2023-08-03 08:35:08 +02:00 committed by GitHub
parent 225e4e4882
commit b26706e7e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 183 additions and 89 deletions

View file

@ -10,7 +10,9 @@ steps:
- apt-get update
- apt-get --assume-yes install jq
- cd grafana-plugin/
# yamllint disable rule:line-length
- if [ -z "$DRONE_TAG" ]; then echo "No tag, not modifying version"; else jq ".version=\"${DRONE_TAG#v}\"" package.json > package.new && mv package.new package.json && jq '.version' package.json; fi
# yamllint enable rule:line-length
- yarn --network-timeout 500000
- yarn build
- ls ./
@ -32,7 +34,9 @@ steps:
- yarn ci-package
- cd ci/dist
- zip -r grafana-oncall-app.zip ./grafana-oncall-app
# yamllint disable rule:line-length
- if [ -z "$DRONE_TAG" ]; then echo "No tag, skipping archive"; else cp grafana-oncall-app.zip grafana-oncall-app-${DRONE_TAG}.zip; fi
# yamllint enable rule:line-length
- name: Publish Plugin to GCS (release)
image: plugins/gcs
@ -80,7 +84,9 @@ steps:
- chmod +x ./tools/image-tag.sh
- echo $(./tools/image-tag.sh)
- echo $(./tools/image-tag.sh) > .tags
# yamllint disable rule:line-length
- if [ -z "$DRONE_TAG" ]; then echo "No tag, not modifying version"; else sed "0,/VERSION.*/ s/VERSION.*/VERSION = \"${DRONE_TAG}\"/g" engine/settings/base.py > engine/settings/base.temp && mv engine/settings/base.temp engine/settings/base.py; fi
# yamllint enable rule:line-length
- cat engine/settings/base.py | grep VERSION | head -1
when:
ref:
@ -90,7 +96,8 @@ steps:
- name: Build and Push Engine Docker Image Backend to GCR
image: plugins/docker
environment:
# force docker to use buildkit feature, this will skip build stages that aren't required in the final image (ie. dev & dev-enterprise)
# force docker to use buildkit feature, this will skip build stages that aren't required in
# the final image (ie. dev & dev-enterprise)
# https://github.com/docker/cli/issues/1134#issuecomment-406449342
DOCKER_BUILDKIT: 1
settings:
@ -108,7 +115,8 @@ steps:
- name: Build and Push Engine Docker Image Backend to Dockerhub
image: plugins/docker
environment:
# force docker to use buildkit feature, this will skip build stages that aren't required in the final image (ie. dev & dev-enterprise)
# force docker to use buildkit feature, this will skip build stages that aren't required in
# the final image (ie. dev & dev-enterprise)
# https://github.com/docker/cli/issues/1134#issuecomment-406449342
DOCKER_BUILDKIT: 1
settings:
@ -166,7 +174,9 @@ steps:
- apt-get update
- apt-get --assume-yes install jq
- cd grafana-plugin/
# yamllint disable rule:line-length
- if [ -z "$DRONE_TAG" ]; then echo "No tag, not modifying version"; else jq ".version=\"${DRONE_TAG#v}\"" package.json > package.new && mv package.new package.json && jq '.version' package.json; fi
# yamllint enable rule:line-length
- yarn --network-timeout 500000
- yarn build
- ls ./
@ -188,7 +198,9 @@ steps:
- yarn ci-package
- cd ci/dist
- zip -r grafana-oncall-app.zip ./grafana-oncall-app
# yamllint disable rule:line-length
- if [ -z "$DRONE_TAG" ]; then echo "No tag, skipping archive"; else cp grafana-oncall-app.zip grafana-oncall-app-${DRONE_TAG}.zip; fi
# yamllint enable rule:line-length
- name: publish plugin to grafana.com (release)
image: curlimages/curl:7.73.0
@ -196,7 +208,9 @@ steps:
GRAFANA_API_KEY:
from_secret: gcom_plugin_publisher_api_key
commands:
# yamllint disable rule:line-length
- 'curl -f -s -H "Authorization: Bearer $${GRAFANA_API_KEY}" -d "download[any][url]=https://storage.googleapis.com/grafana-oncall-app/releases/grafana-oncall-app-${DRONE_TAG}.zip" -d "download[any][md5]=$$(curl -sL https://storage.googleapis.com/grafana-oncall-app/releases/grafana-oncall-app-${DRONE_TAG}.zip | md5sum | cut -d'' '' -f1)" -d url=https://github.com/grafana/oncall/grafana-plugin https://grafana.com/api/plugins'
# yamllint enable rule:line-length
depends_on:
- sign and package plugin
@ -218,7 +232,9 @@ steps:
image: alpine
commands:
- apk add --no-cache bash sed
# yamllint disable rule:line-length
- if [ -z "$DRONE_TAG" ]; then echo "No tag, not modifying version"; else sed "0,/VERSION.*/ s/VERSION.*/VERSION = \"${DRONE_TAG#v}\"/g" engine/settings/base.py > engine/settings/base.temp && mv engine/settings/base.temp engine/settings/base.py; fi
# yamllint enable rule:line-length
- cat engine/settings/base.py | grep VERSION | head -1
- name: build and push docker image
@ -313,6 +329,6 @@ kind: secret
name: drone_token
---
kind: signature
hmac: a5412bf88ceb62fffdfb9926d3f6f066c80ccbe23114aab6540c4b748137f73a
hmac: 8b387638ef35f86ed9f8c8c964726e0ae703beb7d0f18e053b5041ab8ee9bed2
...

View file

@ -14,16 +14,17 @@ body:
- type: markdown
attributes:
value: |
**HINT:** Have you tried [searching](https://github.com/grafana/oncall/issues) for similar issues? Duplicate issues are common.
**HINT:** Have you tried [searching](https://github.com/grafana/oncall/issues) for similar issues?
Duplicate issues are common.
**Are you reporting a security vulnerability?** [Submit it here instead](https://github.com/grafana/oncall/security/policy).
**Are you reporting a security vulnerability?**
[Submit it here instead](https://github.com/grafana/oncall/security/policy).
- type: textarea
id: bug-describe
attributes:
label: What went wrong?
description: |
#
Describe your bug. What happened? What did you expect to happen?
# Describe your bug. What happened? What did you expect to happen?
**Pro Tip**: Record your screen and add it here as a gif.
value: |
@ -53,7 +54,9 @@ body:
id: oncall-version
attributes:
label: Grafana OnCall Version
description: What Grafana OnCall version are you using? If this is related to the Grafana OnCall mobile app, please mention which app version, and OS (plus version), you are running.
description: >
What Grafana OnCall version are you using? If this is related to the Grafana OnCall mobile app,
please mention which app version, and OS (plus version), you are running.
placeholder: "ex: v1.1.12, r170-v1.2.43, or v1.0.6 - build 1038 iOS 16.6"
validations:
required: true
@ -95,7 +98,9 @@ body:
id: user-browser
attributes:
label: User's Browser?
description: Is the bug occuring in the Grafana OnCall web plugin? If so, what browsers are you seeing the problem on? You may choose more than one.
description: >
Is the bug occuring in the Grafana OnCall web plugin? If so,
what browsers are you seeing the problem on? You may choose more than one.
placeholder: "ex. Google Chrome Version 112.0.5615.137 (Official Build) (arm64)..."
validations:
required: false

View file

@ -8,13 +8,16 @@ body:
value: |
Hi 👋, thanks for taking the time to request a new feature!
Please try to give your feature request a good title. Try using a brief description of what you'd like to see. Like this:
Please try to give your feature request a good title. Try using a brief description of what you'd like to see.
Like this:
- `Add the ability to easily swap an OnCall shift with one of my teammates` or
- `Within Slack, push a button and magically fix my alert`
- type: markdown
attributes:
value: |
**HINT:** Have you tried [searching](https://github.com/grafana/oncall/issues?q=is%3Aopen+is%3Aissue+label%3A%22feature+request%22) for similar feature requests? Duplicate requests are common.
value: >
**HINT:** Have you tried
[searching](https://github.com/grafana/oncall/issues?q=is%3Aopen+is%3Aissue+label%3A%22feature+request%22) for
similar feature requests? Duplicate requests are common.
- type: textarea
id: feature-describe
attributes:

View file

@ -1,6 +1,6 @@
name: Helm Release
on:
"on":
push:
branches:
- main

View file

@ -1,6 +1,6 @@
name: Create PR to release updated oncall Helm chart
on:
"on":
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
@ -22,11 +22,11 @@ jobs:
- name: Update oncall Helm chart Chart.yaml
uses: fjogeleit/yaml-update-action@v0.12.3
with:
valueFile: 'helm/oncall/Chart.yaml'
valueFile: "helm/oncall/Chart.yaml"
branch: helm-release/${{ steps.tags.outputs.helm_version }}
targetBranch: main
masterBranchName: main
createPR: 'true'
createPR: "true"
description: "Merge this PR to `main` branch to start another
[github actions job](https://github.com/grafana/oncall/blob/dev/.github/workflows/helm_release.yml)
that will release the updated version of the chart
@ -34,7 +34,7 @@ jobs:
into `grafana/helm-charts` helm repository. \n\n
This PR was created automatically by this
[github action](https://github.com/grafana/oncall/blob/dev/.github/workflows/helm_release_pr.yml)."
message: 'Release oncall Helm chart ${{ steps.tags.outputs.helm_version }}'
message: "Release oncall Helm chart ${{ steps.tags.outputs.helm_version }}"
changes: |
{
"version": "${{ steps.tags.outputs.helm_version }}",

View file

@ -1,5 +1,5 @@
name: Run commands when issues are labeled
on:
"on":
issues:
types: [labeled]
pull_request:

View file

@ -1,6 +1,6 @@
name: Linting and Unit/e2e Tests
on:
"on":
push:
branches:
- main
@ -83,8 +83,12 @@ jobs:
# -e HUGO_REFLINKSERRORLEVEL=ERROR prevents merging broken refs with the downside
# that no refs to external content can be used as these refs will not resolve in the
# docs-base image.
run: |
docker run -v ${PWD}/docs/sources:/hugo/content/docs/oncall/latest -e HUGO_REFLINKSERRORLEVEL=ERROR --rm grafana/docs-base:latest /bin/bash -c 'echo -e "---\\nredirectURL: /hugo/content/docs/oncall/latest/\\ntype: redirect\\nversioned: true\\n---\\n" > /hugo/content/docs/oncall/_index.md; make hugo'
run: >
docker run -v ${PWD}/docs/sources:/hugo/content/docs/oncall/latest
-e HUGO_REFLINKSERRORLEVEL=ERROR
--rm grafana/docs-base:latest /bin/bash
-c 'echo -e "---\\nredirectURL: /hugo/content/docs/oncall/latest/\\ntype: redirect\\nversioned: true\\n---\\n"
> /hugo/content/docs/oncall/_index.md; make hugo'
lint-migrations-backend-mysql-rabbitmq:
name: "Lint database migrations"
@ -390,7 +394,8 @@ jobs:
# spin up 3 engine and 3 celery pods, this will allow us to parralelize the integration tests,
# and complete them much faster by using multiple test processes
# With just 1 engine/celery/grafana pod, the backend crawls to a halt when there is > 1 parallelized integration test process
# With just 1 engine/celery/grafana pod, the backend crawls to a halt when there is > 1 parallelized
# integration test process
# NOTE: it appears that using > 1 grafana container w/ SQLite as the database sometimes leads to failed
# grafana database migrations (this is documented in this GitHub issue
# https://github.com/bitnami/charts/issues/10905)
@ -400,6 +405,7 @@ jobs:
# the /oncall-plugin hostPath refers to the kind volumeMount that points to the ./grafana-plugin dir
# see ./helm/kind.yml for more details
- name: Install helm chart
# yamllint disable rule:line-length
run: |
helm install helm-testing \
--values ./helm/simple.yml \
@ -421,13 +427,16 @@ jobs:
--set-json "grafana.plugins=[]" \
--set-json 'grafana.extraVolumeMounts=[{"name":"plugins","mountPath":"/var/lib/grafana/plugins/grafana-plugin","hostPath":"/oncall-plugin","readOnly":true}]' \
./helm/oncall
# yamllint enable rule:line-length
# helpful reference for properly caching the playwright binaries/dependencies
# https://playwrightsolutions.com/playwright-github-action-to-cache-the-browser-binaries/
- name: Get installed Playwright version
id: playwright-version
working-directory: grafana-plugin
run: echo "PLAYWRIGHT_VERSION=$(cat ./package.json | jq -r '.devDependencies["@playwright/test"]')" >> $GITHUB_ENV
run: >
echo "PLAYWRIGHT_VERSION=$(cat ./package.json |
jq -r '.devDependencies["@playwright/test"]')" >> $GITHUB_ENV
- name: Cache Playwright binaries/dependencies
id: playwright-cache
@ -488,7 +497,8 @@ jobs:
uses: jupyterhub/action-k8s-namespace-report@v1
if: failure()
with:
important-workloads: "deploy/helm-testing-oncall-engine deploy/helm-testing-oncall-celery deploy/helm-testing-grafana"
important-workloads: >
deploy/helm-testing-oncall-engine deploy/helm-testing-oncall-celery deploy/helm-testing-grafana
- uses: actions/upload-artifact@v3
if: failure()

View file

@ -1,6 +1,6 @@
name: On issue creation
on:
"on":
issues:
types:
- opened
@ -35,15 +35,19 @@ jobs:
uses: peter-evans/create-or-update-comment@5f728c3dae25f329afbe34ee4d08eef25569d79f
with:
issue-number: ${{ github.event.issue.number }}
body: |
The current version of Grafana OnCall, at the time this issue was opened, is ${{ steps.get-latest-tag.outputs.tag }}. If your issue pertains to an older version of Grafana OnCall, please be sure to list it in the PR description. Thank you :smile:!
body: >
The current version of Grafana OnCall, at the time this issue was opened,
is ${{ steps.get-latest-tag.outputs.tag }}. If your issue pertains to an older version of Grafana OnCall,
please be sure to list it in the PR description. Thank you :smile:!
map-selected-product-areas-to-labels-and-assignees:
name: Map selected product areas to labels and assignees
runs-on: ubuntu-latest
# try to avoid running this job for an issue that is created via a tasklist
# only run it for issues created via the bug or feature request issue templates
if: contains(github.event.issue.labels.*.name, 'bug') || contains(github.event.issue.labels.*.name, 'feature request')
if: >
contains(github.event.issue.labels.*.name, 'bug') ||
contains(github.event.issue.labels.*.name, 'feature request')
permissions:
issues: write
steps:
@ -69,6 +73,7 @@ jobs:
# github actions have a weird ternary operator, see below for more details
# https://docs.github.com/en/actions/learn-github-actions/expressions#literals:~:text=GitHub%20offers%20ternary%20operator%20like%20behaviour%20that%20you%20can%20use%20in%20expressions
with:
# yamllint disable rule:line-length
labels: |
${{ contains(steps.issue-form-values.outputs.issueparser_product_area, 'Alert Flow & Configuration') && 'part:alert flow & configuration' || '' }}
${{ contains(steps.issue-form-values.outputs.issueparser_product_area, 'Auth') && 'part:auth/teams' || '' }}
@ -78,3 +83,4 @@ jobs:
${{ contains(steps.issue-form-values.outputs.issueparser_product_area, 'Schedules') && 'part:schedules' || '' }}
${{ contains(steps.issue-form-values.outputs.issueparser_product_area, 'Terraform') && 'part:API/Terraform' || '' }}
${{ contains(steps.issue-form-values.outputs.issueparser_product_area, 'Other') && 'no info or need to discuss' || '' }}
# yamllint enable rule:line-length

View file

@ -1,6 +1,6 @@
name: "Publish Technical Documentation (next)"
on:
"on":
push:
branches:
- "main"
@ -17,8 +17,12 @@ jobs:
# -e HUGO_REFLINKSERRORLEVEL=ERROR prevents merging broken refs with the downside
# that no refs to external content can be used as these refs will not resolve in the
# docs-base image.
run: |
docker run -v ${PWD}/docs/sources:/hugo/content/docs/oncall/latest -e HUGO_REFLINKSERRORLEVEL=ERROR --rm grafana/docs-base:latest /bin/bash -c 'echo -e "---\\nredirectURL: /hugo/content/docs/oncall/latest/\\ntype: redirect\\nversioned: true\\n---\\n" > /hugo/content/docs/oncall/_index.md; make hugo'
run: >
docker run -v ${PWD}/docs/sources:/hugo/content/docs/oncall/latest
-e HUGO_REFLINKSERRORLEVEL=ERROR
--rm grafana/docs-base:latest /bin/bash
-c 'echo -e "---\\nredirectURL: /hugo/content/docs/oncall/latest/\\ntype: redirect\\nversioned: true\\n---\\n"
> /hugo/content/docs/oncall/_index.md; make hugo'
sync:
runs-on: "ubuntu-latest"
@ -32,7 +36,10 @@ jobs:
# It must be regenerated in the grafanabot GitHub account and requires a Grafana organization
# GitHub administrator to update the organization secret.
# The IT helpdesk can update the organization secret.
run: "git clone --single-branch --no-tags --depth 1 -b master https://grafanabot:${{ secrets.WEBSITE_SYNC_TOKEN }}@github.com/grafana/website-sync ./.github/actions/website-sync"
run: >
git clone --single-branch --no-tags --depth 1
-b master https://grafanabot:${{ secrets.WEBSITE_SYNC_TOKEN }}@github.com/grafana/website-sync
./.github/actions/website-sync
- name: "Publish to website repository (next)"
uses: "./.github/actions/website-sync"

View file

@ -1,6 +1,6 @@
name: "Publish Technical Documentation (release)"
on:
"on":
push:
branches:
- "release-*"
@ -15,13 +15,16 @@ jobs:
steps:
- name: "Check out code"
uses: "actions/checkout@v3"
- name:
"Build website"
- name: "Build website"
# -e HUGO_REFLINKSERRORLEVEL=ERROR prevents merging broken refs with the downside
# that no refs to external content can be used as these refs will not resolve in the
# docs-base image.
run: |
docker run -v ${PWD}/docs/sources:/hugo/content/docs/oncall/latest -e HUGO_REFLINKSERRORLEVEL=ERROR --rm grafana/docs-base:latest /bin/bash -c 'echo -e "---\\nredirectURL: /hugo/content/docs/oncall/latest/\\ntype: redirect\\nversioned: true\\n---\\n" > /hugo/content/docs/oncall/_index.md; make hugo'
run: >
docker run -v ${PWD}/docs/sources:/hugo/content/docs/oncall/latest
-e HUGO_REFLINKSERRORLEVEL=ERROR
--rm grafana/docs-base:latest /bin/bash
-c 'echo -e "---\\nredirectURL: /hugo/content/docs/oncall/latest/\\ntype: redirect\\nversioned: true\\n---\\n"
> /hugo/content/docs/oncall/_index.md; make hugo'
sync:
runs-on: "ubuntu-latest"
@ -62,7 +65,10 @@ jobs:
# It must be regenerated in the grafanabot GitHub account and requires a Grafana organization
# GitHub administrator to update the organization secret.
# The IT helpdesk can update the organization secret.
run: "git clone --single-branch --no-tags --depth 1 -b master https://grafanabot:${{ secrets.WEBSITE_SYNC_TOKEN }}@github.com/grafana/website-sync ./.github/actions/website-sync"
run: >
git clone --single-branch --no-tags --depth 1
-b master https://grafanabot:${{ secrets.WEBSITE_SYNC_TOKEN }}@github.com/grafana/website-sync
./.github/actions/website-sync"
- name: "Publish to website repository (release)"
if: "steps.has-matching-release-tag.outputs.bool == 'true'"

View file

@ -1,6 +1,6 @@
name: snyk
on:
"on":
push:
branches: [main, dev]
pull_request:

View file

@ -1,5 +1,5 @@
name: "Triage stale pull requests"
on:
"on":
schedule:
- cron: "30 1 * * *"
@ -18,6 +18,10 @@ jobs:
ascending: true # start processing older pull requests first
stale-pr-label: "pr:stale"
stale-pr-message: >
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!
This pull request has been automatically marked as stale because it has not had activity in the last
30 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status
update now, ping for review, or re-open when it's ready. Thank you for your contributions!
close-pr-message: >
This pull request has been automatically closed because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!
This pull request has been automatically closed because it has not had activity in the last 30 days.
Please feel free to give a status update now, ping for review, or re-open when it's ready.
Thank you for your contributions!

View file

@ -1,7 +1,7 @@
name: Update `make docs` procedure
on:
"on":
schedule:
- cron: '0 7 * * 1-5'
- cron: "0 7 * * 1-5"
jobs:
main:
runs-on: ubuntu-latest

View file

@ -1,6 +1,6 @@
name: Verify CHANGELOG updated
on:
"on":
pull_request:
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
branches:

View file

@ -1,6 +1,6 @@
name: Verify public documentation updated
on:
"on":
pull_request:
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
branches:

View file

@ -41,21 +41,13 @@ repos:
files: ^tools/pagerduty-migrator
# Make sure config is compatible with black
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
args:
[
"--max-line-length=88",
"--extend-ignore=E203,E501",
]
args: ["--max-line-length=88", "--extend-ignore=E203,E501"]
- id: flake8
name: flake8 - dev/scripts
files: ^dev/scripts
# Make sure config is compatible with black
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
args:
[
"--max-line-length=88",
"--extend-ignore=E203,E501",
]
args: ["--max-line-length=88", "--extend-ignore=E203,E501"]
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.25.0
@ -103,7 +95,16 @@ repos:
hooks:
- id: markdownlint
name: markdownlint
entry: markdownlint --fix --ignore grafana-plugin/node_modules --ignore grafana-plugin/dist --ignore docs **/*.md
entry: >
markdownlint --fix --ignore grafana-plugin/node_modules --ignore grafana-plugin/dist --ignore docs **/*.md
- id: markdownlint
name: markdownlint - docs/sources
entry: markdownlint --fix --ignore README.md -c ./docs/.markdownlint.json ./docs/sources/**/*.md
- repo: https://github.com/adrienverge/yamllint
rev: v1.32.0
hooks:
- id: yamllint
name: yamllint
entry: yamllint -c .yamllint.yml
types: [yaml]

13
.yamllint.yml Normal file
View file

@ -0,0 +1,13 @@
extends: default
ignore: |
helm/oncall/templates/**/*.yaml
rules:
line-length:
max: 120
comments:
min-spaces-from-content: 1
document-start: disable

View file

@ -208,7 +208,9 @@ services:
container_name: mysql
labels: *oncall-labels
image: mysql:8.0.32
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max_connections=1024
command: >
--default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci --max_connections=1024
restart: always
environment:
MYSQL_ROOT_PASSWORD: empty
@ -234,7 +236,9 @@ services:
container_name: mysql_to_create_grafana_db
labels: *oncall-labels
image: mysql:8.0.32
command: bash -c "mysql -h mysql -uroot -pempty -e 'CREATE DATABASE IF NOT EXISTS grafana CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'"
command: >
bash -c "mysql -h mysql -uroot -pempty
-e 'CREATE DATABASE IF NOT EXISTS grafana CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'"
depends_on:
mysql:
condition: service_healthy
@ -272,7 +276,10 @@ services:
container_name: postgres_to_create_grafana_db
labels: *oncall-labels
image: postgres:14.4
command: bash -c "PGPASSWORD=empty psql -U postgres -h postgres -tc \"SELECT 1 FROM pg_database WHERE datname = 'grafana'\" | grep -q 1 || PGPASSWORD=empty psql -U postgres -h postgres -c \"CREATE DATABASE grafana\""
command: >
bash -c "PGPASSWORD=empty psql -U postgres
-h postgres -tc \"SELECT 1 FROM pg_database WHERE datname = 'grafana'\" | grep -q 1 || PGPASSWORD=empty psql
-U postgres -h postgres -c \"CREATE DATABASE grafana\""
depends_on:
postgres:
condition: service_healthy

View file

@ -68,7 +68,9 @@ services:
mysql:
image: mysql:8.0.32
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
command: >
--default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: always
expose:
- 3306
@ -121,7 +123,9 @@ services:
mysql_to_create_grafana_db:
image: mysql:8.0.32
command: bash -c "mysql -h ${MYSQL_HOST:-mysql} -uroot -p${MYSQL_PASSWORD:?err} -e 'CREATE DATABASE IF NOT EXISTS grafana CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'"
command: >
bash -c "mysql -h ${MYSQL_HOST:-mysql} -uroot -p${MYSQL_PASSWORD:?err}
-e 'CREATE DATABASE IF NOT EXISTS grafana CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'"
depends_on:
mysql:
condition: service_healthy

View file

@ -33,7 +33,9 @@ tests:
some-annotation: some-value
other-annotation: other-value
- it: migrate.useHook=true and annotations set -> should contain the custom annotations and the "helm.sh/hook" annotation
- it: >
migrate.useHook=true and annotations set -> should contain the custom annotations
and the "helm.sh/hook" annotation
set:
migrate.useHook: true
migrate.annotations:

View file

@ -14,7 +14,8 @@ tests:
externalPostgresql.host: some-postgres-host
asserts:
- failedTemplate:
errorMessage: externalPostgresql.password is required if not postgresql.enabled and not externalPostgresql.existingSecret
errorMessage: >-
externalPostgresql.password is required if not postgresql.enabled and not externalPostgresql.existingSecret
template: secrets.yaml
- it: externalPostgresql.password -> should create a Secret -postgresql-external

View file

@ -122,7 +122,8 @@ tests:
rabbitmq.enabled: false
asserts:
- failedTemplate:
errorMessage: externalRabbitmq.password is required if not rabbitmq.enabled and not externalRabbitmq.existingSecret
errorMessage: >
externalRabbitmq.password is required if not rabbitmq.enabled and not externalRabbitmq.existingSecret
template: secrets.yaml
- it: rabbitmq.enabled=false -> should use internal custom values

View file

@ -29,7 +29,8 @@ service:
# Engine pods configuration
engine:
replicaCount: 1
resources: {}
resources:
{}
# limits:
# cpu: 100m
# memory: 128Mi
@ -93,7 +94,8 @@ celery:
initialDelaySeconds: 30
periodSeconds: 300
timeoutSeconds: 10
resources: {}
resources:
{}
# limits:
# cpu: 100m
# memory: 128Mi
@ -194,7 +196,8 @@ oncall:
accountSid: ""
# Twilio password to allow OnCall to send SMSes and make calls
authToken: ""
# Number from which you will receive calls and SMS (NOTE: must be quoted, otherwise would be rendered as float value)
# Number from which you will receive calls and SMS
# (NOTE: must be quoted, otherwise would be rendered as float value)
phoneNumber: ""
# SID of Twilio service for number verification. You can create a service in Twilio web interface.
# twilio.com -> verify -> create new service
@ -251,7 +254,8 @@ migrate:
# - --port=5432
# - example:europe-west3:grafana-oncall-db
# Sets environment variables with name capitalized and prefixed with UWSGI_, and dashes are substituted with underscores.
# Sets environment variables with name capitalized and prefixed with UWSGI_,
# and dashes are substituted with underscores.
# see more: https://uwsgi-docs.readthedocs.io/en/latest/Configuration.html#environment-variables
# Set null to disable all UWSGI environment variables
uwsgi:
@ -446,10 +450,12 @@ serviceAccount:
podAnnotations: {}
podSecurityContext: {}
podSecurityContext:
{}
# fsGroup: 2000
securityContext: {}
securityContext:
{}
# capabilities:
# drop:
# - ALL
@ -458,7 +464,8 @@ securityContext: {}
# runAsUser: 1000
init:
securityContext: {}
securityContext:
{}
# allowPrivilegeEscalation: false
# capabilities:
# drop:
@ -468,7 +475,8 @@ init:
# runAsGroup: 1337
# runAsNonRoot: true
# runAsUser: 1337
resources: {}
resources:
{}
# limits:
# cpu: 100m
# memory: 128Mi