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 some automation for doing periodic mass rebuilds of Fedora packages #864

Open
wants to merge 43 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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 Nov 13, 2024
d963e2d
Fix formatting
tstellar Nov 15, 2024
641aa8f
Fix formatting
tstellar Nov 15, 2024
2682ca9
Fix formatting
tstellar Nov 15, 2024
5ff0fa4
Fix formatting
tstellar Nov 15, 2024
38ce870
Fix formatting
tstellar Nov 15, 2024
658f24c
Fix formatting
tstellar Nov 15, 2024
41967a9
Fix docstring
tstellar Nov 15, 2024
b00f3bf
Update .github/workflows/rebuilder.py
tstellar Nov 18, 2024
366d12a
Update .github/workflows/rebuilder.py
tstellar Nov 18, 2024
4956c4a
Address review comments
tstellar Nov 18, 2024
ac66967
Fix formatting
tstellar Nov 19, 2024
8d16f12
Fix formatting
tstellar Nov 19, 2024
0767ab9
Try to install dnf
tstellar Nov 19, 2024
242e0ed
Fix dnf install
tstellar Nov 19, 2024
ec894ba
Fix dnf install
tstellar Nov 19, 2024
d4f0846
Remove accidental commit
tstellar Nov 19, 2024
e92ad11
Fix running tests
tstellar Nov 19, 2024
716d87e
Add debugging
tstellar Nov 19, 2024
d24398a
Debugging
tstellar Nov 19, 2024
e091245
Debugging
tstellar Nov 19, 2024
6cbd7fa
Debugging
tstellar Nov 19, 2024
851d171
Debugging
tstellar Nov 19, 2024
97451ba
Debugging
tstellar Nov 19, 2024
980e8bc
Python fix
tstellar Nov 19, 2024
e554bae
Python fix
tstellar Nov 19, 2024
e54d3a5
Debugging
tstellar Nov 19, 2024
1ccac7a
Python fix
tstellar Nov 19, 2024
d8320ab
Debug
tstellar Nov 19, 2024
5d53fdd
Python fix
tstellar Nov 19, 2024
cd166ad
Update requirements
tstellar Nov 19, 2024
713aed0
Merge remote-tracking branch 'origin/main'
tstellar Nov 19, 2024
e571777
Fix python
tstellar Nov 19, 2024
bba48cf
Fix python
tstellar Nov 19, 2024
2cfe6ac
Workaround
tstellar Nov 19, 2024
8cee26b
Workaround
tstellar Nov 19, 2024
22608be
Use fedora
tstellar Nov 19, 2024
b752967
Use fedora
tstellar Nov 19, 2024
6f7ad51
Use fedora
tstellar Nov 19, 2024
22d63b2
Use fedora
tstellar Nov 19, 2024
e6778dc
Use fedora
tstellar Nov 19, 2024
aaf3096
Use fedora
tstellar Nov 19, 2024
3c793aa
Undo some changes
tstellar Nov 19, 2024
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
80 changes: 80 additions & 0 deletions .github/workflows/mass-rebuild-reporter.yml
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'],
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

body: comment
});
console.log(issue);
36 changes: 36 additions & 0 deletions .github/workflows/mass-rebuild-runner.yml
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
Loading
Loading