-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into thanos_persistentVolumeClaimRetentionPolicy
Signed-off-by: François Marceau <[email protected]>
- Loading branch information
Showing
1,289 changed files
with
146,256 additions
and
23,508 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,23 +92,72 @@ jobs: | |
update-pr: | ||
runs-on: ubuntu-latest | ||
needs: [get-chart] | ||
name: Automatically update README and CRDs | ||
name: Automatically update README, CRDs and CHANGELOG | ||
permissions: | ||
contents: write | ||
outputs: | ||
result: ${{ steps.update-pr.outputs.result }} | ||
if: needs.get-chart.outputs.result == 'ok' | ||
steps: | ||
- name: Checkout bitnami/charts | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 | ||
with: | ||
ref: ${{github.event.pull_request.head.ref}} | ||
repository: ${{github.event.pull_request.head.repo.full_name}} | ||
token: ${{ secrets.BITNAMI_BOT_TOKEN }} | ||
path: charts | ||
- name: Clone upstream bitnami/charts repository | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 | ||
with: | ||
path: upstream-charts | ||
- name: Setup git configuration | ||
run: | | ||
cd $GITHUB_WORKSPACE/charts | ||
git config user.name "Bitnami Containers" | ||
git config user.email "[email protected]" | ||
# In order to avoid doing a full clone (which would fetch the index branch), we | ||
# unshallow the clone only using the main branch. We need to get the tags to | ||
# regenerate the changelog too | ||
- name: Unshallow main branch and get tags | ||
run: | | ||
cd $GITHUB_WORKSPACE/upstream-charts | ||
git fetch origin main --unshallow | ||
git fetch --tags | ||
- name: Install conventional-changelog-cli | ||
run: npm install -g conventional-changelog-cli | ||
- id: generate-changelog | ||
name: Generate changelog | ||
env: | ||
CHART: ${{ needs.get-chart.outputs.chart }} | ||
run: | | ||
cd $GITHUB_WORKSPACE/upstream-charts | ||
# The generator needs the file to exist | ||
chart_version="$(yq e '.version' $GITHUB_WORKSPACE/charts/bitnami/${CHART}/Chart.yaml)" | ||
changelog_file="$GITHUB_WORKSPACE/charts/bitnami/${CHART}/CHANGELOG.md" | ||
changelog_tmp="$GITHUB_WORKSPACE/charts/bitnami/${CHART}/CHANGELOG.md.tmp" | ||
touch "$changelog_file" | ||
npx conventional-changelog-cli -i ${changelog_file} -s -t ${CHART}/ -r 0 --commit-path bitnami/${CHART} | ||
# The tool uses short sha to generate commit links. Sometimes, Github does not offer links with the short sha, so we change all commit links to use the full sha instead | ||
for short_sha in $(grep -Eo "/commit/[a-z0-9]+" ${changelog_file} | awk -F/ '{print $3}'); do | ||
long_sha="$(git rev-list @ | grep "^$short_sha" | head -n 1)"; | ||
sed -i "s%/commit/$short_sha%/commit/$long_sha%g" ${changelog_file}; | ||
done | ||
cd $GITHUB_WORKSPACE/charts | ||
# Remove unreleased section (includes all intermediate commits in the branch) and create future entry based on PR title | ||
# The unreleased section looks like this "## (YYYY-MM-DD)" whereas a released section looks like this "## 0.0.1 (YYYY-MM-DD)" | ||
# So we only need to find a released section to start printing in the awk script below | ||
awk '/^##[^(]*[0-9]/ {flag=1} flag {print}' ${changelog_file} > ${changelog_tmp} | ||
# Remove extra newlines so the changelog file passes the markdown linter | ||
sed -i -E -e '/^$/d' ${changelog_tmp} && sed -i -E -e 's/(##.*)/\n\1\n/g' ${changelog_tmp} | ||
# Include h1 heading and add entry for the current version. There is no tag for the current version (this will be created once merged), so we need to manually add it. | ||
# We know the final squashed commit title, which will be the PR title. We cannot add a link to the commit in the main branch because it has not been | ||
# merged yet (this will be corrected once a new version regenerates the changelog). Instead, we add the PR url which contains the exact same information. | ||
echo -e -n "# Changelog\n\n## $chart_version ($(date +'%Y-%m-%d'))\n\n* ${{ github.event.pull_request.title }} ([#${{ github.event.number }}](${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.number }}))\n" > ${changelog_file} | ||
cat ${changelog_tmp} >> ${changelog_file} | ||
rm ${changelog_tmp} | ||
if git status -s | grep "bitnami/${CHART}/CHANGELOG.md"; then | ||
git add "bitnami/${CHART}/CHANGELOG.md" && git commit -m "Update CHANGELOG.md" --signoff | ||
fi | ||
- name: Install readme-generator-for-helm | ||
if: needs.get-chart.outputs.values-updated == 'true' | ||
run: npm install -g @bitnami/readme-generator-for-helm | ||
|
@@ -119,6 +168,7 @@ jobs: | |
CHART: ${{ needs.get-chart.outputs.chart }} | ||
run: | | ||
exit_code=0 | ||
cd $GITHUB_WORKSPACE/charts | ||
echo "Validating README.md for bitnami/${CHART}" | ||
# Validating *.registry parameters | ||
while read line; do | ||
|
@@ -165,6 +215,7 @@ jobs: | |
CHART: ${{ needs.get-chart.outputs.chart }} | ||
run: | | ||
# Updating CRDs stored at 'bitnami/$CHART/crds' and 'bitnami/$CHART/templates/crds' | ||
cd $GITHUB_WORKSPACE/charts | ||
mapfile -t crd_files < <(find "bitnami/${CHART}/crds" "bitnami/${CHART}/templates/crds" -name "*.yaml" -o -name "*.yml" 2>/dev/null || true) | ||
for file in "${crd_files[@]}"; do | ||
# Automatically update CRDs that use the '# Source' header | ||
|
@@ -245,6 +296,7 @@ jobs: | |
- id: update-pr | ||
name: Push changes | ||
run: | | ||
cd $GITHUB_WORKSPACE/charts | ||
# Push all the new commits, if any | ||
if [[ $(git cherry -v) ]]; then | ||
git push | ||
|
@@ -270,7 +322,7 @@ jobs: | |
) | ||
name: VIB Verify | ||
steps: | ||
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b | ||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 | ||
name: Checkout Repository | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ on: | |
- main | ||
paths: | ||
- '**.md' | ||
- '!**/CHANGELOG.md' | ||
# Remove all permissions by default | ||
permissions: {} | ||
jobs: | ||
|
@@ -19,7 +20,7 @@ jobs: | |
- name: Install mardownlint | ||
run: npm install -g [email protected] | ||
- name: Checkout project | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 | ||
- name: Execute markdownlint | ||
env: | ||
DIFF_URL: "${{github.event.pull_request.diff_url}}" | ||
|
@@ -29,7 +30,7 @@ jobs: | |
# This request doesn't consume API calls. | ||
curl -Lkso $TEMP_FILE $DIFF_URL | ||
files_changed="$(sed -nr 's/[\-\+]{3} [ab]\/(.*)/\1/p' $TEMP_FILE | sort | uniq)" | ||
md_files="$(echo "$files_changed" | grep -o ".*\.md$" | sort | uniq || true)" | ||
md_files="$(echo "$files_changed" | grep -v "CHANGELOG.md" | grep -o ".*\.md$" | sort | uniq || true)" | ||
# Create an empty file, useful when the PR changes ignored files | ||
touch "${TEMP_OUTPUT}" | ||
exit_code=0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
LICENSE.md | ||
.github/PULL_REQUEST_TEMPLATE.md | ||
CHANGELOG.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.