Skip to content

Commit

Permalink
update-nixpkgs: more notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
leona-ya committed Dec 17, 2024
1 parent 6c77f1a commit 7e62860
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/update_nixpkgs/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def rebase_nixpkgs(
branch_to_rebase: str,
integration_branch: str,
last_day_integration_branch: str,
force: bool
force: bool,
matrix_hookshot: MatrixHookshot
) -> NixpkgsRebaseResult | None:
logging.info("Trying to rebase nixpkgs repository.")
if nixpkgs_repo.is_dirty():
Expand Down Expand Up @@ -125,6 +126,18 @@ def rebase_nixpkgs(
nixpkgs_repo.git.rebase(f"upstream/{branch_to_rebase}")
except GitCommandError:
logging.exception("nixpkgs rebase failed")
matrix_hookshot.send_notification(f"""\
update-nixpkgs: ERROR nixpkgs rebase failed for {branch_to_rebase}. Please resolve the conflict manually with the following commands:
```
cd nixpkgs
git fetch upstream
git fetch origin
git checkout -b {integration_branch} origin/{branch_to_rebase}
git rebase upstream/{branch_to_rebase}
git push origin {integration_branch}
```
""")
sys.exit(1)

# Check if there are new commits compared to the last day's integration branch.
Expand Down

0 comments on commit 7e62860

Please sign in to comment.