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.7.1 #1460

Merged
merged 1 commit into from
Jun 11, 2024
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
4 changes: 2 additions & 2 deletions .github/actions/generate-chart-locks/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ runs:
echo "ref=${resolvedRef}" | tee -a $GITHUB_OUTPUT
- name: Checkout
id: clone-repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ steps.resolve.outputs.ref }}
path: temp-gen-chart-lock-repo
- name: Setting up python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Generate lock file JSON from existing charts
Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,15 @@ jobs:
- name: Get profile version set in report provided by the user
id: get-profile-version
if: ${{ needs.setup.outputs.run_build == 'true' && steps.verify_requires.outputs.report_provided == 'true' }}
uses: mikefarah/yq@v4
uses: mikefarah/yq@master
with:
cmd: yq '.metadata.tool.profile.version' ${{ format('./pr-branch/{0}', steps.verify_requires.outputs.provided_report_relative_path) }}

- name: Get the range of Kubernetes versions set in the report provided by the user
id: get-kube-range
if: ${{ needs.setup.outputs.run_build == 'true' && steps.verify_requires.outputs.report_provided == 'true' }}
continue-on-error: true
uses: mikefarah/yq@v4
uses: mikefarah/yq@master
with:
cmd: yq '.metadata.chart.kubeversion' ${{ format('./pr-branch/{0}', steps.verify_requires.outputs.provided_report_relative_path) }}

Expand Down Expand Up @@ -481,7 +481,7 @@ jobs:
# 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.15
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.chart-verifier.outputs.release_tag }}
files: |
Expand Down Expand Up @@ -533,6 +533,23 @@ jobs:
https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} \
HEAD:refs/heads/${INDEX_BRANCH}

- name: Add a GitHub comment if release has failed
uses: actions/github-script@v7
if: ${{ failure() && env.GITHUB_REPOSITORY != 'openshift-helm-charts/sandbox' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `### Release job failed

An error occured while updating the Helm repository index.

cc @komish @mgoerens`
});

# 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 Down
4 changes: 2 additions & 2 deletions .github/workflows/check-locks-on-owners-submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.x Part 1
uses: actions/setup-python@v5
Expand Down Expand Up @@ -168,7 +168,7 @@ jobs:
| - | - |
| ${{ steps.gather-metadata.outputs.chart-name }} | ${{ steps.determine-lock-status.outputs.locked-to-path }} |

This OWNERS file is being ${{ steps.populate-file-mod-type.outputs.net-new-owners-file && '**created**' || '**modified**'}} in this pull request.
This OWNERS file is being ${{ steps.populate-file-mod-type.outputs.net-new-owners-file == 'true' && '**created**' || '**modified**'}} in this pull request.

_This comment was auto-generated by [GitHub Actions](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})._

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lock-sanity-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: notify maintainers on failure
id: notify
if: failure() && steps.generate.outcome == 'failure' && github.repository == 'openshift-helm-charts/charts'
uses: archive/github-actions-slack@v2.7.0
uses: archive/github-actions-slack@v2.8.0
with:
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }}
slack-channel: C02979BDUPL
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mercury_bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
- 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@v6
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand All @@ -105,7 +105,7 @@ jobs:

# Only used to assert content of the OWNERS file.
- name: Checkout Pull Request
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
Expand Down
32 changes: 22 additions & 10 deletions .github/workflows/owners-redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Red Hat OWNERS Files
# submissions.

on:
pull_request:
pull_request_target:
paths:
- charts/redhat/**/OWNERS
- charts/community/redhat/**/OWNERS
Expand All @@ -23,10 +23,10 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Clean up stale label
uses: actions/github-script@v3
uses: actions/github-script@v7
continue-on-error: true
with:
github-token: ${{secrets.GITHUB_TOKEN}}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const successLabel = '${{ env.SUCCESS_LABEL }}';
try {
Expand All @@ -46,10 +46,10 @@ jobs:
throw error
}
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand Down Expand Up @@ -81,23 +81,35 @@ jobs:
needs: [gather-metadata]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Python CI tooling
working-directory: scripts
run: |
make venv.tools

# 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"

- name: Assert Owners File Content
id: assert-content
working-directory: pr-branch
env:
CATEGORY: ${{ needs.gather-metadata.outputs.category }}
ORGANIZATION: ${{ needs.gather-metadata.outputs.organization }}
CHARTNAME: ${{ needs.gather-metadata.outputs.chartname }}
run: |
./scripts/venv.tools/bin/assert-redhat-owners-file-meta \
../scripts/venv.tools/bin/assert-redhat-owners-file-meta \
"${CATEGORY}" \
"${ORGANIZATION}" \
"${CHARTNAME}"
Expand All @@ -108,7 +120,7 @@ jobs:
if: failure() && (needs.ensure-prefix-in-path.result == 'failure' || needs.ensure-owners-file-contents.result == 'failure')
steps:
- name: Send PR Comment
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
PREFIX_CHECK_RESULT: ${{ needs.ensure-prefix-in-path.result != '' && needs.ensure-prefix-in-path.result || 'unknown' }}
CONTENT_CHECK_RESULT: ${{ needs.ensure-owners-file-contents.result != '' && needs.ensure-owners-file-contents.result || 'unknown' }}
Expand Down Expand Up @@ -149,7 +161,7 @@ jobs:
if: success()
steps:
- name: Label PR
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/owners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v4

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

Expand Down
1 change: 1 addition & 0 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pytest-forked==1.3.0
pytest-xdist==2.4.0
PyYAML==6.0.1
requests==2.26.0
responses==0.23.1
retrying==1.3.3
semantic-version==2.8.5
semver==2.13.0
Expand Down
2 changes: 1 addition & 1 deletion scripts/src/checkprcontent/checkpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def get_file_match_compiled_patterns():

pattern = re.compile(base + r"/.*")
reportpattern = re.compile(base + r"/report.yaml")
tarballpattern = re.compile(base + r"/(.*\.tgz$)")
tarballpattern = re.compile(base + r"/(.*\.tgz)")
return pattern, reportpattern, tarballpattern


Expand Down
41 changes: 21 additions & 20 deletions scripts/src/metrics/pushowners.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
from owners import owners_file


def bool_to_yes_no(my_bool):
return "Yes" if my_bool else "No"


def getVendorType(changed_file):
path_as_list = changed_file.split("/")
for i in range(len(path_as_list) - 1):
Expand All @@ -16,28 +20,25 @@ def getVendorType(changed_file):


def getFileContent(changed_file):
status, owner_data = owners_file.get_owner_data_from_file(changed_file)
if status is True:
users_included = owners_file.get_users_included(owner_data)
web_catalog_only = owners_file.get_web_catalog_only(owner_data)
if not web_catalog_only:
web_catalog_only_string = "No"
else:
web_catalog_only_string = "Yes"
vendor_name = owners_file.get_vendor(owner_data)
chart_name = owners_file.get_chart(owner_data)
vendor_type = getVendorType(changed_file)
return (
users_included,
web_catalog_only_string,
vendor_name,
chart_name,
vendor_type,
)
else:
print("Exception loading OWNERS file")
try:
owner_data = owners_file.get_owner_data_from_file(changed_file)
except owners_file.OwnersFileError as e:
print("Exception loading OWNERS file: {e}")
return "", "", "", "", ""

users_included = owners_file.get_users_included(owner_data)
web_catalog_only = owners_file.get_web_catalog_only(owner_data)
vendor_name = owners_file.get_vendor(owner_data)
chart_name = owners_file.get_chart(owner_data)
vendor_type = getVendorType(changed_file)
return (
bool_to_yes_no(users_included),
bool_to_yes_no(web_catalog_only),
vendor_name,
chart_name,
vendor_type,
)


def process_pr(added_file, modified_file):
if modified_file != "":
Expand Down
Loading
Loading