Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.6.2 #995

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 68 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ jobs:
- name: Set up Python 3.x Part 1
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.10"

- name: Set up Python 3.x Part 2
run: |
# set up python
python3 -m venv ve1
cd scripts
../ve1/bin/pip3 install -r requirements.txt
../ve1/bin/python3 setup.py install
../ve1/bin/pip3 install .
cd ..

- name: Check for CI changes
Expand Down Expand Up @@ -126,15 +126,15 @@ jobs:
- name: Set up Python 3.x Part 1
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.10"

- name: Set up Python 3.x Part 2
run: |
# set up python
python3 -m venv ve1
cd scripts
../ve1/bin/pip3 install -r requirements.txt
../ve1/bin/python3 setup.py install
../ve1/bin/pip3 install .
cd ..

- name: Check PR Content
Expand Down Expand Up @@ -431,15 +431,15 @@ jobs:
- name: Set up Python 3.x Part 1
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.10"

- name: Set up Python 3.x Part 2
run: |
# set up python
python3 -m venv ve1
cd scripts
../ve1/bin/pip3 install -r requirements.txt
../ve1/bin/python3 setup.py install
../ve1/bin/pip3 install .
cd ..

- name: install chart verifier for action
Expand All @@ -461,44 +461,78 @@ jobs:
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Release Charts
- name: Prepare Chart Release and index entry
if: ${{ needs.setup.outputs.run_build == 'true' }}
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
GITHUB_REF: ${{ github.ref }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPORT_CONTENT: ${{ needs.chart-verifier.outputs.report_content }}
CHART_ENTRY_NAME: ${{ needs.chart-verifier.outputs.chart_entry_name }}
REDHAT_TO_COMMUNITY: ${{ needs.chart-verifier.outputs.redhat_to_community }}
WEB_CATALOG_ONLY: ${{ needs.chart-verifier.outputs.web_catalog_only }}
OCP_VERSION_RANGE: ${{ steps.get-ocp-range.outputs.ocp-version-range }}
id: release-charts
id: prepare-chart-release
run: |
tar zxvf ./scripts/dependencies/helm-chart-releaser/chart-releaser_1.2.0_linux_amd64.tar.gz
sudo cp -f cr /usr/local/bin/cr
INDEX_BRANCH=$(if [ "${GITHUB_REF}" = "refs/heads/main" ]; then echo "refs/heads/gh-pages"; else echo "${GITHUB_REF}-gh-pages"; fi)
CWD=`pwd`
cd pr-branch
../ve1/bin/chart-repo-manager \
--repository=${{ github.repository }} \
--index-branch=${INDEX_BRANCH} \
--api-url=${{ github.event.pull_request._links.self.href }} \
--pr-number=${{ github.event.number }}
cd ${CWD}

- name: Release
# Upload the report file, potentially paired with a public key and, if provided, the chart's tarball and its prov file.
# Only the report file is always included.
# The release tag format is <organization_name>-<chart_name>-<chart_version>
- name: Create GitHub release
if: ${{ needs.chart-verifier.outputs.web_catalog_only == 'False' }}
uses: softprops/action-gh-release@v0.1.12
continue-on-error: true
uses: softprops/action-gh-release@v0.1.15
with:
tag_name: ${{ needs.chart-verifier.outputs.release_tag }}
files: |
${{ steps.release-charts.outputs.report_file }}
${{ steps.release-charts.outputs.public_key_file }}
${{ steps.prepare-chart-release.outputs.report_file }}
${{ steps.prepare-chart-release.outputs.public_key_file }}
${{ steps.prepare-chart-release.outputs.path_to_chart_tarball }}
${{ steps.prepare-chart-release.outputs.prov_file_name }}
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update Helm repository index
if: ${{ needs.setup.outputs.run_build == 'true' }}
env:
CHART_ENTRY_NAME: ${{ needs.chart-verifier.outputs.chart_entry_name }}
WEB_CATALOG_ONLY: ${{ needs.chart-verifier.outputs.web_catalog_only }}
run: |
INDEX_BRANCH=$(if [ "${GITHUB_REF}" = "refs/heads/main" ]; then echo "gh-pages"; else echo "${GITHUB_REF##*/}-gh-pages"; fi)

echo "[INFO] Creating Git worktree for index branch"
INDEX_DIR=$(mktemp -d)
git remote add upstream "$GITHUB_SERVER_URL"/"$GITHUB_REPOSITORY"
git fetch upstream "$INDEX_BRANCH"
git worktree add --detach "$INDEX_DIR" upstream/"$INDEX_BRANCH"

if [ "$WEB_CATALOG_ONLY" == "True" ]; then
INDEX_FILE="unpublished-certified-charts.yaml"
else
INDEX_FILE="index.yaml"
fi

source ve1/bin/activate
cd $INDEX_DIR
update-index \
--index-branch=${INDEX_BRANCH} \
--index-file=${INDEX_FILE} \
--repository=${{ github.repository }} \
--chart-entry="${{ steps.prepare-chart-release.outputs.chart_entry }}" \
--chart-url="${{ steps.prepare-chart-release.outputs.chart_url }}" \
--version="${{ steps.prepare-chart-release.outputs.version }}"

echo "[INFO] Add and commit changes to git"
git status
git add $INDEX_FILE
git status
git commit -m "$RELEASE_TAG $INDEX_FILE (${{ github.event.number }})"
git status
git push \
https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} \
HEAD:refs/heads/${INDEX_BRANCH}

# Note(komish): This step is a temporary workaround. Metrics requires the PR comment
# to be available, but it is written to the filesystem in the previous job.
# This can be removed once the metrics execution is restructured to have access to the PR
Expand All @@ -510,7 +544,9 @@ jobs:
echo ${{ needs.chart-verifier.outputs.message_text_base64 }} | base64 -d | tee ${{ needs.chart-verifier.outputs.message_file }}

- name: Add metrics
id: add_metrics
if: ${{ always() && needs.setup.outputs.run_build == 'true' && env.GITHUB_REPOSITORY != 'openshift-helm-charts/sandbox' }}
continue-on-error: true
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
run: |
Expand All @@ -537,3 +573,12 @@ jobs:
else
echo "Do not collect metrics, required segment write key is not set"
fi

- name: Alert Slack helm_dev on failure to update metrics
continue-on-error: true
if: steps.add_metrics.outcome == 'failure'
uses: archive/github-actions-slack@v2.7.0
with:
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }}
slack-channel: C02979BDUPL
slack-text: Failure! Updating metrics during a chart certification. See '${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}'
10 changes: 6 additions & 4 deletions .github/workflows/mercury_bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@ jobs:
uses: actions/checkout@v3

- name: Set up Python 3.x Part 1
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.10"

- name: Set up Python 3.x Part 2
run: |
# set up python
python3 -m venv ve1
cd scripts && ../ve1/bin/pip3 install -r requirements.txt && cd ..
cd scripts && ../ve1/bin/python3 setup.py install && cd ..
cd scripts
../ve1/bin/pip3 install -r requirements.txt
../ve1/bin/pip3 install .
cd ..

- name: get files changed
id: get_files_changed
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Python 3.x Part 1
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.10"
- name: Install style tooling
working-directory: scripts
run: make venv.codestyle
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,18 @@ jobs:
fetch-depth: 0

- name: Set up Python 3.x Part 1
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.10"

- name: Set up Python 3.x Part 2
run: |
# set up python requirements and scripts
python3 -m venv ve1
cd scripts && ../ve1/bin/pip3 install -r requirements.txt && cd ..
cd scripts && ../ve1/bin/python3 setup.py install && cd ..
cd scripts
../ve1/bin/pip3 install -r requirements.txt
../ve1/bin/pip3 install .
cd ..

- name: Check Request
id: check_request
Expand Down
2 changes: 1 addition & 1 deletion scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ venv.tools:
venv.tools.always-reinstall:
$(PY_BIN) -m venv $(VENV_TOOLS)
./$(VENV_TOOLS_BIN)/pip install -r requirements.txt
./$(VENV_TOOLS_BIN)/python setup.py install
./$(VENV_TOOLS_BIN)/pip install .
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions scripts/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
6 changes: 3 additions & 3 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
attrs==21.2.0
certifi==2020.12.5
chardet==4.0.0
docker==5.0.0
docker==6.1.3
environs==9.5.0
execnet==1.9.0
gitdb==4.0.7
Expand All @@ -23,8 +23,8 @@ pytest==6.2.4
pytest-bdd==4.1.0
pytest-forked==1.3.0
pytest-xdist==2.4.0
PyYAML==5.4.1
requests==2.25.1
PyYAML==6.0.1
requests==2.26.0
retrying==1.3.3
semantic-version==2.8.5
semver==2.13.0
Expand Down
7 changes: 2 additions & 5 deletions scripts/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[metadata]
name = rh-chart-repo-manager
version = 0.1.0
Expand All @@ -22,7 +18,7 @@ classifiers =
package_dir =
= src
packages = find:
python_requires = >=3.6
python_requires = >=3.10
install_requires =
PyYAML
requests
Expand All @@ -49,4 +45,5 @@ console_scripts =
metrics = metrics.metrics:main
get-verify-params = report.get_verify_params:main
pushowners=metrics.pushowners:main
update-index=updateindex.updateindex:main

Loading
Loading