diff --git a/.drone.yml b/.drone.yml index c900716b..8b49c117 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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 ... diff --git a/.github/ISSUE_TEMPLATE/0-bug-report-template.yml b/.github/ISSUE_TEMPLATE/0-bug-report-template.yml index aab0601a..9cf697cc 100644 --- a/.github/ISSUE_TEMPLATE/0-bug-report-template.yml +++ b/.github/ISSUE_TEMPLATE/0-bug-report-template.yml @@ -14,24 +14,25 @@ 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: | **What happened**: - - + - **What did you expect to happen**: - - + - validations: required: true - type: textarea @@ -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 diff --git a/.github/ISSUE_TEMPLATE/1-feature-request-template.yml b/.github/ISSUE_TEMPLATE/1-feature-request-template.yml index 0618d7cc..c33f3009 100644 --- a/.github/ISSUE_TEMPLATE/1-feature-request-template.yml +++ b/.github/ISSUE_TEMPLATE/1-feature-request-template.yml @@ -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: diff --git a/.github/workflows/helm_release.yml b/.github/workflows/helm_release.yml index d9fafeab..63aa4104 100644 --- a/.github/workflows/helm_release.yml +++ b/.github/workflows/helm_release.yml @@ -1,6 +1,6 @@ name: Helm Release -on: +"on": push: branches: - main diff --git a/.github/workflows/helm_release_pr.yml b/.github/workflows/helm_release_pr.yml index 97558d72..f184b786 100644 --- a/.github/workflows/helm_release_pr.yml +++ b/.github/workflows/helm_release_pr.yml @@ -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,19 +22,19 @@ 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' - 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 - (version: ${{ steps.tags.outputs.helm_version }}, appVersion: ${{ steps.tags.outputs.app_version }}) + 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 + (version: ${{ steps.tags.outputs.helm_version }}, appVersion: ${{ steps.tags.outputs.app_version }}) into `grafana/helm-charts` helm repository. \n\n - This PR was created automatically by this + 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 }}", diff --git a/.github/workflows/issue_commands.yml b/.github/workflows/issue_commands.yml index 6187ea56..077bdb0d 100644 --- a/.github/workflows/issue_commands.yml +++ b/.github/workflows/issue_commands.yml @@ -1,5 +1,5 @@ name: Run commands when issues are labeled -on: +"on": issues: types: [labeled] pull_request: diff --git a/.github/workflows/linting-and-tests.yml b/.github/workflows/linting-and-tests.yml index 777634c6..20886477 100644 --- a/.github/workflows/linting-and-tests.yml +++ b/.github/workflows/linting-and-tests.yml @@ -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() diff --git a/.github/workflows/on-issue-creation.yml b/.github/workflows/on-issue-creation.yml index a196eb0f..e39929b5 100644 --- a/.github/workflows/on-issue-creation.yml +++ b/.github/workflows/on-issue-creation.yml @@ -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 diff --git a/.github/workflows/publish-technical-documentation-next.yml b/.github/workflows/publish-technical-documentation-next.yml index 3de57668..44c36199 100644 --- a/.github/workflows/publish-technical-documentation-next.yml +++ b/.github/workflows/publish-technical-documentation-next.yml @@ -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" diff --git a/.github/workflows/publish-technical-documentation-release.yml b/.github/workflows/publish-technical-documentation-release.yml index 7a5f7c89..727488a8 100644 --- a/.github/workflows/publish-technical-documentation-release.yml +++ b/.github/workflows/publish-technical-documentation-release.yml @@ -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'" diff --git a/.github/workflows/snyk.yml b/.github/workflows/snyk.yml index 85401059..9d3ab192 100644 --- a/.github/workflows/snyk.yml +++ b/.github/workflows/snyk.yml @@ -1,6 +1,6 @@ name: snyk -on: +"on": push: branches: [main, dev] pull_request: diff --git a/.github/workflows/triage-stale-pull-requests.yml b/.github/workflows/triage-stale-pull-requests.yml index 15d7b723..e85f9623 100644 --- a/.github/workflows/triage-stale-pull-requests.yml +++ b/.github/workflows/triage-stale-pull-requests.yml @@ -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! diff --git a/.github/workflows/update-make-docs.yml b/.github/workflows/update-make-docs.yml index 57d60d47..451f24dc 100644 --- a/.github/workflows/update-make-docs.yml +++ b/.github/workflows/update-make-docs.yml @@ -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 diff --git a/.github/workflows/verify-changelog-updated.yml b/.github/workflows/verify-changelog-updated.yml index 3b92afc6..f74c42c3 100644 --- a/.github/workflows/verify-changelog-updated.yml +++ b/.github/workflows/verify-changelog-updated.yml @@ -1,6 +1,6 @@ name: Verify CHANGELOG updated -on: +"on": pull_request: types: [assigned, opened, synchronize, reopened, labeled, unlabeled] branches: diff --git a/.github/workflows/verify-public-docs-updated.yml b/.github/workflows/verify-public-docs-updated.yml index 63a5f865..ece561e7 100644 --- a/.github/workflows/verify-public-docs-updated.yml +++ b/.github/workflows/verify-public-docs-updated.yml @@ -1,6 +1,6 @@ name: Verify public documentation updated -on: +"on": pull_request: types: [assigned, opened, synchronize, reopened, labeled, unlabeled] branches: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 07d10bf6..35353063 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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] diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 00000000..da1db2b4 --- /dev/null +++ b/.yamllint.yml @@ -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 diff --git a/dev/prometheus.yml b/dev/prometheus.yml index 5d1148d4..5b53a77f 100644 --- a/dev/prometheus.yml +++ b/dev/prometheus.yml @@ -1,5 +1,5 @@ global: - scrape_interval: 15s + scrape_interval: 15s evaluation_interval: 15s scrape_configs: diff --git a/docker-compose-developer.yml b/docker-compose-developer.yml index d985604b..ca9adae4 100644 --- a/docker-compose-developer.yml +++ b/docker-compose-developer.yml @@ -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 diff --git a/docker-compose-mysql-rabbitmq.yml b/docker-compose-mysql-rabbitmq.yml index 0fee8cb6..77d972ae 100644 --- a/docker-compose-mysql-rabbitmq.yml +++ b/docker-compose-mysql-rabbitmq.yml @@ -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 diff --git a/helm/cr.yaml b/helm/cr.yaml index 260c5c42..029ea5d5 100644 --- a/helm/cr.yaml +++ b/helm/cr.yaml @@ -1,3 +1,3 @@ git-repo: helm-charts owner: grafana -skip-existing: true \ No newline at end of file +skip-existing: true diff --git a/helm/ct.yaml b/helm/ct.yaml index ac6439b6..2204927e 100644 --- a/helm/ct.yaml +++ b/helm/ct.yaml @@ -9,4 +9,4 @@ chart-repos: - grafana=https://grafana.github.io/helm-charts - ingress-nginx=https://kubernetes.github.io/ingress-nginx helm-extra-args: --timeout 600s -validate-maintainers: false \ No newline at end of file +validate-maintainers: false diff --git a/helm/oncall/tests/migrate_annotations_test.yaml b/helm/oncall/tests/migrate_annotations_test.yaml index 0d4ed7bb..e104bf80 100644 --- a/helm/oncall/tests/migrate_annotations_test.yaml +++ b/helm/oncall/tests/migrate_annotations_test.yaml @@ -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: diff --git a/helm/oncall/tests/postgres_password_env_test.yaml b/helm/oncall/tests/postgres_password_env_test.yaml index e35b1465..96a782f4 100644 --- a/helm/oncall/tests/postgres_password_env_test.yaml +++ b/helm/oncall/tests/postgres_password_env_test.yaml @@ -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 diff --git a/helm/oncall/tests/rabbitmq_env_test.yaml b/helm/oncall/tests/rabbitmq_env_test.yaml index 9fdc6dc6..6e291107 100644 --- a/helm/oncall/tests/rabbitmq_env_test.yaml +++ b/helm/oncall/tests/rabbitmq_env_test.yaml @@ -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 diff --git a/helm/oncall/values.yaml b/helm/oncall/values.yaml index 16228005..7653f73f 100644 --- a/helm/oncall/values.yaml +++ b/helm/oncall/values.yaml @@ -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,10 +475,11 @@ init: # runAsGroup: 1337 # runAsNonRoot: true # runAsUser: 1337 - resources: {} - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi + resources: + {} + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi