Skip to content

Commit

Permalink
Merge branch 'main' into fix/json-exporter-scrapetimeout
Browse files Browse the repository at this point in the history
Signed-off-by: MH <[email protected]>
  • Loading branch information
zanhsieh authored Feb 2, 2025
2 parents be0f527 + 3eb061f commit 57618d8
Show file tree
Hide file tree
Showing 275 changed files with 7,375 additions and 1,796 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
root = true

[*.sh]
indent_style = space
indent_size = 2
15 changes: 8 additions & 7 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
# See https://github.com/scottrigby/prometheus-helm-charts/issues/12
# See https://github.com/prometheus-community/helm-charts/issues/12
# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax

# The repo admins team will be the default owners for everything in the repo.
# Unless a later match takes precedence, they will be requested for review when someone opens a pull request.
* @prometheus-community/helm-charts-admins

/.github/workflows/ @prometheus-community/helm-charts-admins @jkroepke @GMartinez-Sisti
/renovate.json @prometheus-community/helm-charts-admins @jkroepke @GMartinez-Sisti
/.github/workflows/ @prometheus-community/helm-charts-admins @GMartinez-Sisti
/renovate.json @prometheus-community/helm-charts-admins @GMartinez-Sisti

/charts/alertmanager/ @monotek @naseemkullah
/charts/alertmanager-snmp-notifier/ @maxwo
/charts/alertmanager/ @monotek @naseemkullah
/charts/jiralert/ @jkroepke @zanhsieh
/charts/kube-prometheus-stack/ @andrewgkew @gianrubio @gkarthiks @GMartinez-Sisti @jkroepke @QuentinBisson @scottrigby @Xtigyro
/charts/kube-prometheus-stack/ @GMartinez-Sisti @QuentinBisson @Xtigyro @andrewgkew @gianrubio @gkarthiks @jkroepke @scottrigby
/charts/kube-state-metrics/ @dotdc @mrueg @tariq1890
/charts/prom-label-proxy/ @jkroepke
/charts/prometheus/ @gianrubio @naseemkullah @Xtigyro @zanhsieh @zeritti
/charts/prometheus-adapter/ @hectorj2f @mattiasgees @steven-sheehy
/charts/prometheus-blackbox-exporter/ @desaintmartin @gianrubio @monotek @rsotnychenko
/charts/prometheus-cloudwatch-exporter/ @asherf @gianrubio @torstenwalter
Expand All @@ -37,7 +36,7 @@
/charts/prometheus-node-exporter/ @gianrubio @zanhsieh @zeritti
/charts/prometheus-opencost-exporter/ @mattray
/charts/prometheus-operator-admission-webhook/ @zeritti
/charts/prometheus-operator-crds/ @dacamposol @desaintmartin @jkroepke @QuentinBisson
/charts/prometheus-operator-crds/ @QuentinBisson @dacamposol @desaintmartin @jkroepke
/charts/prometheus-pgbouncer-exporter/ @stewartshea @zeritti
/charts/prometheus-pingdom-exporter/ @monotek @rpahli
/charts/prometheus-pingmesh-exporter/ @dongjiang1989
Expand All @@ -53,3 +52,5 @@
/charts/prometheus-systemd-exporter/ @capuche2412 @maxime1907
/charts/prometheus-to-sd/ @acondrat
/charts/prometheus-windows-exporter/ @jkroepke
/charts/prometheus-yet-another-cloudwatch-exporter/ @cristiangreco @thomaspeitz
/charts/prometheus/ @Xtigyro @gianrubio @naseemkullah @zanhsieh @zeritti
15 changes: 8 additions & 7 deletions .github/linters/ct.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# See https://github.com/helm/chart-testing#configuration
remote: origin
target-branch: main
additional-commands:
- sh -ec "if [ -f '{{ .Path }}/ci/lint.sh' ]; then shellcheck '{{ .Path }}/ci/lint.sh'; bash '{{ .Path }}/ci/lint.sh'; fi"
# - helm unittest --helm3 --strict --file unittests/*.yaml --file 'unittests/**/*.yaml' {{ .Path }}
chart-dirs:
- charts
chart-repos:
- bitnami=https://charts.bitnami.com/bitnami
- grafana=https://grafana.github.io/helm-charts
- prometheus-community=https://prometheus-community.github.io/helm-charts
github-groups: true
helm-extra-args: --timeout 600s
excluded-charts:
# If not running on GCE, will error: "Failed to get GCE config"
- prometheus-to-sd
additional-commands:
- sh -ec "if [ -f '{{ .Path }}/ci/lint.sh' ]; then shellcheck '{{ .Path }}/ci/lint.sh'; bash '{{ .Path }}/ci/lint.sh'; fi"
# - helm unittest --helm3 --strict --file unittests/*.yaml --file 'unittests/**/*.yaml' {{ .Path }}
github-groups: true
helm-extra-args: --timeout 600s
remote: origin
target-branch: main
validate-maintainers: false
9 changes: 6 additions & 3 deletions .github/workflows/check-codeowners.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
name: Check CODEOWNERS
permissions: {}

on: pull_request
jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: generate CODEOWNERS
run: |
./scripts/check-codeowners.sh > .github/CODEOWNERS
./scripts/check-codeowners.sh | tee .github/CODEOWNERS
- name: check CODEOWNERS for modifications
run: |
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
name: Lint and Test Charts
permissions: {}

on: pull_request

jobs:
lint-test:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v4
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
version: v3.12.0

- uses: actions/setup-python@v5
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.7'
python-version: '3.11'

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # v2.7.0

- name: Run chart-testing (list-changed)
id: list-changed
Expand All @@ -42,7 +45,7 @@ jobs:
run: ct lint --config .github/linters/ct.yaml

- name: Create kind cluster
uses: helm/kind-action@v1.10.0
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
if: steps.list-changed.outputs.changed == 'true'

- name: Apply Gateway API CRDs
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Release Charts
permissions: {}

on:
push:
Expand All @@ -12,10 +13,10 @@ jobs:
packages: write # needed for ghcr access
id-token: write # needed for keyless signing

runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Fetch history
run: git fetch --prune --unshallow
Expand All @@ -26,7 +27,7 @@ jobs:
git config user.email "[email protected]"
- name: Set up Helm
uses: azure/setup-helm@v4
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
version: v3.12.0

Expand All @@ -37,14 +38,16 @@ jobs:
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
- name: Run chart-releaser
uses: helm/[email protected]
uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0
with:
skip_existing: true
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_GENERATE_RELEASE_NOTES: true

# see https://github.com/helm/chart-releaser/issues/183
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/renovate-bump-chart-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Renovate Bump Chart Version

on:
pull_request:
branches:
- main
paths:
- 'charts/**/*'

jobs:
renovate-bump-chart-version:
name: Renovate Bump Chart Version
runs-on: ubuntu-latest
if: github.actor == 'renovate[bot]'
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.11'

- name: Set up chart-testing
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # v2.7.0

- name: Detect changed charts
id: list-changed
run: |
changed="$(ct list-changed --config .github/linters/ct.yaml)"
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "changed_list=${changed//$'\n'/ }" >> "$GITHUB_OUTPUT"
fi
- name: Bump chart version
if: steps.list-changed.outputs.changed == 'true'
env:
CHART: ${{ steps.list-changed.outputs.changed_list }}
run: |
if [[ $CHANGED_LIST == *" "* ]]; then
echo "Multiple charts changed, skipping bumping chart version"
exit 0
fi
CHART_VERSION=$(grep -e "^version:" "$CHART/Chart.yaml" | cut -d ":" -f 2 | tr -d '[:space:]' | tr -d '"')
CHART_MAJOR_VERSION=$(printf '%s' "$CHART_VERSION" | cut -d "." -f 1)
CHART_MINOR_VERSION=$(printf '%s' "$CHART_VERSION" | cut -d "." -f 2)
CHART_MINOR_VERSION=$((CHART_MINOR_VERSION+1))
CHART_NEW_VERSION="${CHART_MAJOR_VERSION}.${CHART_MINOR_VERSION}.0"
sed -i "s/^version:.*/version: \"${CHART_NEW_VERSION}\"/" "$CHART/Chart.yaml"
- name: Commit changes
if: steps.list-changed.outputs.changed == 'true'
env:
CHART: ${{ steps.list-changed.outputs.changed_list }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_HEAD_REF: ${{ github.head_ref }}
run: |
curl https://api.github.com/graphql -f \
-sSf -H "Authorization: Bearer $GITHUB_TOKEN" \
--data @- <<GRAPHQL | jq
{
"query": "mutation (\$input: CreateCommitOnBranchInput!) {
createCommitOnBranch(input: \$input) {
commit {
url
}
}
}",
"variables": {
"input": {
"branch": {
"repositoryNameWithOwner": "${{ github.repository }}",
"branchName": "$GITHUB_HEAD_REF"
},
"message": { "headline": "Update Chart.yaml" },
"fileChanges": {
"additions": [
{
"path": "$CHART/Chart.yaml",
"contents": "$(base64 -w 0 <"$CHART/Chart.yaml")"
}
]
},
"expectedHeadOid": "${{ github.sha }}"
}
}
}
GRAPHQL
32 changes: 21 additions & 11 deletions .github/workflows/superlinter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Lint Code Base
permissions: {}

# Documentation:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
Expand All @@ -8,24 +9,33 @@ on: pull_request
jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Lint Code Base
uses: docker://github/super-linter:slim-v4
uses: super-linter/super-linter/slim@v7.2.1
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LINTER_RULES_PATH: .github/linters
MULTI_STATUS: false
VALIDATE_ALL_CODEBASE: false
VALIDATE_BASH: false
VALIDATE_JSCPD: false
VALIDATE_KUBERNETES_KUBEVAL: false
VALIDATE_PYTHON: false
VALIDATE_PYTHON_FLAKE8: false
VALIDATE_PYTHON_BLACK: false
VALIDATE_YAML: false
VALIDATE_BASH: true
VALIDATE_BASH_EXEC: true
# VALIDATE_CHECKOV: true - always scans everything and all charts have too much errors
VALIDATE_EDITORCONFIG: true
VALIDATE_ENV: true
VALIDATE_GITHUB_ACTIONS: true
VALIDATE_GITLEAKS: true
VALIDATE_JSON: true
VALIDATE_MARKDOWN: true
VALIDATE_NATURAL_LANGUAGE: true
VALIDATE_PYTHON: true
VALIDATE_RENOVATE: true
VALIDATE_SHELL_SHFMT: true
VALIDATE_XML: true
8 changes: 5 additions & 3 deletions .github/workflows/sync-readme.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
permissions: {}

on:
push:
branches:
Expand All @@ -10,12 +12,12 @@ jobs:
permissions:
contents: write # for git push

runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: |
cp -f README.md ${{ runner.temp }}/README.md
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: gh-pages
- run: |
Expand Down
12 changes: 11 additions & 1 deletion PROCESSES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ The pull request which does that should also update [CODEOWNERS](./.github/CODEO
One of the existing chart maintainers needs to approve the PR in addition one of the repository admins needs to approve it.
They are then responsible for also granting the new maintainer write permissions to this repository.

Each maintainer has defined in the Chart.yaml of the chart itself unter the maintainer section,
using the following format:

```yaml
maintainers:
- name: # A freely chosen display name. Required.
email: # A contact mail. Optional
url: # The URL of the GitHub profile, using the format https://github.com/<username>. Required.
```
## GitHub Settings
As not everyone is able to see which settings are configured for this repository these are also documented here.
Expand Down Expand Up @@ -84,7 +94,7 @@ The `main` branch is protected and the following settings are configured:

[Developer Certificate of Origin](https://developercertificate.org/) (DCO) check is performed by [DCO GitHub App](https://github.com/apps/dco)

- Lint Code Base
- Lint codebase

Linting is done using [Super-Linter](https://github.com/github/super-linter).
It is configured in [linter.yaml](.github/workflows/linter.yml)
Expand Down
Loading

0 comments on commit 57618d8

Please sign in to comment.