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

Add gosnappassredhat owners should fail #1112

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
48facb6
Create OWNERS file for concerthall gosnappass in community
komish Oct 3, 2023
6ee626c
Add github-output.txt to gitignore for use in developer
komish Nov 1, 2023
561facc
Dynamically prepare request headers and add optional logging to githu…
komish Nov 1, 2023
44bd649
Configure requests to use generated headers
komish Nov 1, 2023
0ffde04
add script that generates a chart locks
komish Oct 2, 2023
33891ba
Rename script and add entrypoint
komish Nov 8, 2023
f758641
Use the chart name itself as the index entry name
komish Nov 2, 2023
99f80a5
redesign-doc
komish Oct 6, 2023
8608480
Enforce chart naming expectations on submissions from Red Hat
komish Nov 1, 2023
4b40c32
Remove charts associated with archived projects
komish Oct 2, 2023
f2a81a8
Remove charts where the project does not exist
komish Oct 2, 2023
601ea18
Remove wildfly because the package was distributed under the redhat o…
komish Oct 2, 2023
a7e333b
Remove conflicting internal test projects
komish Oct 2, 2023
73dc39d
Remove entry fredco because no associated backend org exists
komish Oct 2, 2023
22db19d
Remove conflicting test charts
komish Oct 2, 2023
5c4aa41
Remove projects with malformed names
komish Oct 2, 2023
8d03753
Add workflow that generates chart locks and submits PR if necessary
komish Nov 10, 2023
84199e8
Merge branch 'EET-3470/_convenience-add-concerthall-as-partner' into …
komish Nov 10, 2023
3da8fb6
Merge branch 'EET-3470/redesign-doc' into EET-3470-MAIN-CONSTRUCTED
komish Nov 10, 2023
0966704
Merge branch 'EET-3470/remove-archived-and-extra-charts' into EET-347…
komish Nov 10, 2023
147fb98
Merge branch 'EET-3470/add-script-generating-chart-lock-maps' into EE…
komish Nov 10, 2023
f2272dc
Merge branch 'EET-3470/add-workflow-generate-package-locks' into EET-…
komish Nov 10, 2023
f6db590
Merge branch 'EET-3470/enforce-chart-name-as-index-entry' into EET-34…
komish Nov 10, 2023
02707d2
Merge branch 'EET-3470/redhat-charts-must-have-prefix' into EET-3470-…
komish Nov 10, 2023
829c96d
Add gosnappass 0.0.1 (#19)
komish Nov 10, 2023
d9a1aa4
Add gosnappassredhat owners
komish Nov 10, 2023
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
126 changes: 126 additions & 0 deletions .github/workflows/generate-chart-locks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# This workflow generates the JSON representation of a chart lock if it differs
# from what's currently at LOCK_FILE_URL and creates a PR to
# PR_DEST_BRANCH_NAME.
name: Generate Chart Locks

on:
push:
branches: ["main"]
workflow_dispatch:

env:
PR_DEST_BRANCH_NAME: ${{ vars.TARGET_GH_PAGES_BRANCH || 'gh-pages' }}
LOCK_FILE_URL: ${{ vars.LOCK_FILE_URL || 'https://charts.openshift.io/chart-locks.json' }}

concurrency:
# Prevent parallel executions of this and related tasks.
group: updating-chart-locks
cancel-in-progress: false

jobs:
generate-chart-locks:
outputs:
package_locks_b64: ${{ steps.generate-chart-locks.outputs.package_locks_b64 }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: |
pip install PyYAML
- name: Generate lock file JSON from existing charts
id: generate-chart-locks
run: |
set -o pipefail
python scripts/src/packagemapping/generatelocks.py | tee /tmp/packagelocks.json
base64 -w 0 /tmp/packagelocks.json | tee /tmp/packagelocks.json.b64
echo "package_locks_b64=$(cat /tmp/packagelocks.json.b64)" >> $GITHUB_OUTPUT
- name: Decode and display lockfile JSON (Sanity Check)
run: |
set -o pipefail
test -n "${{ steps.generate-chart-locks.outputs.package_locks_b64 }}" \
|| { echo "::error::output package_locks_b64 did not contain base64 content generated from the previous step"; exit 2 ;}
echo ${{ steps.generate-chart-locks.outputs.package_locks_b64 }} | base64 -d | jq \
|| { echo "::error::output package_locks_b64 did not contain valid JSON once decoded" ; exit 3 ;}

compare-package-lock-manifests:
needs: generate-chart-locks
outputs:
needs-updating: ${{ steps.compare-package-locks.outputs.needs-updating }}
runs-on: ubuntu-latest
steps:
- name: Determine if package lock entries need updating
id: compare-package-locks
run: |
needsupdating=false
wget ${{ env.LOCK_FILE_URL }} -O current-locks.json
set -o pipefail
test -n "${{ needs.generate-chart-locks.outputs.package_locks_b64 }}" \
|| { echo "::error::output package_locks_b64 did not contain base64 content generated from the previous step"; exit 2 ;}
echo ${{ needs.generate-chart-locks.outputs.package_locks_b64 }} | base64 -d | jq > generated-locks.json \
|| { echo "::error::output package_locks_b64 did not contain valid JSON once decoded" ; exit 3 ;}
jq .packages current-locks.json > current-packages.json
jq .packages generated-locks.json > generated-packages.json
diff current-packages.json generated-packages.json || needsupdating=true
echo needs-updating=${needsupdating} | tee -a $GITHUB_OUTPUT

craft-pr-to-project:
# TODO: This needs a token for a user who isn't the CI bot (e.g. GITHUB_TOKEN) but has commit permissions.
needs:
- compare-package-lock-manifests
- generate-chart-locks
if: needs.compare-package-lock-manifests.outputs.needs-updating == 'true'
runs-on: ubuntu-latest
steps:
- name: Clone ${{ env.PR_DEST_BRANCH_NAME }} branch
uses: actions/checkout@v3
with:
ref: ${{ env.PR_DEST_BRANCH_NAME }}
# token: tbd
- name: Set Git Config
# TODO update the user name and email
run: |
git config user.name "CI Bot Name"
git config user.email [email protected]

- name: Create new branch
id: create-branch
run: |
branchuuid=$(uuidgen)
branchname=update-locks-${branchuuid}
git checkout -b $branchname
echo branchname=$branchname >> $GITHUB_OUTPUT

- name: Overwrite existing lockfile, Commit, and Push
id: commit-and-push
run: |
set -o pipefail
test -n "${{ needs.generate-chart-locks.outputs.package_locks_b64 }}" \
|| { echo "::error::output package_locks_b64 did not contain base64 content generated from the previous step"; exit 2 ;}
echo ${{ needs.generate-chart-locks.outputs.package_locks_b64 }} | base64 -d | jq > chart-locks.json \
|| { echo "::error::output package_locks_b64 did not contain valid JSON once decoded" ; exit 3 ;}
md5sum=$(md5sum chart-locks.json | awk '{ print $1 }' )
echo new_lockfile_md5sum=$md5sum >> $GITHUB_OUTPUT
git add chart-locks.json
git commit -m "updating package lock file"
git push origin ${{ steps.create-branch.outputs.branchname }}

- name: Create Pull Request
# If using the GitHub Actions Token, make sure your repository allows
# for write permissions as well as Creating and Merging Pull Requests in
# Settings.
run: |
body=$(echo -e "${{ env.PR_BODY }}\n\nThe generated lockfile's md5sum is: **${{ steps.commit-and-push.outputs.new_lockfile_md5sum }}**\n")
gh pr create -B ${{ env.PR_DEST_BRANCH_NAME }} -H ${{ steps.create-branch.outputs.branchname }} --title "${{ env.PR_TITLE }} - ${{ steps.commit-and-push.outputs.new_lockfile_md5sum }}" --body "${body}"
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
PR_TITLE: Updating Chart Locks
PR_BODY: |
_This PR was generated by GitHub Actions_

This PR is updating the Chart Locks. The content of this PR was
generated based on the current state of the charts directory.

This PR should be automatically merged by GitHub Actions if there are
no merge conflicts.
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,37 @@ __pycache__
sanity-check.py
.cr-release-packages/*.tgz
oc

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Virtual Envs
venv.*/

# Development Files
github-output.txt
10 changes: 0 additions & 10 deletions charts/community/wildfly/wildfly/OWNERS

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions charts/partners/a10/a10tkc/OWNERS

This file was deleted.

10 changes: 0 additions & 10 deletions charts/partners/a60924148a9b77a2ff5f7b786/extchart/OWNERS

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions charts/partners/a60924148a9b77a2ff5f7b786/helm-prod-normal/OWNERS

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions charts/partners/a60924148a9b77a2ff5f7b786/helm/OWNERS

This file was deleted.

9 changes: 0 additions & 9 deletions charts/partners/a60924148a9b77a2ff5f7b786/norchart/OWNERS

This file was deleted.

10 changes: 0 additions & 10 deletions charts/partners/a60924148a9b77a2ff5f7b786/prodchart4/OWNERS

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions charts/partners/a60924148a9b77a2ff5f7b786/test-helm-cnf/OWNERS

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions charts/partners/a60924148a9b77a2ff5f7b786/test/OWNERS

This file was deleted.

Loading
Loading