Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ahippler authored Jan 21, 2025
2 parents 86e49dc + 46e085d commit 89c5cda
Show file tree
Hide file tree
Showing 70 changed files with 7,558 additions and 4,273 deletions.
47 changes: 14 additions & 33 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,23 @@
<!--
Thank you for contributing!
Before you submit this PR we'd like to make sure you are aware of our technical requirements and best practices:
* https://github.com/jenkinsci/helm-charts/blob/main/CONTRIBUTING.md#technical-requirements
* https://helm.sh/docs/chart_best_practices/
For a quick overview across what we will look at reviewing your PR, please read our review guidelines:
* https://github.com/helm/charts/blob/master/REVIEW_GUIDELINES.md
Following our best practices right from the start will accelerate the review process and help get your PR merged quicker.
When updates to your PR are requested, please add new commits and do not squash the history.
This will make it easier to identify new changes.
The PR will be squashed anyways when it is merged.
Thanks.
<!-- markdownlint-disable MD041 -->

For fast feedback, please @-mention maintainers that are listed in the Chart.yaml file.
### What does this PR do?

Please make sure you test your changes before you push them.
Once pushed, GitHub Actions will run across your changes and do some initial checks and linting.
These checks run very quickly.
Please check the results.
We would like these checks to pass before we even continue reviewing your changes.
<!-- Describe the purpose of this PR, and any background context.
*(optional, add the issue number in `Fixes #<issue number>`, to close that issue when the PR gets merged)*
-->
<!-- markdownlint-disable MD041 -->

### What this PR does / why we need it

### Which issue this PR fixes
- Fixes #

*(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*
If you modified files in the `./charts/jenkins/` directory, please also include the following:

- fixes #
```[tasklist]
### Submitter checklist
- [ ] I bumped the "version" key in `./charts/jenkins/Chart.yaml`.
- [ ] I added a new changelog entry to `./charts/jenkins/CHANGELOG.md`.
- [ ] I followed the [technical requirements](https://github.com/jenkinsci/helm-charts/blob/main/CONTRIBUTING.md#technical-requirements).
- [ ] I ran `.github/helm-docs.sh` from the project root.
```

### Special notes for your reviewer

### Checklist
<!-- [Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.] -->
- [ ] Chart Version bumped
- [ ] CHANGELOG.md was updated
<!-- Leave blank if none -->
6 changes: 0 additions & 6 deletions .github/dependabot.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .github/helm-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -euxo pipefail

# check if helm-docs is installed
if ! command -v helm-docs &>/dev/null; then
echo "helm-docs could not be found. You can install it from https://github.com/norwoodj/helm-docs."
exit
fi

# validate docs
cd charts/jenkins
helm-docs --template-files=VALUES.md.gotmpl --output-file=VALUES.md
11 changes: 11 additions & 0 deletions .github/linters/.textlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"rules": {
"terminology": {
"exclude": [
"Git",
"XML",
"YAML"
]
}
}
}
96 changes: 96 additions & 0 deletions .github/renovate-config.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
onboarding: false,
requireConfig: "ignored",
platform: "github",
repositories: ["jenkinsci/helm-charts"],
// eslint-disable-next-line
allowedPostUpgradeCommands: ['^\.github\/renovate-postupgrade\.sh "{{{depName}}}" "{{{newVersion}}}"$'],
prConcurrentLimit: 0,
prHourlyLimit: 5,
semanticCommits: "enabled",
enabledManagers: [
"helm-values",
"github-actions",
"regex",
],
packageRules: [
{
matchPackageNames: ["jenkins/inbound-agent"],
versioning: "regex:^(?<major>\\d+)?\\.(?<minor>\\w+?)?-(?<build>\\d+)?$",
},
{
matchPackageNames: ["jenkins/jenkins"],
versioning: "regex:^(?<major>\\d+?)\\.(?<minor>\\d+?)\\.(?<patch>\\d+?)(-(?<compatibility>\\w+))?$",
},
{
matchFileNames: ["charts/jenkins/**"],
postUpgradeTasks: {
commands: [
'.github/renovate-postupgrade.sh "{{{depName}}}" "{{{newVersion}}}"',
],
fileFilters: ["charts/jenkins/**"],
executionMode: "branch",
},
},
{
matchPackagePatterns: [".*"],
excludePackagePatterns: ["jenkins/jenkins"],
minimumReleaseAge: "12 hours",
},
],
customDatasources: {
"python_actions": {
defaultRegistryUrlTemplate: "https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json",
transformTemplates: [
"{\"releases\": $$[stable=true].files[arch=\"x64\" and platform=\"linux\"].{\"version\":%.version,\"changelogUrl\":\"https://docs.python.org/whatsnew/index.html\"},\"homepage\":\"https://python.org/\",\"changelogUrl\":\"https://docs.python.org/whatsnew/index.html\"}",
],
},
},
customManagers: [
{
customType: "regex",
fileMatch: ["(^|/)\\.github/workflows/[^/]+\\.ya?ml$", "(^|/)\\.github/[^/]+\\.sh$"],
matchStrings: [
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s+?[\\w\\s-]*?version:? (?<currentValue>.*)\\s",
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s.*?_VERSION=(?<currentValue>.*)\\s",
],
},
{
customType: "regex",
fileMatch: [
"^charts/jenkins/Chart.yaml$",
"^charts/jenkins/values.yaml$",
],
matchStrings: [
"appVersion: (?<currentValue>.*?)\\s",
'repository: \\"jenkins/jenkins\\"\\s*?# tag: \\"(?<currentValue>.*?)\\"',
],
depNameTemplate: "jenkins/jenkins",
datasourceTemplate: "docker",
},
{
customType: "regex",
fileMatch: ["^charts/jenkins/values.yaml$"],
matchStringsStrategy: "recursive",
matchStrings: [
"installPlugins:[\\s\\w:.-]*?(?:\\r*\\n){2}",
"- (?<depName>.*?):(?<currentValue>.*?)\\s",
],
datasourceTemplate: "jenkins-plugins",
versioningTemplate: "regex:^(?<major>\\d+)?\\.(?<minor>\\w+?)?(\\.(?<patch>\\d+?))?$",
},
{
customType: "regex",
fileMatch: ["^charts/jenkins/Chart.yaml$"],
matchStringsStrategy: "recursive",
matchStrings: [
"artifacthub\\.io\\/images: \\|[\\s\\w:.\\/-]*(?:artifacthub)",
"image: (?<depName>.*?):(?<currentValue>.*?)\\s",
],
datasourceTemplate: "docker",
versioningTemplate: "regex:^(?<major>\\d+)?\\.(?<minor>\\w+?)?(_|\\.)(?<patch>\\w+)?(-(?<build>\\d+))?.*",
depNameTemplate: "{{#if (equals depName 'docker.io/jenkins/jenkins')}}jenkins/jenkins{{else}}{{{depName}}}{{/if}}",
},
],
}
42 changes: 42 additions & 0 deletions .github/renovate-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

# renovate: datasource=github-tags depName=mikefarah/yq
export YQ_VERSION=v4.45.1

# renovate: datasource=github-tags depName=helm/helm
export HELM_VERSION=v3.17.0

# renovate: datasource=github-tags depName=helm-unittest/helm-unittest
export HELM_UNITTEST_VERSION=v0.7.1

# renovate: datasource=github-tags depName=jenkins-x-plugins/jx-release-version
export JENKINS_JX_VERSION=v2.7.8

# renovate: datasource=github-releases depName=norwoodj/helm-docs
export HELM_DOCS_VERSION=1.14.2

apt update

apt install -y curl git

curl -fsSL -o /tmp/helm.tar.gz https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz
mkdir -p /tmp/helm && tar -xf /tmp/helm.tar.gz -C /tmp/helm
mv /tmp/helm/linux-amd64/helm /usr/local/bin/helm
chmod a+x /usr/local/bin/helm

runuser -u ubuntu -- helm plugin install https://github.com/helm-unittest/helm-unittest --version ${HELM_UNITTEST_VERSION}

curl -fsSL -o /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64
chmod a+x /usr/local/bin/yq

curl -fsSL -o /tmp/jx-release.tar.gz https://github.com/jenkins-x-plugins/jx-release-version/releases/download/${JENKINS_JX_VERSION}/jx-release-version-linux-amd64.tar.gz
mkdir -p /tmp/jx && tar -xf /tmp/jx-release.tar.gz -C /tmp/jx
mv /tmp/jx/jx-release-version /usr/local/bin/jx-release-version
chmod a+x /usr/local/bin/jx-release-version

curl -fsSL -o /tmp/helm-docs.tar.gz https://github.com/norwoodj/helm-docs/releases/download/v"${HELM_DOCS_VERSION}"/helm-docs_"${HELM_DOCS_VERSION}"_Linux_x86_64.tar.gz
mkdir -p /tmp/helm-docs && tar -xf /tmp/helm-docs.tar.gz -C /tmp/helm-docs
mv /tmp/helm-docs/helm-docs /usr/local/bin/helm-docs
chmod a+x /usr/local/bin/helm-docs

runuser -u ubuntu renovate
12 changes: 12 additions & 0 deletions .github/renovate-postupgrade.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

CHARTVERSION="$(jx-release-version -previous-version=from-file:charts/jenkins/Chart.yaml)"
export CHARTVERSION
depName=$(echo "$1" | tr ' ' '\n' | sort | uniq)
export DEPNAME="$depName"
export NEWVERSION="$2"

helm unittest --strict -f 'unittests/*.yaml' charts/jenkins -u
yq eval '.version = env(CHARTVERSION)' -i charts/jenkins/Chart.yaml
sed -i "/git commit to be able to get more details./a \\\n## ${CHARTVERSION}\n\nUpdate \`${DEPNAME}\` to version \`${NEWVERSION}\`" charts/jenkins/CHANGELOG.md
.github/helm-docs.sh
32 changes: 20 additions & 12 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,46 @@ name: Lint and Test Charts

on: pull_request

permissions:
contents: read

jobs:
lint-test:
runs-on: ubuntu-latest

strategy:
matrix:
kubernetes_version:
- "kindest/node:v1.26.3"
- "kindest/node:v1.25.8"
- "kindest/node:v1.24.12"
- "kindest/node:v1.23.17"
# See https://kubernetes.io/releases/ for EOL dates
- "kindest/node:v1.29.0"
- "kindest/node:v1.28.0"
- "kindest/node:v1.27.2"
- "kindest/node:v1.26.4"
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v3.5
uses: azure/setup-helm@v4
with:
version: v3.11.2
# renovate: datasource=github-tags depName=helm/helm
version: v3.17.0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11.2
# renovate: datasource=custom.python_actions depName=python
python-version: 3.13.1

- name: Set up chart-testing
uses: helm/chart-testing-action@v2
with:
version: v3.8.0
# renovate: datasource=github-tags depName=helm/chart-testing
version: v3.12.0

- name: Run chart-testing (list-changed)
id: list-changed
Expand All @@ -49,13 +56,14 @@ jobs:
if: steps.list-changed.outputs.changed == 'true'
run: |
helm env
helm plugin install https://github.com/quintush/helm-unittest --version 0.2.11
# renovate: datasource=github-tags depName=helm-unittest/helm-unittest
helm plugin install https://github.com/helm-unittest/helm-unittest --version v0.3.6
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml

- name: Create kind cluster
uses: helm/kind-action@v1.5.0
uses: helm/kind-action@v1.12.0
if: steps.list-changed.outputs.changed == 'true'
with:
node_image: ${{ matrix.kubernetes_version }}
Expand Down
33 changes: 30 additions & 3 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,48 @@ name: Lint Code Base

on: pull_request

permissions:
contents: read

jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Lint Code Base
uses: github/super-linter@v4
uses: super-linter/super-linter@v6.7.0
env:
VALIDATE_ALL_CODEBASE: true
VALIDATE_CHECKOV: false
VALIDATE_GITLEAKS: false
VALIDATE_JSCPD: false
VALIDATE_KUBERNETES_KUBEVAL: false
VALIDATE_JSONC: false
VALIDATE_KUBERNETES_KUBECONFORM: false
VALIDATE_YAML: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# copied from https://github.com/renovatebot/helm-charts
lint-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install and run helm-docs
run: |-
# renovate: datasource=github-releases depName=norwoodj/helm-docs
HELM_DOCS_VERSION=1.14.2
# install helm-docs
curl -fsSL -o /tmp/helm-docs.tar.gz https://github.com/norwoodj/helm-docs/releases/download/v"${HELM_DOCS_VERSION}"/helm-docs_"${HELM_DOCS_VERSION}"_Linux_x86_64.tar.gz
mkdir -p /tmp/helm-docs && tar -xf /tmp/helm-docs.tar.gz -C /tmp/helm-docs
mv /tmp/helm-docs/helm-docs /usr/local/bin/helm-docs
chmod a+x /usr/local/bin/helm-docs
.github/helm-docs.sh
- name: Check dirty state
run: git diff --exit-code
Loading

0 comments on commit 89c5cda

Please sign in to comment.