Skip to content

Add Peaka 1.0.11 chart #1860

Add Peaka 1.0.11 chart

Add Peaka 1.0.11 chart #1860

Workflow file for this run

name: OWNERS PR Check
# Checks OWNERS file additions and modifications submitted by mercury-bot on a
# partner's behalf, typically in response to a partner updating their project
# metadata.
#
# Automatically approves modifications mercury-bot makes. Sanity checks
# net-new OWNERS files to ensure their addition does not conflict with
# existing locks.
on:
pull_request_target:
types: [opened, synchronize, reopened, edited, ready_for_review, labeled]
paths:
- charts/partners/**/OWNERS
jobs:
owners-file-check:
name: OWNERS file PR checker
runs-on: ubuntu-24.04
permissions:
contents: write
pull-requests: write
if: github.event.pull_request.draft == false && github.actor == 'redhat-mercury-bot'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
id: setup-python
uses: ./.github/actions/setup-python
- name: Install CI scripts
uses: ./.github/actions/install-ci-scripts
with:
python-version: ${{ steps.setup-python.outputs.python-version }}
- name: check if only an OWNERS file is pushed
id: check_for_owners
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
PR_API_URL: ${{ github.event.pull_request._links.self.href }}
run: |
./ve1/bin/check-for-owners --api-url="${PR_API_URL}" \
--allowed-category partners
# We know that only one file was modified at this point, and it seems
# mergeable. Now we need to determine if that file is effectively new.
#
# Being "effectively new" just influences whether or not we should be
# checking the lockfile before merging.
#
# This step only checks the first file for its modification type!
- name: Determine if net-new OWNERS file
id: populate-file-mod-type
if: ${{ steps.check_for_owners.outputs.merge_pr == 'true' }}
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const resp = await github.rest.pulls.listFiles({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
});
const ownersFile = resp.data[0];
console.log(`Modified file "${ownersFile.filename}" has a status of ${ownersFile.status}`);
const effectivelyNew = ownersFile.status == 'added' || ownersFile.status == 'renamed';
console.log(`setting output: net-new-owners-file=${effectivelyNew}`);
core.setOutput('net-new-owners-file', effectivelyNew);
core.setOutput('is-rename', ownersFile.status == 'renamed')
if (ownersFile.status === 'renamed') {
core.setOutput('previous-filename', ownersFile.previous_filename);
}
# Only used to assert content of the OWNERS file.
- name: Checkout Pull Request
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
token: ${{ secrets.BOT_TOKEN }}
fetch-depth: 0
path: "pr-branch"
# TODO: Implemented as a shell script temporarily. Future enhancement
# would re-use some existing logic that we have for the Red Hat OWNERS
# check, and build something similar for general use.
- name: Ensure OWNERS content and path content align
working-directory: "pr-branch"
id: fact-check
env:
PR_FILES: ${{ steps.check_for_owners.outputs.pr_files }}
CHART_NAME: ${{ steps.check_for_owners.outputs.chart-name }}
ORGANIZATION: ${{ steps.check_for_owners.outputs.organization }}
run: |
file=$(yq .0 <<< ${PR_FILES})
owner_contents_chart_name=$(yq '.chart.name' ${file})
owner_contents_vendor_label=$(yq '.vendor.label' ${file})
echo "Chart Name Comparison: ${owner_contents_chart_name} = ${CHART_NAME}"
echo "Vendor Label Comparison: ${owner_contents_vendor_label} = ${ORGANIZATION}"
test "${owner_contents_chart_name}" = "${CHART_NAME}"
test "${owner_contents_vendor_label}" = "${ORGANIZATION}"
- name: Comment on PR if facts are mismatched
id: comment-if-fact-check-failure
if: failure() && steps.fact-check.outcome == 'failure'
run: |
gh pr comment "${GITHUB_EVENT_NUMBER}" --body "${COMMENT_BODY}"
env:
GITHUB_EVENT_NUMBER: ${{ github.event.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMENT_BODY: |
### Submission Facts Mismatch
The content of the OWNERS file and your submission path do not seem to match. Double check that
your vendor label and chart name values in your OWNERS file match with your submission path.
_This comment was auto-generated by [GitHub Actions](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})._
- name: Check if chart name is locked
id: determine-lock-status
uses: ./.github/actions/check-chart-locks
with:
chart-name: ${{ steps.check_for_owners.outputs.chart-name }}
fail-workflow-if-locked: 'false'
# Rename operations would produce a locking failure because main has an
# existing lock for the chart name. For renaming operations, evaluate if
# the original file in the rename matches the current lock.
- name: Assert renaming semantics
id: assert-rename-semantics
if: |
steps.populate-file-mod-type.outputs.is-rename == 'true'
&& steps.determine-lock-status.outputs.chart-is-locked == 'true'
env:
PREVIOUS_FILENAME: ${{ steps.populate-file-mod-type.outputs.previous-filename && steps.populate-file-mod-type.outputs.previous-filename || 'unset' }}
CURRENT_LOCK: ${{ format('{0}/{1}', 'charts', steps.determine-lock-status.outputs.locked-to-path) }}
LOCKED_TO_PREVIOUS: ${{ startsWith((steps.populate-file-mod-type.outputs.previous-filename && steps.populate-file-mod-type.outputs.previous-filename || 'unset'), format('{0}/{1}', 'charts', steps.determine-lock-status.outputs.locked-to-path)) }}
run: |
echo "Current lock is set to ${CURRENT_LOCK}"
echo "The previous filename for this rename is: ${PREVIOUS_FILENAME}"
echo locked-to-previous-filename="${LOCKED_TO_PREVIOUS}" | tee -a $GITHUB_OUTPUT
# Do not merge net-new OWNERS files for locked chart names. Allow a
# modification to an existing file. The mercury-bot periodically updates
# this file as users make changes to their project settings.
- name: Determine if should merge and is safe to merge
id: safe-to-merge
env:
NET_NEW_OWNERS_FILE: ${{ steps.populate-file-mod-type.outputs.net-new-owners-file }}
CHART_IS_LOCKED: ${{ steps.determine-lock-status.outputs.chart-is-locked }}
CHART_LOCKED_TO_PREVIOUS: ${{ steps.determine-lock-status.outputs.chart-is-locked == 'true' && steps.assert-rename-semantics.outputs.locked-to-previous-filename == 'true' }}
IS_RENAME: ${{ steps.populate-file-mod-type.outputs.is-rename }}
MERGE_PR: ${{ steps.populate-file-mod-type.outputs.net-new-owners-file == 'false' || (steps.populate-file-mod-type.outputs.net-new-owners-file == 'true' && (steps.determine-lock-status.outputs.chart-is-locked == 'false' || (steps.determine-lock-status.outputs.chart-is-locked == 'true' && steps.assert-rename-semantics.outputs.locked-to-previous-filename == 'true'))) }}
run: |
echo "OWNERS file is net new: ${NET_NEW_OWNERS_FILE}"
echo "Chart name is already locked: ${CHART_IS_LOCKED}"
echo "This is a namespace rename: ${IS_RENAME}"
echo "Existing locks checked, the previous lockfile is being moved to a new path: ${CHART_LOCKED_TO_PREVIOUS}"
echo "merge_pr=${MERGE_PR}" | tee -a $GITHUB_OUTPUT
- name: Comment on PR
if: ${{ steps.check_for_owners.outputs.merge_pr == 'false' }}
uses: actions/github-script@v7
env:
GITHUB_EVENT_NUMBER: ${{ github.event.number }}
OWNER_CHECK_OUTPUT_MSG: ${{ steps.check_for_owners.outputs.msg }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var issue_number = process.env.GITHUB_EVENT_NUMBER;
var comment = process.env.OWNER_CHECK_OUTPUT_MSG;
github.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: Number(issue_number),
body: comment
});
- name: Reflect on check for OWNERS file result
if: |
steps.check_for_owners.outputs.merge_pr == 'false'
|| steps.safe-to-merge.outputs.merge_pr == 'false'
run: |
echo "::error: The PR was not for a single partner OWNERS file, or was for a chart name locked to another contributor"
exit 1
- name: Approve PR
id: approve_pr
if: |
steps.check_for_owners.outputs.merge_pr == 'true'
&& steps.safe-to-merge.outputs.merge_pr == 'true'
uses: hmarr/auto-approve-action@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Merge PR
id: merge_pr
if: ${{ steps.approve_pr.conclusion == 'success' }}
uses: pascalgn/automerge-action@v0.16.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_METHOD: squash
MERGE_LABELS: ""
MERGE_ERROR_FAIL: "true"