Skip to content

Commit

Permalink
Merge branch 'main' into rabbitmq-extraports
Browse files Browse the repository at this point in the history
Signed-off-by: Rafael Ríos Saavedra <[email protected]>
  • Loading branch information
rafariossaa authored May 24, 2024
2 parents 192c089 + a4ecaf9 commit ddad448
Show file tree
Hide file tree
Showing 860 changed files with 105,712 additions and 2,417 deletions.
30 changes: 29 additions & 1 deletion .github/workflows/cd-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
helm plugin add https://github.com/zoobab/helm_file_repo
- id: update-index
name: Fetch chart and update index
env:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_PUBLISH_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PUBLISH_SECRET_ACCESS_KEY }}
AWS_ASSUME_ROLE_ARN: ${{ secrets.AWS_PUBLISH_ROLE_ARN }}
Expand Down Expand Up @@ -164,6 +164,34 @@ jobs:
echo "Could not update the index after $max_attempts attempts"
exit 1
fi
push-tag:
runs-on: ubuntu-latest
permissions:
contents: write
needs:
- get-chart
- vib-publish
name: Push tag
if: ${{ needs.get-chart.outputs.result == 'ok' }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
with:
path: charts
fetch-depth: 2 # to be able to obtain files changed in the latest commit
- id: push-tag
name: 'Push tag'
env:
CHART: ${{ needs.get-chart.outputs.chart }}
run: |
cd charts
# Get chart version and list of tags
chart_version="$(yq e '.version' bitnami/${CHART}/Chart.yaml)"
git fetch --tags
# If the tag does not exist, create and push it (this allows re-executing the job)
if ! git tag | grep ${CHART}/${chart_version}; then
git tag ${CHART}/${chart_version}
git push --tags
fi
# If the CD Pipeline does not succeed we should notify the interested agents
slack-notif:
runs-on: ubuntu-latest
Expand Down
54 changes: 53 additions & 1 deletion .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ 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:
Expand All @@ -105,10 +105,59 @@ jobs:
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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/markdown-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- main
paths:
- '**.md'
- '!**/CHANGELOG.md'
# Remove all permissions by default
permissions: {}
jobs:
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
LICENSE.md
.github/PULL_REQUEST_TEMPLATE.md
CHANGELOG.md
70 changes: 37 additions & 33 deletions .vib/jupyterhub/cypress/cypress/e2e/jupyterhub.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,47 @@
import { random } from '../support/utils';

it('allows to upload and execute a python notebook', () => {
const notebookName = `notebook_template_${random}.ipynb`;
const userName = Cypress.env('username');
cy.session('test_upload', () => {
const notebookName = `notebook_template_${random}.ipynb`;
const userName = Cypress.env('username');

cy.login();
cy.visit(`/user/${userName}/tree/tmp`);
cy.contains('Upload').should('be.visible');
cy.get('[type=file]').selectFile('cypress/fixtures/notebook_template.ipynb', {
force: true,
});
cy.get('.filename_input').clear().type(notebookName);
cy.contains('button', 'Upload').click();
cy.contains('a', notebookName);
cy.login();
cy.visit(`/user/${userName}/tree/tmp`);
cy.contains('Upload').should('be.visible');
cy.get('[type=file]').selectFile('cypress/fixtures/notebook_template.ipynb', {
force: true,
});
cy.get('.filename_input').clear().type(notebookName);
cy.contains('button', 'Upload').click();
cy.contains('a', notebookName);

cy.visit(`/user/${userName}/notebooks/tmp/${notebookName}`);
cy.contains('button', 'Run').click();
cy.contains('Hello World!');
cy.visit(`/user/${userName}/notebooks/tmp/${notebookName}`);
cy.contains('button', 'Run').click();
cy.contains('Hello World!');
});
});

it('allows generating an API token', () => {
cy.login();
cy.visit('/hub/token');
// We need to wait until the background API request is finished
cy.contains(/\d+Z/).should('not.exist');
cy.contains('button', 'API token').click();
cy.get('#token-result')
.should('be.visible')
.invoke('text')
.then((apiToken) => {
cy.request({
url: '/hub/api/users',
method: 'GET',
headers: {
Authorization: `token ${apiToken}`,
},
}).then((response) => {
expect(response.status).to.eq(200);
expect(response.body[0].name).to.eq(Cypress.env('username'));
cy.session('test_token', () => {
cy.login();
cy.visit('/hub/token');
// We need to wait until the background API request is finished
cy.contains(/\d+Z/).should('not.exist');
cy.contains('button', 'API token').click();
cy.get('#token-result')
.should('be.visible')
.invoke('text')
.then((apiToken) => {
cy.request({
url: '/hub/api/users',
method: 'GET',
headers: {
Authorization: `token ${apiToken}`,
},
}).then((response) => {
expect(response.status).to.eq(200);
expect(response.body[0].name).to.eq(Cypress.env('username'));
});
});
});
});
});
57 changes: 57 additions & 0 deletions .vib/scylladb/ginkgo/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
module test-scylladb-chart

go 1.20

replace github.com/bitnami/charts/.vib/common-tests/ginkgo-utils => ../../common-tests/ginkgo-utils

require (
github.com/bitnami/charts/.vib/common-tests/ginkgo-utils v0.0.0-00010101000000-000000000000
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.8
k8s.io/api v0.28.0
k8s.io/apimachinery v0.28.0
k8s.io/client-go v0.28.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.3 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit ddad448

Please sign in to comment.