From 43571e77127215c6901ac3c8850dc0cbf1e99670 Mon Sep 17 00:00:00 2001 From: Pau Ruiz Safont Date: Tue, 25 Jun 2024 16:52:18 +0100 Subject: [PATCH 1/6] CI: use new version of codecov action Signed-off-by: Pau Ruiz Safont --- .github/workflows/other.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/other.yml b/.github/workflows/other.yml index d65b7abe575..3f662d6b02c 100644 --- a/.github/workflows/other.yml +++ b/.github/workflows/other.yml @@ -81,14 +81,15 @@ jobs: PYTHONDEVMODE: yes - name: Upload Python ${{matrix.python-version}} coverage report to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: directory: .git - files: coverage${{matrix.python-version}}.xml - env_vars: OS,PYTHON fail_ci_if_error: false + env_vars: OS,PYTHON + files: coverage${{matrix.python-version}}.xml flags: python${{matrix.python-version}} name: coverage${{matrix.python-version}} + use_oidc: true verbose: true - uses: dciborow/action-pylint@0.1.0 From bbdceb3488f6c7f91cb8a979eb873556292a5101 Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Wed, 26 Jun 2024 16:21:42 +0200 Subject: [PATCH 2/6] Merge .codecov.yml from feature/py3 to drop scripts checks Signed-off-by: Bernhard Kaindl --- .codecov.yml | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index ef8fb9e5929..c0092974257 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -168,13 +168,7 @@ coverage: # - excluding: **/test_*.py # paths: ["python3/**", "!**/test_*.py"] - - # - # For python3/** (excluding tests): - # - # For python3, coverage should not be reduced compared to its base: - # - target: auto + target: 80% # # Exception: the threshold value given is allowed @@ -183,12 +177,6 @@ coverage: # threshold: 20% - # Checks each Python version separately: - python-3.11: - flags: ["python3.11"] - python-2.7: - flags: ["python2.7"] - # # Project limits # -------------- @@ -218,7 +206,7 @@ coverage: tests: # Ensure that all tests are executed (tests themselves must be 100% covered) target: 98% - paths: ["**/test_*.py"] + paths: ["python3/tests/test_*.py"] # @@ -235,24 +223,15 @@ component_management: - type: project # `auto` will use the coverage from the base commit (pull request base # or parent commit) coverage to compare against. - target: auto + target: 48 threshold: 2% - type: patch - target: auto - threshold: 10% + target: 80 + threshold: 5% individual_components: - - component_id: scripts # this is an identifier that should not be changed - name: scripts # this is a display name, and can be changed freely - # The list of paths that should be in- and excluded in this component: - paths: ["scripts/**", "!scripts/examples/**", "!**/test_*.py"] - - - component_id: scripts/examples - name: scripts/examples - paths: ["scripts/examples/**", "!scripts/**/test_*.py"] - - component_id: ocaml name: ocaml paths: ["ocaml/**", "!**/test_*.py"] @@ -270,4 +249,5 @@ component_management: - component_id: test_cases name: test_cases - paths: ["**/test_*.py"] + paths: ["python3/tests/test_*.py"] + From 1493e28e9a16ba43c5a886e23325aa17b65c4ba2 Mon Sep 17 00:00:00 2001 From: Fei Su Date: Thu, 27 Jun 2024 14:24:12 +0800 Subject: [PATCH 3/6] CP-50055 Add Go SDK as a release package in XAPI Signed-off-by: Fei Su --- .github/workflows/generate-and-build-sdks.yml | 8 ++++++++ .github/workflows/release.yml | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/.github/workflows/generate-and-build-sdks.yml b/.github/workflows/generate-and-build-sdks.yml index 78ec2579a7f..87da4b1d8f5 100644 --- a/.github/workflows/generate-and-build-sdks.yml +++ b/.github/workflows/generate-and-build-sdks.yml @@ -47,6 +47,14 @@ jobs: name: SDK_Source_PowerShell path: _build/install/default/xapi/sdk/powershell/* + - name: Store Go SDK Artifacts + uses: actions/upload-artifact@v4 + with: + name: SDK_Artifacts_Go + path: | + _build/install/default/xapi/sdk/go/* + !_build/install/default/xapi/sdk/go/dune + - name: Trim dune cache run: opam exec -- dune cache trim --size=2GiB diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1c3dca70fcd..9a051ef15f9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,6 +46,12 @@ jobs: runs-on: ubuntu-latest needs: [build-python, build-sdks] steps: + - name: Retrieve Go SDK distribution artifacts + uses: actions/download-artifact@v4 + with: + name: SDK_Artifacts_Go + path: sdk_go/ + - name: Retrieve Python SDK distribution artifacts uses: actions/download-artifact@v4 with: @@ -93,12 +99,17 @@ jobs: shell: bash run: zip PowerShell-SDK-7.x-prerelease-unsigned.zip ./sdk_powershell_7x -r + - name: Zip Go SDK artifacts for deployment + shell: bash + run: zip Go-SDK-prerelease-unsigned.zip ./sdk_go -r + - name: Create release ${{ github.ref_name }} shell: bash run: | gh release create ${{ github.ref_name }} --repo ${{ github.repository }} --generate-notes dist/* \ PowerShell-SDK-5.x-prerelease-unsigned.zip \ PowerShell-SDK-7.x-prerelease-unsigned.zip \ + Go-SDK-prerelease-unsigned.zip \ libxenserver-prerelease.tar.gz libxenserver-prerelease.src.tar.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 5e4fddd69ef8541dfd748346c8051152187955b5 Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Wed, 26 Jun 2024 12:00:00 +0200 Subject: [PATCH 4/6] CI: codecov is unstable, use coveralls Signed-off-by: Bernhard Kaindl --- .github/workflows/other.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/other.yml b/.github/workflows/other.yml index 3f662d6b02c..dad92a2cf32 100644 --- a/.github/workflows/other.yml +++ b/.github/workflows/other.yml @@ -56,7 +56,7 @@ jobs: - name: Install common dependencies for Python ${{matrix.python-version}} run: pip install future mock pytest-coverage pytest-mock - - name: Run Pytest for python 2 and get code coverage for Codecov + - name: Run Pytest for python 2 and get code coverage if: ${{ matrix.python-version == '2.7' }} run: > pytest @@ -68,7 +68,7 @@ jobs: env: PYTHONDEVMODE: yes - - name: Run Pytest for python 3 and get code coverage for Codecov + - name: Run Pytest for python 3 and get code coverage if: ${{ matrix.python-version != '2.7' }} run: > pytest @@ -80,17 +80,13 @@ jobs: env: PYTHONDEVMODE: yes - - name: Upload Python ${{matrix.python-version}} coverage report to Codecov - uses: codecov/codecov-action@v4 + - name: Upload coverage report to Coveralls + uses: coverallsapp/github-action@v2 with: - directory: .git - fail_ci_if_error: false - env_vars: OS,PYTHON - files: coverage${{matrix.python-version}}.xml - flags: python${{matrix.python-version}} - name: coverage${{matrix.python-version}} - use_oidc: true - verbose: true + format: cobertura + files: .git/coverage${{matrix.python-version}}.xml + flag-name: python${{matrix.python-version}} + parallel: true - uses: dciborow/action-pylint@0.1.0 if: ${{ matrix.python-version != '2.7' }} From 2a018d785ca7c53cf57ff773f95b0f6e9e27b721 Mon Sep 17 00:00:00 2001 From: Mark Syms Date: Wed, 26 Jun 2024 16:09:31 +0100 Subject: [PATCH 5/6] CP-49446: expose SR health values to Python Signed-off-by: Mark Syms --- ocaml/xapi-storage-script/main.ml | 8 ++++++++ ocaml/xapi-storage/generator/lib/control.ml | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/ocaml/xapi-storage-script/main.ml b/ocaml/xapi-storage-script/main.ml index 0ad8b900e3b..854aec883bc 100644 --- a/ocaml/xapi-storage-script/main.ml +++ b/ocaml/xapi-storage-script/main.ml @@ -1046,6 +1046,10 @@ let bind ~volume_script_dir = Healthy | Xapi_storage.Control.Recovering _ -> Recovering + | Xapi_storage.Control.Unreachable _ -> + Unreachable + | Xapi_storage.Control.Unavailable _ -> + Unavailable ) } in @@ -1405,6 +1409,10 @@ let bind ~volume_script_dir = Healthy | Xapi_storage.Control.Recovering _ -> Recovering + | Xapi_storage.Control.Unreachable _ -> + Unreachable + | Xapi_storage.Control.Unavailable _ -> + Unavailable ) } ) diff --git a/ocaml/xapi-storage/generator/lib/control.ml b/ocaml/xapi-storage/generator/lib/control.ml index f4d8a22a4a5..e34c0183c36 100644 --- a/ocaml/xapi-storage/generator/lib/control.ml +++ b/ocaml/xapi-storage/generator/lib/control.ml @@ -28,6 +28,10 @@ type health = | Healthy of string (** Storage is fully available *) | Recovering of string (** Storage is busy recovering, e.g. rebuilding mirrors *) + | Unreachable of string + (** Storage is unreachable but may be recoverable with admin intervention *) + | Unavailable of string + (** Storage is unavailable, a host reboot will be required *) [@@deriving rpcty] type volume_type = From a0391b864d35e2e38cbc71d4e519b256094639ce Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Thu, 27 Jun 2024 12:00:00 +0200 Subject: [PATCH 6/6] CI: Complete parallel Coveralls uploads: Finish when done --- .github/workflows/other.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/other.yml b/.github/workflows/other.yml index dad92a2cf32..9974a15fcd8 100644 --- a/.github/workflows/other.yml +++ b/.github/workflows/other.yml @@ -111,6 +111,18 @@ jobs: github_token: ${{ secrets.github_token }} continue-on-error: true + # For coverage of 2.7 and 3.11 we upload to Coveralls in parallel mode. + # To view the Coveralls results of the PR, click on the "Details" link to the right + # of the Coveralls Logo in the Checks section of the PR. + finish-parallel-coveralls-upload: + needs: python-test # run after the python-test has completed uploading coverages + runs-on: ubuntu-latest + steps: + - name: Finish the parallel coverage upload to Coveralls + uses: coverallsapp/github-action@v1 + with: + parallel-finished: true + deprecation-test: name: Deprecation tests runs-on: ubuntu-22.04