-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE: Improve Operator Reconciliation (#1496)
* FEATURE: Improve Operator Reconciliation https://issues.redhat.com/browse/RHOAISTRAT-414 * Update Auth controller tests for RHOAI * Increase e2e timeout
- Loading branch information
1 parent
2de4083
commit de68fa4
Showing
367 changed files
with
30,300 additions
and
4,832 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,36 @@ | ||
name: Check config and readme updates | ||
on: | ||
pull_request_target: | ||
pull_request: | ||
jobs: | ||
file-updates: | ||
permissions: | ||
pull-requests: write | ||
name: Ensure generated files are included | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4.2.2 | ||
with: | ||
ref: ${{github.event.pull_request.head.ref}} | ||
repository: ${{github.event.pull_request.head.repo.full_name}} | ||
- name: Generate files | ||
id: generate-files | ||
- name: Save the PR number for artifact upload | ||
run: | | ||
CMD="make generate manifests api-docs" | ||
$CMD | ||
echo "CMD=$CMD" >> $GITHUB_OUTPUT | ||
echo ${{ github.event.number }} > pr_number.txt | ||
- name: Upload the PR number as artifact | ||
id: artifact-upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pr_number | ||
path: ./pr_number.txt | ||
retention-days: 1 # This will delete the generated artifacts every day. | ||
- name: Generate files | ||
run: make generate manifests api-docs | ||
- name: Ensure generated files are up-to-date | ||
id: check_generated_files | ||
run : | | ||
rm ./pr_number.txt # remove the pr_number.txt before checking "git status", to have correct assessment of the changed files. | ||
if [[ -n $(git status -s) ]] | ||
then | ||
echo "Generated files have been missed in the PR" | ||
git diff | ||
echo "missing_generated_files=true" >> $GITHUB_OUTPUT | ||
exit 1 | ||
else | ||
echo "No new files to commit" | ||
echo "missing_generated_files=false" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Report issue in PR | ||
if: ${{ steps.check_generated_files.outputs.missing_generated_files == 'true' }} | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
message: | | ||
## This PR can't be merged just yet 😢 | ||
Please run `${{ steps.generate-files.outputs.CMD }}` and commit the changes. | ||
For more info: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
- name: Print git status and fail pr | ||
if: ${{ steps.check_generated_files.outputs.missing_generated_files == 'true' }} | ||
run: | | ||
git status | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Comment on pr | ||
on: | ||
workflow_run: | ||
workflows: ["Check config and readme updates"] | ||
types: | ||
- completed | ||
jobs: | ||
download-artifact-data: | ||
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | ||
runs-on: ubuntu-latest | ||
outputs: | ||
pr_number: ${{ steps.artifact-data.outputs.pr_number }} | ||
steps: | ||
- name: Download artifact | ||
id: artifact-download | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: context.payload.workflow_run.id, | ||
}); | ||
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { | ||
return artifact.name == "pr_number" | ||
})[0]; | ||
let download = await github.rest.actions.downloadArtifact({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
artifact_id: matchArtifact.id, | ||
archive_format: 'zip', | ||
}); | ||
let fs = require('fs'); | ||
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/pr_number.zip`, Buffer.from(download.data)); | ||
- name: Unzip artifact | ||
run: unzip pr_number.zip | ||
- name: Extract data | ||
id: artifact-data | ||
run: | | ||
echo "pr_number=$(head -n 1 pr_number.txt)" >> $GITHUB_OUTPUT | ||
comment-on-pr: | ||
needs: | ||
- download-artifact-data | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: Report issue in PR | ||
uses: thollander/[email protected] | ||
with: | ||
message: | | ||
## This PR can't be merged just yet 😢 | ||
Please run `make generate manifests api-docs` and commit the changes. | ||
For more info: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }} | ||
pr-number: ${{ needs.download-artifact-data.outputs.pr_number }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.