From b6b9960a44630a5c637511ef4176a432b9eb0ead Mon Sep 17 00:00:00 2001 From: anissa111 Date: Fri, 27 Mar 2026 13:43:48 -0600 Subject: [PATCH 1/4] first pass at copy from comp implementation --- .github/upstream-failure-issue-template.md | 11 ++++ .github/workflows/upstream-dev-ci.yml | 64 +++++++++++++++++++++- 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 .github/upstream-failure-issue-template.md diff --git a/.github/upstream-failure-issue-template.md b/.github/upstream-failure-issue-template.md new file mode 100644 index 000000000..4b6a58fe8 --- /dev/null +++ b/.github/upstream-failure-issue-template.md @@ -0,0 +1,11 @@ +# Upstream testing failure + +**Workflow:** {{WORKFLOW}} +**Run:** [{{RUN_ID}}]({{RUN_URL}}) +**Date:** {{DATE}} + +Upstream testing has failed. + +Please check the [workflow run]({{RUN_URL}}) for details. + +This issue was automatically generated from the CI Upstream workflow. diff --git a/.github/workflows/upstream-dev-ci.yml b/.github/workflows/upstream-dev-ci.yml index 51a7d8b28..234595e16 100644 --- a/.github/workflows/upstream-dev-ci.yml +++ b/.github/workflows/upstream-dev-ci.yml @@ -12,13 +12,16 @@ jobs: upstream-dev: name: upstream-dev runs-on: ubuntu-latest + continue-on-error: true defaults: run: shell: bash -l {0} strategy: fail-fast: false matrix: - python-version: [ "3.12" ] + python-version: [ "3.13" ] + outputs: + testresults: ${{ steps.tests.outcome }} steps: - name: Checkout @@ -50,5 +53,64 @@ jobs: conda list - name: Running Tests + id: tests run: | python -m pytest test -v --cov=./uxarray --cov-report=xml + + failure-issue: + name: failure-issue + needs: [upstream-dev] + if: | + needs.upstream-dev.testresults != 'success' + runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} + steps: + - name: checkout + uses: actions/checkout@v6.0.2 + + - name: Create or update failure issue + shell: bash + run: | + # Read the template + template=$(cat .github/upstream-failure-issue-template.md) + + # Replace placeholders + issue_body="${template//\{\{WORKFLOW\}\}/${{ github.workflow }}}" + issue_body="${issue_body//\{\{RUN_ID\}\}/${{ github.run_id }}}" + issue_body="${issue_body//\{\{RUN_URL\}\}/${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}}" + issue_body="${issue_body//\{\{DATE\}\}/$(date -u)}" + + # Check for existing open issue with same title + issue_title="🤖 Upstream testing failure" + existing_issue=$(gh issue list --state open --label "CI" --search "\"$issue_title\" in:title" --json number --jq '.[0].number // empty') + + if [ -n "$existing_issue" ]; then + echo "Found existing open issue #$existing_issue, updating it..." + echo "$issue_body" | gh issue edit "$existing_issue" --body-file - + echo "Updated existing issue #$existing_issue" + else + echo "No existing open issue found, creating new one..." + echo "$issue_body" | gh issue create \ + --title "$issue_title" \ + --body-file - \ + --label "CI" + echo "Created new issue" + fi + env: + GH_TOKEN: ${{ github.token }} + + report-failed: + name: report-failed + needs: [ upstream-dev, failure-issue ] + if: ${{needs.upstream-dev.outputs.testresults != 'success'}} + runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} + steps: + - name: make sure to report a failed workflow + shell: bash + run: | + exit 1; From 663f611075bb4e907421f115d59a2d16878a85c4 Mon Sep 17 00:00:00 2001 From: anissa111 Date: Fri, 27 Mar 2026 13:46:45 -0600 Subject: [PATCH 2/4] narrow tests to one test, which i've made to fail --- .github/workflows/upstream-dev-ci.yml | 2 +- test/test_subset.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upstream-dev-ci.yml b/.github/workflows/upstream-dev-ci.yml index 234595e16..690eae5b0 100644 --- a/.github/workflows/upstream-dev-ci.yml +++ b/.github/workflows/upstream-dev-ci.yml @@ -55,7 +55,7 @@ jobs: - name: Running Tests id: tests run: | - python -m pytest test -v --cov=./uxarray --cov-report=xml + python -m pytest test/test_subset.py -k "test_da_subset" -v --cov=./uxarray --cov-report=xml failure-issue: name: failure-issue diff --git a/test/test_subset.py b/test/test_subset.py index adf5a660e..5808d034c 100644 --- a/test/test_subset.py +++ b/test/test_subset.py @@ -190,3 +190,4 @@ def test_da_subset(gridpath, datasetpath): res3 = uxds['t2m'].subset.nearest_neighbor(center_coord=(0, 0), k=4) assert len(res1) == len(res2) == len(res3) == 4 + assert False From 822c05611142d707c56c50efd7557a4b34b89ad0 Mon Sep 17 00:00:00 2001 From: anissa111 Date: Fri, 27 Mar 2026 14:01:01 -0600 Subject: [PATCH 3/4] un fail test to test non-failure condition --- test/test_subset.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_subset.py b/test/test_subset.py index 5808d034c..adf5a660e 100644 --- a/test/test_subset.py +++ b/test/test_subset.py @@ -190,4 +190,3 @@ def test_da_subset(gridpath, datasetpath): res3 = uxds['t2m'].subset.nearest_neighbor(center_coord=(0, 0), k=4) assert len(res1) == len(res2) == len(res3) == 4 - assert False From 38819124d2d659565279c95743cd219e3cf307ee Mon Sep 17 00:00:00 2001 From: anissa111 Date: Fri, 27 Mar 2026 14:07:04 -0600 Subject: [PATCH 4/4] nevermind, upstream failing on discovery, remove fork testing configs --- .github/workflows/upstream-dev-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upstream-dev-ci.yml b/.github/workflows/upstream-dev-ci.yml index 690eae5b0..fb40d888c 100644 --- a/.github/workflows/upstream-dev-ci.yml +++ b/.github/workflows/upstream-dev-ci.yml @@ -55,13 +55,15 @@ jobs: - name: Running Tests id: tests run: | - python -m pytest test/test_subset.py -k "test_da_subset" -v --cov=./uxarray --cov-report=xml + python -m pytest test -v --cov=./uxarray --cov-report=xml failure-issue: name: failure-issue needs: [upstream-dev] if: | needs.upstream-dev.testresults != 'success' + && github.repository == 'UXARRAY/uxarray' + && github.ref == 'refs/heads/main' runs-on: ubuntu-latest defaults: run: