ci/github-script/prepare: qualify recommendation to retarget from nixos-*#528319
ci/github-script/prepare: qualify recommendation to retarget from nixos-*#528319GraysonTinker wants to merge 1 commit into
Conversation
That's not the intended behaviour. The condition Are you saying that that is not working? If so, we should fix it, not remove it. |
I phrased this rather confusingly, sorry for that. I've updated the original message. |
MattSturgeon
left a comment
There was a problem hiding this comment.
Concept SGTM now I've re-read your updated explanation. Sorry for the confusion.
I've also not tested, but the diff LGTM.
LMK if you do test this on a fork, or using the local test harness. The changes seem fairly simple though.
Will wait a while for further input. If nothing happens after a week or so, ping me and I'll merge at a time I can monitor and react.
Thanks for the improvement!
| const { stable, version } = baseClassification | ||
| const correctBranch = stable ? `release-${version}` : 'master' | ||
| const { version } = baseClassification | ||
| const stable = `release-${version}` |
There was a problem hiding this comment.
If a PR targets nixos-unstable, the value of this variable is release-unstable, which of course doesn't exist.
There was a problem hiding this comment.
It now says release-* or master when targeting nixos-unstable.
9603378 to
3ab1563
Compare
3ab1563 to
4743865
Compare
|
Here are tests: |
| 'The `nixos-*` and `nixpkgs-*` branches are pushed to by the channel release script and should not be merged into directly.', | ||
| '', | ||
| `Please target \`${correctBranch}\` instead.`, | ||
| `Make sure you know the [right base branch for your changes](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#branch-conventions), then target \`${releaseStable}\` or \`master\` instead.`, |
There was a problem hiding this comment.
I guess these PRs could be supposed to go to a staging branch, probably would be best to allow for that?
| `Make sure you know the [right base branch for your changes](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#branch-conventions), then target \`${releaseStable}\` or \`master\` instead.`, | |
| `Make sure you know the [right base branch for your changes](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#branch-conventions), then target the correct branch (probably \`${releaseStable}\` or \`master\`) instead.`, |
Currently the script unconditionally recommends that the PR be retargeted against stable if it was originally made against a stable nixos branch, which can be confusing for first-time contributors.
These PRs are always in error, and are usually made by first-time contributors who have not read CONTRIBUTING.md. Accordingly, we shouldn't expect them to know the differences between the stable and unstable branches. A recommendation of retargeting against stable is likely to cause confusion because it is presented as the absolutely correct choice.
Change the message to instead specify they should read the relevant documentation section.
Untested and done from my phone, so double-check everything's right.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.