-
Notifications
You must be signed in to change notification settings - Fork 8
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 some automation for doing periodic mass rebuilds of Fedora packages #864
Open
tstellar
wants to merge
43
commits into
fedora-llvm-team:main
Choose a base branch
from
tstellar:mass-rebuild
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
e252a90
Add some automation for doing periodic mass rebuilds of Fedora packages
tstellar d963e2d
Fix formatting
tstellar 641aa8f
Fix formatting
tstellar 2682ca9
Fix formatting
tstellar 5ff0fa4
Fix formatting
tstellar 38ce870
Fix formatting
tstellar 658f24c
Fix formatting
tstellar 41967a9
Fix docstring
tstellar b00f3bf
Update .github/workflows/rebuilder.py
tstellar 366d12a
Update .github/workflows/rebuilder.py
tstellar 4956c4a
Address review comments
tstellar ac66967
Fix formatting
tstellar 8d16f12
Fix formatting
tstellar 0767ab9
Try to install dnf
tstellar 242e0ed
Fix dnf install
tstellar ec894ba
Fix dnf install
tstellar d4f0846
Remove accidental commit
tstellar e92ad11
Fix running tests
tstellar 716d87e
Add debugging
tstellar d24398a
Debugging
tstellar e091245
Debugging
tstellar 6cbd7fa
Debugging
tstellar 851d171
Debugging
tstellar 97451ba
Debugging
tstellar 980e8bc
Python fix
tstellar e554bae
Python fix
tstellar e54d3a5
Debugging
tstellar 1ccac7a
Python fix
tstellar d8320ab
Debug
tstellar 5d53fdd
Python fix
tstellar cd166ad
Update requirements
tstellar 713aed0
Merge remote-tracking branch 'origin/main'
tstellar e571777
Fix python
tstellar bba48cf
Fix python
tstellar 2cfe6ac
Workaround
tstellar 8cee26b
Workaround
tstellar 22608be
Use fedora
tstellar b752967
Use fedora
tstellar 6f7ad51
Use fedora
tstellar 22d63b2
Use fedora
tstellar e6778dc
Use fedora
tstellar aaf3096
Use fedora
tstellar 3c793aa
Undo some changes
tstellar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: "Mass Rebuild Reporter" | ||
|
||
on: | ||
schedule: | ||
- cron: "40 * * * *" | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
check-for-rebuild: | ||
runs-on: ubuntu-24.04 | ||
permissions: | ||
issues: write | ||
container: | ||
image: "registry.fedoraproject.org/fedora:41" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
.github/workflows/rebuilder.py | ||
sparse-checkout-cone-mode: false | ||
|
||
|
||
- name: Check for existing report | ||
uses: actions/github-script@v7 | ||
id: check-existing | ||
with: | ||
result-encoding: string | ||
script: | | ||
const issues = await github.rest.search.issuesAndPullRequests({ | ||
q: "label:mass-rebuild+is:issue", | ||
sort: "created", | ||
order: "desc", | ||
per_page: 1 | ||
}); | ||
|
||
console.log(issues) | ||
if (issues.data.total_count == 0) | ||
return "2024-11-11"; | ||
const issue = issues.data.items[0]; | ||
console.log(issue); | ||
if (issue.state == "open") | ||
return "skip"; | ||
return issue.closed_at | ||
|
||
- name: Collect Regressions | ||
if: steps.check-existing.outputs.result != 'skip' | ||
id: regressions | ||
run: | | ||
sudo dnf install -y python3-dnf python3-copr | ||
python3 .github/workflows/rebuilder.py get-regressions --start-date ${{ steps.check-existing.outputs.result }} > regressions | ||
|
||
- name: Create Report | ||
if: steps.check-existing.outputs.result != 'skip' | ||
uses: actions/github-script@v7 | ||
env: | ||
REGRESSIONS: ${{ steps.regressions.outputs.REGRESSIONS }} | ||
with: | ||
script: | | ||
var fs = require('fs'); | ||
const regressions = await JSON.parse(fs.readFileSync('./regressions')); | ||
comment = "During the last mass rebuild, some packages failed:\n"; | ||
console.log(regressions); | ||
if (regressions.length == 0) | ||
return; | ||
regressions.forEach(function(value){ | ||
comment = comment.concat('\n', value.name); | ||
comment = comment.concat(': ', value.url); | ||
}); | ||
console.log(comment); | ||
const issue = await github.rest.issues.create({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
title: "Mass Rebuild Report", | ||
labels: ['mass-rebuild'], | ||
body: comment | ||
}); | ||
console.log(issue); |
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,36 @@ | ||
name: "Mass Rebuild Runner" | ||
|
||
on: | ||
schedule: | ||
# Run on the first of every month. | ||
- cron: 30 1 1 * * | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
start-rebuild: | ||
runs-on: ubuntu-24.04 | ||
container: | ||
image: "registry.fedoraproject.org/fedora:41" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
.github/workflows/rebuilder.py | ||
sparse-checkout-cone-mode: false | ||
|
||
- name: Setup Copr config file | ||
env: | ||
# You need to have those secrets in your repo. | ||
# See also: https://copr.fedorainfracloud.org/api/. | ||
COPR_CONFIG_FILE: ${{ secrets.COPR_CONFIG }} | ||
run: | | ||
mkdir -p ~/.config | ||
printf "$COPR_CONFIG_FILE" > ~/.config/copr | ||
|
||
- name: Start rebuild | ||
run: | | ||
sudo dnf install -y python3-dnf python3-copr | ||
python3 .github/workflows/rebuilder.py rebuild |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please create
mass-rebuild
label first.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: mass-rebuild