diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c0d04798..6208124f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -47,3 +47,26 @@ jobs: environments: lb-${{ matrix.package }} - name: Test with lowest direct dependencies run: pixi run -e lb-${{ matrix.package }} test ${{ matrix.package }} + + unpinned: + name: Unpinned Test ${{ matrix.package }} + strategy: + fail-fast: false + matrix: + package: + - essreduce + - essimaging + - essnmx + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + - uses: prefix-dev/setup-pixi@v0.9.4 + with: + cache: false + frozen: false + locked: false + environments: ess-unpinned + - name: Test with latest dependencies + run: pixi run -e ess-unpinned pytest packages/${{ matrix.package }}/tests diff --git a/pixi.toml b/pixi.toml index 85032c97..5675ff48 100644 --- a/pixi.toml +++ b/pixi.toml @@ -19,6 +19,12 @@ args = ["package"] # ==================== Package features ==================== +# ess-unpinned (All packages latest releases) +[feature.ess-unpinned.pypi-dependencies] +essreduce = { extras = ["test"] } +essimaging = { extras = ["test"] } +essnmx = { extras = ["test"] } + # essreduce (core package, no workspace deps) [feature.essreduce.pypi-dependencies] essreduce = { path = "packages/essreduce", editable = true, extras = ["test"] } @@ -74,6 +80,9 @@ lb-essreduce = { features = ["essreduce"], solve-group = "lower-bound" } lb-essimaging = { features = ["essimaging", "essreduce"], solve-group = "lower-bound" } lb-essnmx = { features = ["essnmx", "essreduce"], solve-group = "lower-bound" } +# Unpinned test environment +ess-unpinned = { features = ["ess-unpinned"], solve-group = "unpinned" } + # Docs environments (package with docs extra + pandoc) docs-essreduce = { features = ["docs-essreduce", "docs"], solve-group = "default" } docs-essimaging = { features = ["docs-essimaging", "docs-essreduce", "docs"], solve-group = "default" } diff --git a/tools/transfer-issues.sh b/tools/transfer-issues.sh new file mode 100755 index 00000000..ddf74eea --- /dev/null +++ b/tools/transfer-issues.sh @@ -0,0 +1,80 @@ +#!/bin/bash +# +# You need `gh` client and it needs to be authenticated before you run this script. +# It creates a label of the original repository name in both `ess*` and `ess` repository +# and assign the label to all issues to be transferred. +# And then it transfers all issues to `ess` repository. +# All links to the other issues from the original repo will be updated. +# It only finds 200 issues, which should be enough for all issues, +# but if you have more issues left, you may need to manually run the script again. + +RED='\033[0;31m' +BLUE='\033[0;34m' +GREEN='\033[0;32m' +NC='\033[0m' + +echo -e "${BLUE}Repository name${GREEN} to move issues from:${NC}" +read repo_name +echo -e "Transferring issues from ${GREEN}${repo_name}${NC} to the new ${RED}``ess``${NC} repository..." + +REPO_FLAG="-R scipp/${repo_name}" +numbers=$(gh issue list ${REPO_FLAG} --limit 200 --state all --json number -q ".[].number") + +labels_str=$(gh label list ${REPO_FLAG} --json name -q ".[].name") +labels=($labels_str) + +label_exist=0 +for label in "${labels[@]}"; do + if [[ $label = "${repo_name}" ]]; then + label_exist=1; + break; + fi +done +if [[ $label_exist = 0 ]]; then + echo -e "Label ${repo_name} does not exist. Creating one..."; + gh label create ${repo_name} ${REPO_FLAG} --description "Issues for ${repo_name}."; + # Creating the same label so that it will be kept after transfer. + gh label create ${repo_name} -R scipp/ess --description "Issues for ${repo_name}."; +else + echo -e "Label ${repo_name} exists. Assigning the labels to the issues to be moved..."; +fi + +for number in ${numbers}; +do + read -r -a issue_labels <<< $(gh issue view ${number} --json labels -q ".labels[].name" ${REPO_FLAG}); + issue_label_exist=0 + for issue_label in "${issue_labels[@]}"; do + if [[ ${issue_label} = ${repo_name} ]]; then + issue_label_exist=1; + break; + fi + done + + if [[ ${issue_label_exist} = 0 ]]; then + echo -e "Adding label ${BLUE}${repo_name}${NC} to issue #${GREEN}${number}${NC} ..."; + gh issue edit ${number} --add-label ${repo_name} ${REPO_FLAG}; + else + echo -e "Label ${BLUE}${repo_name}${NC} already assigned to issues #${GREEN}${number}${NC}."; + fi + +done + +num_issues=${#numbers[@]}; +if [[ ${num_issues} = 1 ]]; then + if [[ ${#numbers[0]} = 0 ]]; then + unset numbers[0]; + fi + num_issues=${#numbers[@]}; +fi + +if [[ ${num_issues} = 200 ]]; then + echo -e "Found ${RED}${num_issue}${NC} issues. There may be more issues left."; +fi + +echo "Transferring ${num_issues} issues..." +for number in ${numbers}; +do + echo -e "Transferring issue #${GREEN}${number}${NC} from ${BLUE}${repo_name}${NC} to ${RED}ess${NC} repository..."; + gh issue transfer ${number} scipp/ess ${REPO_FLAG}; +done +