From b5143fa7493d60542a42287a99d287d2d5baa17b Mon Sep 17 00:00:00 2001 From: alexbenedicto Date: Fri, 1 Aug 2025 10:51:29 -0700 Subject: [PATCH 01/12] Add geos integration test --- .github/workflows/python-package.yml | 240 ++++++++++++++++++++++++++- 1 file changed, 238 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 8ae0563e..faab0cd6 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -49,7 +49,6 @@ jobs: - geos-trame - geos-utils - geos-xml-tools - - geos-xml-viewer - hdf5-wrapper - pygeos-tools include: @@ -98,4 +97,241 @@ jobs: run: # python -m pytest ./${{ matrix.package-name }} --doctest-modules --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html | # wrap pytest to avoid error when no tests in the package - sh -c 'python -m pytest ./${{ matrix.package-name }}; ret=$?; [ $ret = 5 ] && exit 0 || exit $ret' \ No newline at end of file + sh -c 'python -m pytest ./${{ matrix.package-name }}; ret=$?; [ $ret = 5 ] && exit 0 || exit $ret' + + # Step 1: Validate that all standard CI tests pass BEFORE checking GEOS integration + validate_standard_ci: + runs-on: ubuntu-latest + needs: [semantic_pull_request, build] + steps: + - name: Check standard CI results + run: | + echo "Checking standard CI results..." + echo "Semantic PR check: ${{ needs.semantic_pull_request.result }}" + echo "Build and test: ${{ needs.build.result }}" + + # All standard tests must pass before proceeding + if [[ "${{ needs.semantic_pull_request.result }}" != "success" ]]; then + echo "❌ Semantic PR check failed - fix PR title before proceeding" + exit 1 + fi + + if [[ "${{ needs.build.result }}" != "success" ]]; then + echo "❌ Build and test failed - fix code issues before proceeding" + exit 1 + fi + + echo "✅ All standard CI tests passed! Ready for GEOS integration testing." + + # Step 2: Only after standard tests pass, check for GEOS integration label + check_geos_integration_label: + runs-on: ubuntu-latest + needs: [validate_standard_ci] + outputs: + should_test_geos: ${{ steps.check_label.outputs.should_test_geos }} + has_label: ${{ steps.check_label.outputs.has_label }} + steps: + - name: Check for GEOS integration test label + id: check_label + run: | + echo "Standard CI tests have passed. Now checking for GEOS integration requirements..." + + # Check if the PR has the 'test-geos-integration' label + pr_json=$(curl -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}) + + LABELS=$(echo ${pr_json} | jq -r '[.labels[].name] | join(",")') + echo "PR labels: ${LABELS}" + + if [[ "${LABELS}" == *"test-geos-integration"* ]]; then + echo "has_label=true" >> $GITHUB_OUTPUT + echo "should_test_geos=true" >> $GITHUB_OUTPUT + echo "✅ Found 'test-geos-integration' label - will proceed with GEOS integration testing" + else + echo "has_label=false" >> $GITHUB_OUTPUT + echo "should_test_geos=false" >> $GITHUB_OUTPUT + echo "❌ Missing 'test-geos-integration' label" + echo "" + echo "REQUIRED: This PR must have the 'test-geos-integration' label to be merged" + echo "This ensures that changes are tested against GEOS before merging" + echo "" + echo "To add the label:" + echo "1. Go to your PR page" + echo "2. Click on 'Labels' in the right sidebar" + echo "3. Add the 'test-geos-integration' label" + fi + + # Step 3: Only trigger GEOS integration if label exists AND standard tests passed + trigger_geos_integration_test: + runs-on: ubuntu-latest + needs: [check_geos_integration_label] + if: needs.check_geos_integration_label.outputs.should_test_geos == 'true' + outputs: + workflow_run_id: ${{ steps.trigger_workflow.outputs.workflow_run_id }} + steps: + - name: Get PR information + id: pr_info + run: | + echo "Triggering GEOS integration test..." + pr_json=$(curl -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}) + + PR_HEAD_REPO=$(echo ${pr_json} | jq -r '.head.repo.clone_url') + PR_HEAD_BRANCH=$(echo ${pr_json} | jq -r '.head.ref') + PR_HEAD_SHA=$(echo ${pr_json} | jq -r '.head.sha') + + echo "pr_repo=${PR_HEAD_REPO}" >> $GITHUB_OUTPUT + echo "pr_branch=${PR_HEAD_BRANCH}" >> $GITHUB_OUTPUT + echo "pr_sha=${PR_HEAD_SHA}" >> $GITHUB_OUTPUT + + echo "PR Repository: ${PR_HEAD_REPO}" + echo "PR Branch: ${PR_HEAD_BRANCH}" + echo "PR SHA: ${PR_HEAD_SHA}" + + - name: Trigger GEOS integration test workflow + id: trigger_workflow + run: | + echo "All standard tests passed ✅" + echo "GEOS integration label found ✅" + echo "Now triggering GEOS integration test workflow..." + + # Trigger the workflow_dispatch event in the GEOS repository + response=$(curl -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/GEOS-DEV/GEOS/actions/workflows/test_geospythonpackages_integration.yml/dispatches \ + -d '{ + "ref": "develop", + "inputs": { + "python_package_repo": "${{ steps.pr_info.outputs.pr_repo }}", + "python_package_branch": "${{ steps.pr_info.outputs.pr_branch }}", + "python_package_pr": "${{ github.event.number }}", + "requested_by": "${{ github.actor }}" + } + }') + + echo "Workflow dispatch response: $response" + echo "✅ GEOS integration test workflow triggered successfully" + + # Wait a moment for the workflow to start, then find the run ID + sleep 10 + + # Get the latest workflow runs to find our triggered run + runs_response=$(curl -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ + https://api.github.com/repos/GEOS-DEV/GEOS/actions/workflows/test_geospythonpackages_integration.yml/runs?per_page=5) + + # Find the most recent run (this assumes it's our triggered run) + workflow_run_id=$(echo "$runs_response" | jq -r '.workflow_runs[0].id') + echo "workflow_run_id=${workflow_run_id}" >> $GITHUB_OUTPUT + echo "Triggered workflow run ID: ${workflow_run_id}" + + # Step 4: Wait for GEOS integration results (only if triggered) + wait_for_geos_integration_result: + runs-on: ubuntu-latest + needs: [trigger_geos_integration_test] + if: needs.trigger_geos_integration_test.outputs.workflow_run_id != '' + outputs: + geos_test_result: ${{ steps.wait_for_result.outputs.geos_test_result }} + steps: + - name: Wait for GEOS integration test to complete + id: wait_for_result + run: | + WORKFLOW_RUN_ID="${{ needs.trigger_geos_integration_test.outputs.workflow_run_id }}" + echo "Waiting for GEOS integration test to complete (Run ID: ${WORKFLOW_RUN_ID})..." + echo "This may take 15-30 minutes..." + + # Wait for the workflow to complete (with timeout) + timeout=1800 # 30 minutes + elapsed=0 + interval=30 + + while [ $elapsed -lt $timeout ]; do + run_status=$(curl -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ + https://api.github.com/repos/GEOS-DEV/GEOS/actions/runs/${WORKFLOW_RUN_ID} \ + | jq -r '.status') + + conclusion=$(curl -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ + https://api.github.com/repos/GEOS-DEV/GEOS/actions/runs/${WORKFLOW_RUN_ID} \ + | jq -r '.conclusion') + + echo "Workflow status: ${run_status}, conclusion: ${conclusion} (${elapsed}s elapsed)" + + if [[ "${run_status}" == "completed" ]]; then + echo "Workflow completed with conclusion: ${conclusion}" + + if [[ "${conclusion}" == "success" ]]; then + echo "✅ GEOS integration test PASSED" + echo "geos_test_result=success" >> $GITHUB_OUTPUT + exit 0 + else + echo "❌ GEOS integration test FAILED" + echo "geos_test_result=failure" >> $GITHUB_OUTPUT + exit 1 + fi + fi + + sleep $interval + elapsed=$((elapsed + interval)) + done + + echo "❌ TIMEOUT: GEOS integration test did not complete within ${timeout} seconds" + echo "geos_test_result=timeout" >> $GITHUB_OUTPUT + exit 1 + + # Step 5: Final validation - requires ALL tests to pass + final_validation: + runs-on: ubuntu-latest + needs: [check_geos_integration_label, wait_for_geos_integration_result] + if: always() + steps: + - name: Final merge validation + run: | + echo "=== FINAL MERGE VALIDATION ===" + echo "" + echo "Standard CI Tests: ✅ PASSED (already validated)" + echo "GEOS Integration Label: ${{ needs.check_geos_integration_label.outputs.has_label == 'true' && '✅ PRESENT' || '❌ MISSING' }}" + echo "GEOS Integration Tests: ${{ needs.wait_for_geos_integration_result.outputs.geos_test_result == 'success' && '✅ PASSED' || needs.wait_for_geos_integration_result.result == 'skipped' && '⏭️ SKIPPED (no label)' || '❌ FAILED' }}" + echo "" + + # Check label requirement + if [[ "${{ needs.check_geos_integration_label.outputs.has_label }}" != "true" ]]; then + echo "❌ INVALID: Missing 'test-geos-integration' label" + echo "" + echo "This PR cannot be merged without the 'test-geos-integration' label" + echo "Please add the label and wait for GEOS integration tests to pass" + exit 1 + fi + + # Check GEOS test results (only if they were supposed to run) + if [[ "${{ needs.wait_for_geos_integration_result.result }}" == "failure" || "${{ needs.wait_for_geos_integration_result.outputs.geos_test_result }}" == "failure" ]]; then + echo "❌ INVALID: GEOS integration tests failed" + echo "" + echo "The changes in this PR break GEOS functionality" + echo "Please check the GEOS workflow logs and fix the issues" + echo "GEOS workflow: https://github.com/GEOS-DEV/GEOS/actions/runs/${{ needs.trigger_geos_integration_test.outputs.workflow_run_id }}" + exit 1 + fi + + if [[ "${{ needs.wait_for_geos_integration_result.outputs.geos_test_result }}" == "timeout" ]]; then + echo "❌ INVALID: GEOS integration tests timed out" + echo "" + echo "Please check the GEOS workflow manually and re-run if needed" + echo "GEOS workflow: https://github.com/GEOS-DEV/GEOS/actions/runs/${{ needs.trigger_geos_integration_test.outputs.workflow_run_id }}" + exit 1 + fi + + # All validations passed + echo "✅ VALID: All requirements met" + echo "" + echo "This PR is ready for review and merge:" + echo " ✅ Standard CI tests passed" + echo " ✅ 'test-geos-integration' label present" + echo " ✅ GEOS integration tests passed" + echo "" + echo "🎉 Ready for merge!" \ No newline at end of file From ca53a7f99a9bfa526270a95b22cb2285df5ba4e0 Mon Sep 17 00:00:00 2001 From: alexbenedicto Date: Fri, 1 Aug 2025 13:08:19 -0700 Subject: [PATCH 02/12] Add documentation for geos integration testing --- GEOS_INTEGRATION_TESTING.md | 190 ++++++++++++++++++++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 GEOS_INTEGRATION_TESTING.md diff --git a/GEOS_INTEGRATION_TESTING.md b/GEOS_INTEGRATION_TESTING.md new file mode 100644 index 00000000..1d2e1476 --- /dev/null +++ b/GEOS_INTEGRATION_TESTING.md @@ -0,0 +1,190 @@ +# geosPythonPackages and GEOS Integration Testing + +This document explains the new CI requirements for geosPythonPackages contributors to ensure compatibility with GEOS. + +## ⚠️ IMPORTANT: New CI Requirements + +Starting now, all PRs to geosPythonPackages **MUST** pass GEOS integration testing before they can be merged. + +## Quick Start Guide + +### For Every PR, you must: + +1. ✅ **Ensure standard CI tests pass first** (semantic check, build, lint, test) +2. ✅ **Add the `test-geos-integration` label** to your PR (only after standard tests pass) +3. ✅ **Wait for GEOS integration tests** to pass +4. ✅ **Fix any issues** if GEOS tests fail + +## The Complete Workflow Sequence + +The CI now follows this **strict sequence**: + +### 1️⃣ Standard CI Tests (MUST pass first) +- ✅ Semantic PR title check +- ✅ Build and install all packages +- ✅ Lint with yapf +- ✅ Test with pytest + +**⚠️ Until these pass, GEOS integration testing will NOT start** + +### 2️⃣ Label Check (after standard tests pass) +- 🏷️ Check for `test-geos-integration` label +- ❌ **FAIL** if label is missing +- ✅ **PROCEED** if label is present + +### 3️⃣ GEOS Integration Testing (triggered automatically) +- 🔗 Trigger GEOS CI with your branch +- ⏱️ Wait for GEOS tests to complete (15-30 minutes) +- ✅ **PASS** if GEOS tests succeed +- ❌ **FAIL** if GEOS tests fail + +### 4️⃣ Final Validation +- ✅ **VALID** = Standard tests ✅ + Label ✅ + GEOS tests ✅ +- ❌ **INVALID** = Any step fails + +## Developer Workflow + +### Step-by-Step Process: + +#### 1. Create Your PR and Iterate +```bash +# Create your branch and make changes +git checkout -b fix/my-awesome-feature +# ... make changes ... +git push origin fix/my-awesome-feature +``` + +#### 2. Wait for Standard CI to Pass +- **Don't add the label yet!** +- Let the standard CI tests run first +- Fix any issues with: + - PR title formatting + - Build errors + - Lint issues + - Test failures +- Push fixes and wait for tests to pass + +#### 3. Add Label (Only After Standard Tests Pass) +- Go to your PR page +- In the right sidebar, find "Labels" +- Add the label: `test-geos-integration` +- This triggers the GEOS integration sequence + +#### 4. Monitor GEOS Integration Results +- The workflow will automatically trigger GEOS CI +- You'll see progress in the "geosPythonPackages CI" workflow +- Wait for results (can take 15-30 minutes) + +#### 5. Address Any GEOS Failures +If GEOS integration fails: +- Check the workflow logs for details +- Fix the issues in your branch +- Push the fixes +- The process will restart from step 1 + +## What Gets Tested in GEOS Integration + +The GEOS integration test validates: +- ✅ geosPythonPackages can be installed by GEOS +- ✅ Key tools work: `preprocess_xml`, `format_xml`, `mesh-doctor` +- ✅ Python packages can be imported: `geos_utils`, `geos_mesh`, etc. +- ✅ XML preprocessing functionality works +- ✅ No API breaking changes + +## Understanding CI Results + +### ✅ VALID (Green) ✅ +All requirements met: +- Standard CI tests passed +- `test-geos-integration` label present +- GEOS integration tests passed +- **Ready for review/merge** + +### ❌ INVALID (Red) ❌ +One or more requirements failed: +- Standard CI tests failed +- Label missing +- GEOS integration tests failed +- **Cannot be merged** + +## Common Scenarios + +### Scenario 1: Standard Tests Failing +``` +❌ Standard CI Tests → ⏸️ Label Check Skipped → ⏸️ GEOS Tests Skipped +``` +**Action**: Fix your code first, don't add the label yet + +### Scenario 2: Standard Tests Pass, No Label +``` +✅ Standard CI Tests → ❌ Label Missing → ⏸️ GEOS Tests Skipped +``` +**Action**: Add the `test-geos-integration` label + +### Scenario 3: All Standard Tests Pass, Label Added +``` +✅ Standard CI Tests → ✅ Label Present → 🔄 GEOS Tests Running +``` +**Action**: Wait for GEOS tests to complete + +### Scenario 4: GEOS Tests Fail +``` +✅ Standard CI Tests → ✅ Label Present → ❌ GEOS Tests Failed +``` +**Action**: Fix the breaking changes, push updates + +### Scenario 5: Everything Passes +``` +✅ Standard CI Tests → ✅ Label Present → ✅ GEOS Tests Passed → ✅ READY +``` +**Action**: Proceed with normal code review + +## Benefits of This Approach + +1. **🚀 Faster Iteration**: Fix basic issues first without expensive GEOS testing +2. **💰 Cost Efficient**: Only run GEOS CI when standard tests pass +3. **🎯 Clear Sequence**: Developers know exactly when to add the label +4. **🛡️ Protected GEOS**: No breaking changes reach GEOS +5. **📈 Better Feedback**: Clear status at each step + +## Tips for Contributors + +### DO ✅ +- ✅ Let standard CI pass completely before adding the label +- ✅ Fix all basic issues (build, lint, test) first +- ✅ Add the label only when standard tests are green +- ✅ Monitor the GEOS integration progress +- ✅ Fix GEOS-related issues promptly + +### DON'T ❌ +- ❌ Add the label immediately when creating the PR +- ❌ Add the label while standard tests are still failing +- ❌ Ignore GEOS test failures +- ❌ Remove and re-add the label unnecessarily + +## Getting Help + +### If you need help: +1. Check the workflow logs for specific error messages +2. Look at the [detailed documentation](https://github.com/GEOS-DEV/GEOS/blob/develop/src/docs/GEOS_PYTHON_INTEGRATION_TESTING.md) +3. Ask in the GEOS-DEV team channels + +### Manual Testing: +You can manually trigger GEOS integration testing: +1. Go to [GEOS Actions](https://github.com/GEOS-DEV/GEOS/actions) +2. Find "Test GEOS Integration from geosPythonPackages" +3. Click "Run workflow" and specify your branch + +## Summary + +| Step | Status | Next Action | +|------|--------|-------------| +| 1. Standard CI | ❌ Failed | Fix code issues | +| 1. Standard CI | ✅ Passed | Add `test-geos-integration` label | +| 2. Label Check | ❌ Missing | Add the label | +| 2. Label Check | ✅ Present | Wait for GEOS tests | +| 3. GEOS Tests | 🔄 Running | Wait (15-30 min) | +| 3. GEOS Tests | ❌ Failed | Fix breaking changes | +| 3. GEOS Tests | ✅ Passed | Ready for review! | + +**Remember**: The sequence is strictly enforced - standard tests MUST pass before GEOS integration testing begins! From eca4fe02ca37e4c55f01ff42ae012457e516c94f Mon Sep 17 00:00:00 2001 From: alexbenedicto Date: Wed, 6 Aug 2025 10:22:32 -0700 Subject: [PATCH 03/12] Add permissions and avoid silent fail of curl command --- .github/workflows/python-package.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index faab0cd6..f1c3ea6c 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -127,6 +127,8 @@ jobs: check_geos_integration_label: runs-on: ubuntu-latest needs: [validate_standard_ci] + permissions: + pull-requests: read outputs: should_test_geos: ${{ steps.check_label.outputs.should_test_geos }} has_label: ${{ steps.check_label.outputs.has_label }} @@ -167,17 +169,21 @@ jobs: runs-on: ubuntu-latest needs: [check_geos_integration_label] if: needs.check_geos_integration_label.outputs.should_test_geos == 'true' + permissions: + pull-requests: read outputs: workflow_run_id: ${{ steps.trigger_workflow.outputs.workflow_run_id }} steps: - name: Get PR information id: pr_info run: | + set -e # Exit immediately if a command exits with a non-zero status. echo "Triggering GEOS integration test..." - pr_json=$(curl -H "Accept: application/vnd.github+json" \ + pr_json=$(curl -fsSL -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ - https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}) + "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}") + LABELS=$(echo "${pr_json}" | jq -r '[.labels[].name] | join(",")') PR_HEAD_REPO=$(echo ${pr_json} | jq -r '.head.repo.clone_url') PR_HEAD_BRANCH=$(echo ${pr_json} | jq -r '.head.ref') PR_HEAD_SHA=$(echo ${pr_json} | jq -r '.head.sha') From f316ee85bdf64ac72834a89d53bd2d9fcde6da01 Mon Sep 17 00:00:00 2001 From: alexbenedicto Date: Wed, 6 Aug 2025 11:13:43 -0700 Subject: [PATCH 04/12] Move silent fail catch and hardcode GEOS-DEV branch to test against --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index f1c3ea6c..d717c922 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -136,6 +136,7 @@ jobs: - name: Check for GEOS integration test label id: check_label run: | + set -e # Exit immediately if a command exits with a non-zero status. echo "Standard CI tests have passed. Now checking for GEOS integration requirements..." # Check if the PR has the 'test-geos-integration' label @@ -177,7 +178,6 @@ jobs: - name: Get PR information id: pr_info run: | - set -e # Exit immediately if a command exits with a non-zero status. echo "Triggering GEOS integration test..." pr_json=$(curl -fsSL -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ @@ -210,7 +210,7 @@ jobs: -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/GEOS-DEV/GEOS/actions/workflows/test_geospythonpackages_integration.yml/dispatches \ -d '{ - "ref": "develop", + "ref": "ci/benedicto/testGeosPythonPackagesIntegration", "inputs": { "python_package_repo": "${{ steps.pr_info.outputs.pr_repo }}", "python_package_branch": "${{ steps.pr_info.outputs.pr_branch }}", From eff6f71fe78fb4452a192a0f9fa767333b8b9ad7 Mon Sep 17 00:00:00 2001 From: alexbenedicto Date: Wed, 6 Aug 2025 11:39:57 -0700 Subject: [PATCH 05/12] Make check_geos_integration_label test fail when no label --- .github/workflows/python-package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d717c922..5352e0d2 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -163,6 +163,7 @@ jobs: echo "1. Go to your PR page" echo "2. Click on 'Labels' in the right sidebar" echo "3. Add the 'test-geos-integration' label" + exit 1 fi # Step 3: Only trigger GEOS integration if label exists AND standard tests passed From a2f66e890a620dacd628d79d0e40162c994da3ee Mon Sep 17 00:00:00 2001 From: alexbenedicto Date: Wed, 6 Aug 2025 14:13:03 -0700 Subject: [PATCH 06/12] Add more error handling in curl commands --- .github/workflows/python-package.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 5352e0d2..34419565 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -140,7 +140,8 @@ jobs: echo "Standard CI tests have passed. Now checking for GEOS integration requirements..." # Check if the PR has the 'test-geos-integration' label - pr_json=$(curl -H "Accept: application/vnd.github+json" \ + # -fsS gives Fails on Error (f), Silent on Success (s), Shows Error Message (S) + pr_json=$(curl -fsS -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}) @@ -200,12 +201,13 @@ jobs: - name: Trigger GEOS integration test workflow id: trigger_workflow run: | + set -e echo "All standard tests passed ✅" echo "GEOS integration label found ✅" echo "Now triggering GEOS integration test workflow..." # Trigger the workflow_dispatch event in the GEOS repository - response=$(curl -X POST \ + response=$(curl -fsS -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ @@ -227,7 +229,7 @@ jobs: sleep 10 # Get the latest workflow runs to find our triggered run - runs_response=$(curl -H "Accept: application/vnd.github+json" \ + runs_response=$(curl -fsS -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ https://api.github.com/repos/GEOS-DEV/GEOS/actions/workflows/test_geospythonpackages_integration.yml/runs?per_page=5) From ef4304ab0462747a00121c55a6710116913853f0 Mon Sep 17 00:00:00 2001 From: alexbenedicto Date: Mon, 11 Aug 2025 17:44:37 -0700 Subject: [PATCH 07/12] Try different triggering approach --- .github/workflows/python-package.yml | 106 ++++++++++++++++++--------- 1 file changed, 73 insertions(+), 33 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 34419565..e7bfe3e5 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -204,70 +204,110 @@ jobs: set -e echo "All standard tests passed ✅" echo "GEOS integration label found ✅" - echo "Now triggering GEOS integration test workflow..." + echo "Now triggering GEOS integration test via repository dispatch..." - # Trigger the workflow_dispatch event in the GEOS repository + # Use repository dispatch to trigger the integration test + # This will create a repository_dispatch event that can be handled by any branch response=$(curl -fsS -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/GEOS-DEV/GEOS/actions/workflows/test_geospythonpackages_integration.yml/dispatches \ + https://api.github.com/repos/GEOS-DEV/GEOS/dispatches \ -d '{ - "ref": "ci/benedicto/testGeosPythonPackagesIntegration", - "inputs": { + "event_type": "python-package-integration-test", + "client_payload": { + "target_branch": "ci/benedicto/testGeosPythonPackagesIntegration", "python_package_repo": "${{ steps.pr_info.outputs.pr_repo }}", "python_package_branch": "${{ steps.pr_info.outputs.pr_branch }}", "python_package_pr": "${{ github.event.number }}", - "requested_by": "${{ github.actor }}" + "requested_by": "${{ github.actor }}", + "pr_sha": "${{ steps.pr_info.outputs.pr_sha }}" } }') - echo "Workflow dispatch response: $response" - echo "✅ GEOS integration test workflow triggered successfully" + echo "Repository dispatch response: $response" + echo "✅ GEOS integration test triggered successfully via repository dispatch" + echo "Target branch: ci/benedicto/testGeosPythonPackagesIntegration" + echo "Python package repo: ${{ steps.pr_info.outputs.pr_repo }}" + echo "Python package branch: ${{ steps.pr_info.outputs.pr_branch }}" - # Wait a moment for the workflow to start, then find the run ID - sleep 10 - - # Get the latest workflow runs to find our triggered run - runs_response=$(curl -fsS -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ - https://api.github.com/repos/GEOS-DEV/GEOS/actions/workflows/test_geospythonpackages_integration.yml/runs?per_page=5) - - # Find the most recent run (this assumes it's our triggered run) - workflow_run_id=$(echo "$runs_response" | jq -r '.workflow_runs[0].id') - echo "workflow_run_id=${workflow_run_id}" >> $GITHUB_OUTPUT - echo "Triggered workflow run ID: ${workflow_run_id}" + # For repository dispatch, we can't immediately get a run ID + # We'll need to wait and search for runs with our payload data + echo "workflow_run_id=dispatch_triggered" >> $GITHUB_OUTPUT # Step 4: Wait for GEOS integration results (only if triggered) wait_for_geos_integration_result: runs-on: ubuntu-latest needs: [trigger_geos_integration_test] - if: needs.trigger_geos_integration_test.outputs.workflow_run_id != '' + if: needs.trigger_geos_integration_test.outputs.workflow_run_id == 'dispatch_triggered' outputs: geos_test_result: ${{ steps.wait_for_result.outputs.geos_test_result }} steps: - name: Wait for GEOS integration test to complete id: wait_for_result run: | - WORKFLOW_RUN_ID="${{ needs.trigger_geos_integration_test.outputs.workflow_run_id }}" - echo "Waiting for GEOS integration test to complete (Run ID: ${WORKFLOW_RUN_ID})..." + echo "Waiting for GEOS integration test to complete via repository dispatch..." echo "This may take 15-30 minutes..." - # Wait for the workflow to complete (with timeout) + # Wait for the workflow to start and complete (with timeout) timeout=1800 # 30 minutes elapsed=0 - interval=30 + interval=60 # Check every minute for repository dispatch + found_run=false + workflow_run_id="" + # First, wait for the workflow to appear (up to 5 minutes) + echo "Looking for triggered workflow run..." + search_timeout=300 # 5 minutes to find the workflow + search_elapsed=0 + + while [ $search_elapsed -lt $search_timeout ] && [ "$found_run" == "false" ]; do + echo "Searching for workflow run... (${search_elapsed}s elapsed)" + + # Look for recent workflow runs of our dispatch workflow + runs_response=$(curl -fsS -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ + "https://api.github.com/repos/GEOS-DEV/GEOS/actions/workflows/python_package_integration_dispatch.yml/runs?per_page=10&created=>$(date -d '10 minutes ago' -Iseconds)") + + # Look for a run that was triggered recently and is for our PR + for run_id in $(echo "$runs_response" | jq -r '.workflow_runs[].id'); do + run_details=$(curl -fsS -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ + "https://api.github.com/repos/GEOS-DEV/GEOS/actions/runs/${run_id}") + + # Check if this run is for our PR (by checking timing and trigger) + trigger_event=$(echo "$run_details" | jq -r '.event') + if [[ "$trigger_event" == "repository_dispatch" ]]; then + echo "Found repository dispatch workflow run: ${run_id}" + workflow_run_id="$run_id" + found_run=true + break + fi + done + + if [ "$found_run" == "false" ]; then + sleep 30 + search_elapsed=$((search_elapsed + 30)) + fi + done + + if [ "$found_run" == "false" ]; then + echo "❌ Could not find triggered workflow run within ${search_timeout} seconds" + echo "geos_test_result=not_found" >> $GITHUB_OUTPUT + exit 1 + fi + + echo "✅ Found workflow run: ${workflow_run_id}" + echo "Now waiting for completion..." + + # Now wait for completion while [ $elapsed -lt $timeout ]; do - run_status=$(curl -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ - https://api.github.com/repos/GEOS-DEV/GEOS/actions/runs/${WORKFLOW_RUN_ID} \ - | jq -r '.status') + run_details=$(curl -fsS -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ + "https://api.github.com/repos/GEOS-DEV/GEOS/actions/runs/${workflow_run_id}") - conclusion=$(curl -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ - https://api.github.com/repos/GEOS-DEV/GEOS/actions/runs/${WORKFLOW_RUN_ID} \ - | jq -r '.conclusion') + run_status=$(echo "$run_details" | jq -r '.status') + conclusion=$(echo "$run_details" | jq -r '.conclusion') echo "Workflow status: ${run_status}, conclusion: ${conclusion} (${elapsed}s elapsed)" From 40ece5ebc014e02054eb29fa051b3a6978f5b2a7 Mon Sep 17 00:00:00 2001 From: alexbenedicto Date: Thu, 14 Aug 2025 08:24:34 -0700 Subject: [PATCH 08/12] Back to previous triggering, needs merge in GEOS develop to be tested against --- .github/workflows/python-package.yml | 106 +++++++++------------------ 1 file changed, 33 insertions(+), 73 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index e7bfe3e5..5464a5e9 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -204,110 +204,70 @@ jobs: set -e echo "All standard tests passed ✅" echo "GEOS integration label found ✅" - echo "Now triggering GEOS integration test via repository dispatch..." + echo "Now triggering GEOS integration test workflow..." - # Use repository dispatch to trigger the integration test - # This will create a repository_dispatch event that can be handled by any branch + # Trigger the workflow_dispatch event in the GEOS repository response=$(curl -fsS -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/GEOS-DEV/GEOS/dispatches \ + https://api.github.com/repos/GEOS-DEV/GEOS/actions/workflows/test_geospythonpackages_integration.yml/dispatches \ -d '{ - "event_type": "python-package-integration-test", - "client_payload": { - "target_branch": "ci/benedicto/testGeosPythonPackagesIntegration", + "ref": "develop", + "inputs": { "python_package_repo": "${{ steps.pr_info.outputs.pr_repo }}", "python_package_branch": "${{ steps.pr_info.outputs.pr_branch }}", "python_package_pr": "${{ github.event.number }}", - "requested_by": "${{ github.actor }}", - "pr_sha": "${{ steps.pr_info.outputs.pr_sha }}" + "requested_by": "${{ github.actor }}" } }') - echo "Repository dispatch response: $response" - echo "✅ GEOS integration test triggered successfully via repository dispatch" - echo "Target branch: ci/benedicto/testGeosPythonPackagesIntegration" - echo "Python package repo: ${{ steps.pr_info.outputs.pr_repo }}" - echo "Python package branch: ${{ steps.pr_info.outputs.pr_branch }}" + echo "Workflow dispatch response: $response" + echo "✅ GEOS integration test workflow triggered successfully" - # For repository dispatch, we can't immediately get a run ID - # We'll need to wait and search for runs with our payload data - echo "workflow_run_id=dispatch_triggered" >> $GITHUB_OUTPUT + # Wait a moment for the workflow to start, then find the run ID + sleep 10 + + # Get the latest workflow runs to find our triggered run + runs_response=$(curl -fsS -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ + https://api.github.com/repos/GEOS-DEV/GEOS/actions/workflows/test_geospythonpackages_integration.yml/runs?per_page=5) + + # Find the most recent run (this assumes it's our triggered run) + workflow_run_id=$(echo "$runs_response" | jq -r '.workflow_runs[0].id') + echo "workflow_run_id=${workflow_run_id}" >> $GITHUB_OUTPUT + echo "Triggered workflow run ID: ${workflow_run_id}" # Step 4: Wait for GEOS integration results (only if triggered) wait_for_geos_integration_result: runs-on: ubuntu-latest needs: [trigger_geos_integration_test] - if: needs.trigger_geos_integration_test.outputs.workflow_run_id == 'dispatch_triggered' + if: needs.trigger_geos_integration_test.outputs.workflow_run_id != '' outputs: geos_test_result: ${{ steps.wait_for_result.outputs.geos_test_result }} steps: - name: Wait for GEOS integration test to complete id: wait_for_result run: | - echo "Waiting for GEOS integration test to complete via repository dispatch..." + WORKFLOW_RUN_ID="${{ needs.trigger_geos_integration_test.outputs.workflow_run_id }}" + echo "Waiting for GEOS integration test to complete (Run ID: ${WORKFLOW_RUN_ID})..." echo "This may take 15-30 minutes..." - # Wait for the workflow to start and complete (with timeout) + # Wait for the workflow to complete (with timeout) timeout=1800 # 30 minutes elapsed=0 - interval=60 # Check every minute for repository dispatch - found_run=false - workflow_run_id="" + interval=60 - # First, wait for the workflow to appear (up to 5 minutes) - echo "Looking for triggered workflow run..." - search_timeout=300 # 5 minutes to find the workflow - search_elapsed=0 - - while [ $search_elapsed -lt $search_timeout ] && [ "$found_run" == "false" ]; do - echo "Searching for workflow run... (${search_elapsed}s elapsed)" - - # Look for recent workflow runs of our dispatch workflow - runs_response=$(curl -fsS -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ - "https://api.github.com/repos/GEOS-DEV/GEOS/actions/workflows/python_package_integration_dispatch.yml/runs?per_page=10&created=>$(date -d '10 minutes ago' -Iseconds)") - - # Look for a run that was triggered recently and is for our PR - for run_id in $(echo "$runs_response" | jq -r '.workflow_runs[].id'); do - run_details=$(curl -fsS -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ - "https://api.github.com/repos/GEOS-DEV/GEOS/actions/runs/${run_id}") - - # Check if this run is for our PR (by checking timing and trigger) - trigger_event=$(echo "$run_details" | jq -r '.event') - if [[ "$trigger_event" == "repository_dispatch" ]]; then - echo "Found repository dispatch workflow run: ${run_id}" - workflow_run_id="$run_id" - found_run=true - break - fi - done - - if [ "$found_run" == "false" ]; then - sleep 30 - search_elapsed=$((search_elapsed + 30)) - fi - done - - if [ "$found_run" == "false" ]; then - echo "❌ Could not find triggered workflow run within ${search_timeout} seconds" - echo "geos_test_result=not_found" >> $GITHUB_OUTPUT - exit 1 - fi - - echo "✅ Found workflow run: ${workflow_run_id}" - echo "Now waiting for completion..." - - # Now wait for completion while [ $elapsed -lt $timeout ]; do - run_details=$(curl -fsS -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ - "https://api.github.com/repos/GEOS-DEV/GEOS/actions/runs/${workflow_run_id}") + run_status=$(curl -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ + https://api.github.com/repos/GEOS-DEV/GEOS/actions/runs/${WORKFLOW_RUN_ID} \ + | jq -r '.status') - run_status=$(echo "$run_details" | jq -r '.status') - conclusion=$(echo "$run_details" | jq -r '.conclusion') + conclusion=$(curl -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ + https://api.github.com/repos/GEOS-DEV/GEOS/actions/runs/${WORKFLOW_RUN_ID} \ + | jq -r '.conclusion') echo "Workflow status: ${run_status}, conclusion: ${conclusion} (${elapsed}s elapsed)" From 18ccf4f8bb2a9ac9013ee34ef9a094b4009770ea Mon Sep 17 00:00:00 2001 From: alexbenedicto Date: Thu, 21 Aug 2025 09:28:53 -0700 Subject: [PATCH 09/12] Try more specific branch naming --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 5464a5e9..61443a66 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -213,7 +213,7 @@ jobs: -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/GEOS-DEV/GEOS/actions/workflows/test_geospythonpackages_integration.yml/dispatches \ -d '{ - "ref": "develop", + "ref": "${{ steps.pr_info.outputs.pr_branch }}", "inputs": { "python_package_repo": "${{ steps.pr_info.outputs.pr_repo }}", "python_package_branch": "${{ steps.pr_info.outputs.pr_branch }}", From 5a13339998366d1e281cb7748514b8cb6b5d220c Mon Sep 17 00:00:00 2001 From: alexbenedicto Date: Fri, 19 Sep 2025 15:57:14 -0500 Subject: [PATCH 10/12] Improve verbosity of trigger GEOS integration test workflow, help improve debug --- .github/workflows/python-package.yml | 89 +++++++++++++++++++++++++--- 1 file changed, 80 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 61443a66..d0c715b1 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -206,24 +206,95 @@ jobs: echo "GEOS integration label found ✅" echo "Now triggering GEOS integration test workflow..." + # Determine which GEOS branch contains the workflow file + # Priority: 1) ci/benedicto/testGeosPythonPackagesIntegration (current dev branch) + # 2) develop (main branch) + # 3) main (fallback) + GEOS_BRANCH="ci/benedicto/testGeosPythonPackagesIntegration" + + # Check if workflow exists on the target branch + echo "Checking if workflow exists on branch: ${GEOS_BRANCH}" + workflow_check=$(curl -fsSL \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ + https://api.github.com/repos/GEOS-DEV/GEOS/contents/.github/workflows/test_geospythonpackages_integration.yml?ref=${GEOS_BRANCH} 2>/dev/null || echo "not_found") + + if [[ "$workflow_check" == "not_found" ]]; then + echo "Workflow not found on ${GEOS_BRANCH}, trying develop branch..." + GEOS_BRANCH="develop" + workflow_check=$(curl -fsSL \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ + https://api.github.com/repos/GEOS-DEV/GEOS/contents/.github/workflows/test_geospythonpackages_integration.yml?ref=${GEOS_BRANCH} 2>/dev/null || echo "not_found") + + if [[ "$workflow_check" == "not_found" ]]; then + echo "❌ ERROR: Workflow file not found on develop branch either!" + echo "This could indicate a permissions issue with GEOS_INTEGRATION_TOKEN" + echo "Please verify the token has proper repository access" + exit 1 + fi + fi + + echo "✅ Found workflow on branch: ${GEOS_BRANCH}" + + # Test the dispatch endpoint first + echo "Testing workflow dispatch endpoint access..." + dispatch_test=$(curl -fsSL \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ + "https://api.github.com/repos/GEOS-DEV/GEOS/actions/workflows/test_geospythonpackages_integration.yml" 2>&1 || echo "endpoint_error") + + if [[ "$dispatch_test" == "endpoint_error" ]]; then + echo "❌ ERROR: Cannot access workflow dispatch endpoint" + echo "This suggests the GEOS_INTEGRATION_TOKEN lacks 'actions:write' permission" + exit 1 + fi + + echo "✅ Workflow dispatch endpoint accessible" + # Trigger the workflow_dispatch event in the GEOS repository + # Note: ref should point to a branch that contains the workflow file + # The python package branch info is passed as inputs + echo "Triggering workflow dispatch on GEOS repository..." + echo "Target branch: ${GEOS_BRANCH}" + echo "Python package repo: ${{ steps.pr_info.outputs.pr_repo }}" + echo "Python package branch: ${{ steps.pr_info.outputs.pr_branch }}" + response=$(curl -fsS -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/GEOS-DEV/GEOS/actions/workflows/test_geospythonpackages_integration.yml/dispatches \ - -d '{ - "ref": "${{ steps.pr_info.outputs.pr_branch }}", - "inputs": { - "python_package_repo": "${{ steps.pr_info.outputs.pr_repo }}", - "python_package_branch": "${{ steps.pr_info.outputs.pr_branch }}", - "python_package_pr": "${{ github.event.number }}", - "requested_by": "${{ github.actor }}" + -d "{ + \"ref\": \"${GEOS_BRANCH}\", + \"inputs\": { + \"python_package_repo\": \"${{ steps.pr_info.outputs.pr_repo }}\", + \"python_package_branch\": \"${{ steps.pr_info.outputs.pr_branch }}\", + \"python_package_pr\": \"${{ github.event.number }}\", + \"requested_by\": \"${{ github.actor }}\" } - }') + }" 2>&1) + + # Check if the response indicates an error + if [[ $? -ne 0 ]]; then + echo "❌ ERROR: Workflow dispatch failed!" + echo "Response: $response" + echo "" + echo "Common causes:" + echo "1. GEOS_INTEGRATION_TOKEN missing or invalid" + echo "2. Token lacks 'actions:write' permission" + echo "3. Token lacks access to GEOS-DEV/GEOS repository" + echo "4. Workflow file name mismatch" + echo "" + echo "Please verify:" + echo "- The secret GEOS_INTEGRATION_TOKEN is set in geosPythonPackages repository" + echo "- The token has 'actions:write' and 'repo' permissions" + echo "- The token can access GEOS-DEV/GEOS repository" + exit 1 + fi echo "Workflow dispatch response: $response" - echo "✅ GEOS integration test workflow triggered successfully" + echo "✅ GEOS integration test workflow triggered successfully on branch: ${GEOS_BRANCH}" # Wait a moment for the workflow to start, then find the run ID sleep 10 From 5570f4e30d141000ad3af443e234d26ecfdfa4fd Mon Sep 17 00:00:00 2001 From: alexbenedicto Date: Fri, 19 Sep 2025 18:20:23 -0500 Subject: [PATCH 11/12] Add detailed HTTP error reporting --- .github/workflows/python-package.yml | 61 +++++++++++++++------------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d0c715b1..3b3b6c81 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -260,42 +260,47 @@ jobs: echo "Python package repo: ${{ steps.pr_info.outputs.pr_repo }}" echo "Python package branch: ${{ steps.pr_info.outputs.pr_branch }}" - response=$(curl -fsS -X POST \ + # Make the request with detailed error reporting + echo "Making workflow dispatch request..." + http_code=$(curl -w "%{http_code}" -o /tmp/dispatch_response.txt \ + -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.GEOS_INTEGRATION_TOKEN }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/GEOS-DEV/GEOS/actions/workflows/test_geospythonpackages_integration.yml/dispatches \ - -d "{ - \"ref\": \"${GEOS_BRANCH}\", - \"inputs\": { - \"python_package_repo\": \"${{ steps.pr_info.outputs.pr_repo }}\", - \"python_package_branch\": \"${{ steps.pr_info.outputs.pr_branch }}\", - \"python_package_pr\": \"${{ github.event.number }}\", - \"requested_by\": \"${{ github.actor }}\" - } - }" 2>&1) + -d "{\"ref\": \"${GEOS_BRANCH}\", \"inputs\": {\"python_package_repo\": \"${{ steps.pr_info.outputs.pr_repo }}\", \"python_package_branch\": \"${{ steps.pr_info.outputs.pr_branch }}\", \"python_package_pr\": \"${{ github.event.number }}\", \"requested_by\": \"${{ github.actor }}\"}}") - # Check if the response indicates an error - if [[ $? -ne 0 ]]; then - echo "❌ ERROR: Workflow dispatch failed!" - echo "Response: $response" - echo "" - echo "Common causes:" - echo "1. GEOS_INTEGRATION_TOKEN missing or invalid" - echo "2. Token lacks 'actions:write' permission" - echo "3. Token lacks access to GEOS-DEV/GEOS repository" - echo "4. Workflow file name mismatch" - echo "" - echo "Please verify:" - echo "- The secret GEOS_INTEGRATION_TOKEN is set in geosPythonPackages repository" - echo "- The token has 'actions:write' and 'repo' permissions" - echo "- The token can access GEOS-DEV/GEOS repository" + echo "HTTP response code: $http_code" + echo "Response body:" + cat /tmp/dispatch_response.txt + + # Check the HTTP response code + if [[ "$http_code" -eq 204 ]]; then + echo "✅ GEOS integration test workflow triggered successfully on branch: ${GEOS_BRANCH}" + elif [[ "$http_code" -eq 404 ]]; then + echo "❌ ERROR: 404 Not Found" + echo "Possible causes:" + echo "1. Workflow file does not exist on branch ${GEOS_BRANCH}" + echo "2. GEOS_INTEGRATION_TOKEN lacks access to GEOS-DEV/GEOS repository" + echo "3. Token is invalid or expired" + exit 1 + elif [[ "$http_code" -eq 403 ]]; then + echo "❌ ERROR: 403 Forbidden" + echo "GEOS_INTEGRATION_TOKEN lacks 'actions:write' permission" + echo "The token needs both 'repo' and 'actions:write' scopes" + exit 1 + elif [[ "$http_code" -eq 422 ]]; then + echo "❌ ERROR: 422 Unprocessable Entity" + echo "Invalid input data or workflow configuration issue" + echo "Check that all required inputs are provided correctly" + exit 1 + else + echo "❌ ERROR: Unexpected HTTP response code: $http_code" + echo "Response body:" + cat /tmp/dispatch_response.txt exit 1 fi - echo "Workflow dispatch response: $response" - echo "✅ GEOS integration test workflow triggered successfully on branch: ${GEOS_BRANCH}" - # Wait a moment for the workflow to start, then find the run ID sleep 10 From 780bcc462f905078ad4f73a0acd27dfed131dfbd Mon Sep 17 00:00:00 2001 From: Jacques Franc <49998870+jafranc@users.noreply.github.com> Date: Tue, 14 Oct 2025 07:11:41 +0000 Subject: [PATCH 12/12] testing geos int ci --- geos-mesh/src/geos/mesh/conversion/dummy.test | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 geos-mesh/src/geos/mesh/conversion/dummy.test diff --git a/geos-mesh/src/geos/mesh/conversion/dummy.test b/geos-mesh/src/geos/mesh/conversion/dummy.test new file mode 100644 index 00000000..e69de29b