mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
The python-updates branch is not a "development" branch in the sense of
ci/README.md's classification. That's because it allows force pushes.
When rewrites are possible, cherry-picking from this branch should not
be allowed, because the commit references will potentially end up out of
sync.
These kind of branches are now termed "Work-in-Progress" branches. Up
until recently these branches didn't work well for Pull Requests
targeting them, because Eval wouldn't run on them with a push event and
thus, Eval in the PR couldn't succeed either. That's now fixed, PRs
towards *any* WIP branch should work correctly.
(cherry picked from commit 55b046451c)
66 lines
1.6 KiB
JavaScript
Executable File
66 lines
1.6 KiB
JavaScript
Executable File
#!/usr/bin/env nix-shell
|
|
/*
|
|
#!nix-shell -i node -p nodejs
|
|
*/
|
|
|
|
const typeConfig = {
|
|
master: ['development', 'primary'],
|
|
release: ['development', 'primary'],
|
|
staging: ['development', 'secondary'],
|
|
'staging-next': ['development', 'secondary'],
|
|
'haskell-updates': ['development', 'secondary'],
|
|
nixos: ['channel'],
|
|
nixpkgs: ['channel'],
|
|
}
|
|
|
|
function split(branch) {
|
|
return {
|
|
...branch.match(
|
|
/(?<prefix>.+?)(-(?<version>\d{2}\.\d{2}|unstable)(?:-(?<suffix>.*))?)?$/,
|
|
).groups,
|
|
}
|
|
}
|
|
|
|
function classify(branch) {
|
|
const { prefix, version } = split(branch)
|
|
return {
|
|
stable: (version ?? 'unstable') !== 'unstable',
|
|
type: typeConfig[prefix] ?? ['wip'],
|
|
}
|
|
}
|
|
|
|
module.exports = { classify }
|
|
|
|
// If called directly via CLI, runs the following tests:
|
|
if (!module.parent) {
|
|
console.log('split(branch)')
|
|
function testSplit(branch) {
|
|
console.log(branch, split(branch))
|
|
}
|
|
testSplit('master')
|
|
testSplit('release-25.05')
|
|
testSplit('staging-next')
|
|
testSplit('staging-25.05')
|
|
testSplit('staging-next-25.05')
|
|
testSplit('nixpkgs-25.05-darwin')
|
|
testSplit('nixpkgs-unstable')
|
|
testSplit('haskell-updates')
|
|
testSplit('backport-123-to-release-25.05')
|
|
|
|
console.log('')
|
|
|
|
console.log('classify(branch)')
|
|
function testClassify(branch) {
|
|
console.log(branch, classify(branch))
|
|
}
|
|
testClassify('master')
|
|
testClassify('release-25.05')
|
|
testClassify('staging-next')
|
|
testClassify('staging-25.05')
|
|
testClassify('staging-next-25.05')
|
|
testClassify('nixpkgs-25.05-darwin')
|
|
testClassify('nixpkgs-unstable')
|
|
testClassify('haskell-updates')
|
|
testClassify('backport-123-to-release-25.05')
|
|
}
|