Merge pull request #138480 from cdepillabout/merge-and-open-pr-fixes

haskell: update maintainer script for merging and opening PR to also upload package versions to Hackage
This commit is contained in:
Dennis Gosnell 2021-09-20 11:12:52 +09:00 committed by GitHub
commit d7692eb847
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 2 deletions

View file

@ -75,6 +75,10 @@ fi
echo "Merging https://github.com/NixOS/nixpkgs/pull/${curr_haskell_updates_pr_num}..."
gh pr merge --repo NixOS/nixpkgs --merge "$curr_haskell_updates_pr_num"
# Update the list of Haskell package versions in NixOS on Hackage.
echo "Updating list of Haskell package versions in NixOS on Hackage..."
./maintainers/scripts/haskell/upload-nixos-package-list-to-hackage.sh
# Update stackage, Hackage hashes, and regenerate Haskell package set
echo "Updating Stackage..."
./maintainers/scripts/haskell/update-stackage.sh --do-commit
@ -84,7 +88,7 @@ echo "Regenerating Hackage packages..."
./maintainers/scripts/haskell/regenerate-hackage-packages.sh --do-commit
# Push these new commits to the haskell-updates branch
echo "Pushing commits just created to the haskell-updates branch"
echo "Pushing commits just created to the remote haskell-updates branch..."
git push
# Open new PR
@ -114,5 +118,5 @@ This is the follow-up to #${curr_haskell_updates_pr_num}. Come to [#haskell:nixo
EOF
)
echo "Opening a PR for the next haskell-updates merge cycle"
echo "Opening a PR for the next haskell-updates merge cycle..."
gh pr create --repo NixOS/nixpkgs --base master --head haskell-updates --title "haskellPackages: update stackage and hackage" --body "$new_pr_body"

View file

@ -19,3 +19,4 @@ package_list="$(nix-build -A haskell.package-list)/nixos-hackage-packages.csv"
username=$(grep "^username:" ~/.cabal/config | sed "s/^username: //")
password_command=$(grep "^password-command:" ~/.cabal/config | sed "s/^password-command: //")
curl -u "$username:$($password_command | head -n1)" --digest -H "Content-type: text/csv" -T "$package_list" http://hackage.haskell.org/distro/NixOS/packages.csv
echo

View file

@ -206,13 +206,33 @@ opening the next one. When you want to merge the currently open
script uses the `gh` command to merge the current PR and open a new one.
You should only need to do this once.
This command can be used to authenticate:
```console
$ gh auth login
```
This command can be used to confirm that you have already authenticated:
```console
$ gh auth status
```
1. Make sure you have setup your `~/.cabal/config` file for authentication
for uploading the NixOS package versions to Hackage. See the following
section for details on how to do this.
1. Make sure you have correctly marked packages broken. One of the previous
sections explains how to do this.
In short:
```console
$ ./maintainers/scripts/haskell/hydra-report.hs get-report
$ ./maintainers/scripts/haskell/hydra-report.hs mark-broken-list
$ ./maintainers/scripts/haskell/mark-broken.sh --do-commit
```
1. Merge `master` into `haskell-updates` and make sure to push to the
`haskell-updates` branch. (This can be skipped if `master` has recently
been merged into `haskell-updates`.)
@ -238,6 +258,8 @@ opening the next one. When you want to merge the currently open
1. Merges the currently open `haskell-updates` PR.
1. Updates the version of Haskell packages in NixOS on Hackage.
1. Updates Stackage and Hackage snapshots. Regenerates the Haskell package set.
1. Pushes the commits updating Stackage and Hackage and opens a new