From 431326f3b99eb56608850f5fa7da3647ac8ebe46 Mon Sep 17 00:00:00 2001 From: Tristan van Berkom Date: Mon, 14 Oct 2024 19:10:20 +0900 Subject: [PATCH 1/6] github workflows: Use v4 of upload/download artifact actions The v1 and v2 versions are now deprecated and don't work: https://github.blog/changelog/2024-02-13-deprecation-notice-v1-and-v2-of-the-artifact-actions/ --- .github/workflows/ci.yml | 2 +- .github/workflows/merge.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c20bb57..75147ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,7 @@ jobs: ${GITHUB_WORKSPACE}/.github/run-ci.sh docs - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: docs path: doc/build/html diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index cde4e5b..e0c144d 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -31,7 +31,7 @@ jobs: tar -C doc/build/html -zcf docs.tgz . - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: docs path: | @@ -44,7 +44,7 @@ jobs: steps: - name: Download artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: docs path: docs From ad6f20aad08013c85842b5df26e32de61992e891 Mon Sep 17 00:00:00 2001 From: Tristan van Berkom Date: Fri, 6 Dec 2024 20:20:14 +0900 Subject: [PATCH 2/6] .pylintrc: Disable too-many-positional-arguments error This doesnt play well with parameterized pytest tests. --- .pylintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.pylintrc b/.pylintrc index 5bd9e47..f0cbe35 100644 --- a/.pylintrc +++ b/.pylintrc @@ -111,6 +111,7 @@ disable= too-many-lines, too-many-locals, too-many-nested-blocks, + too-many-positional-arguments, too-many-public-methods, too-many-statements, too-many-return-statements, From e93a2fc6e58354f27c01e7c638e631c2e3390fbe Mon Sep 17 00:00:00 2001 From: Tristan van Berkom Date: Wed, 4 Dec 2024 01:32:51 +0900 Subject: [PATCH 3/6] CI: Use ubuntu 22.04 This is a workaround for https://issues.apache.org/jira/browse/INFRA-26331 As outlined here: https://etbe.coker.com.au/2024/04/24/ubuntu-24-04-bubblewrap/ Bubblewrap is not working on ubuntu 24 without some adjustments. --- .github/workflows/ci.yml | 4 ++-- .github/workflows/merge.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75147ec..cf88876 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ concurrency: jobs: tests: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 continue-on-error: ${{ matrix.allow-failure || false }} strategy: @@ -59,7 +59,7 @@ jobs: ${GITHUB_WORKSPACE}/.github/run-ci.sh ${{ matrix.test-name }} docs: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Check out repository uses: actions/checkout@v2 diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index e0c144d..67ef1a4 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -8,7 +8,7 @@ on: jobs: build: name: Build documentation - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout code uses: actions/checkout@v2 @@ -40,7 +40,7 @@ jobs: publish: needs: build - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Download artifact From 7b169dbe56ab8debb2457f74552b19985748e966 Mon Sep 17 00:00:00 2001 From: Tristan van Berkom Date: Wed, 4 Dec 2024 04:13:59 +0900 Subject: [PATCH 4/6] .github/common.env: Update to docker image containing bzr We had a regression where we are not running bzr related tests, which also includes the cache key test. Also use ubuntu 22.04 instead of 20.04, because the 20.04 image went missing in upstream buildstream-docker-images. --- .github/common.env | 2 +- .github/compose/ci.docker-compose.yml | 4 ++-- .github/workflows/ci.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/common.env b/.github/common.env index c1f43f7..91f1cb5 100644 --- a/.github/common.env +++ b/.github/common.env @@ -1,5 +1,5 @@ # Shared common variables -CI_IMAGE_VERSION=master-1408971201 +CI_IMAGE_VERSION=master-1571408207 CI_TOXENV_ALL=py38,py39,py310,py311,py312 CI_TOXENV_MASTER=py38-bst-master,py39-bst-master,py310-bst-master,py311-bst-master,py312-bst-master diff --git a/.github/compose/ci.docker-compose.yml b/.github/compose/ci.docker-compose.yml index 48d1d83..f22b14b 100644 --- a/.github/compose/ci.docker-compose.yml +++ b/.github/compose/ci.docker-compose.yml @@ -30,9 +30,9 @@ services: <<: *tests-template image: registry.gitlab.com/buildstream/buildstream-docker-images/testsuite-fedora:40-${CI_IMAGE_VERSION:-latest} - ubuntu-20.04: + ubuntu-22.04: <<: *tests-template - image: registry.gitlab.com/buildstream/buildstream-docker-images/testsuite-ubuntu:20.04-${CI_IMAGE_VERSION:-latest} + image: registry.gitlab.com/buildstream/buildstream-docker-images/testsuite-ubuntu:22.04-${CI_IMAGE_VERSION:-latest} # Ensure that tests also pass in the absence of a sandboxing tool fedora-missing-deps: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf88876..d76c512 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: - debian-11 - fedora-40 - fedora-missing-deps - - ubuntu-20.04 + - ubuntu-22.04 - lint - mypy From 5ff45aaaf6977e932c91665420642417aae8cbb0 Mon Sep 17 00:00:00 2001 From: Tristan van Berkom Date: Wed, 4 Dec 2024 20:26:59 +0900 Subject: [PATCH 5/6] tox.ini: Address breaking tox change, now use "allowlist_externals" This fixes the docs build. --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 5d58934..3e001f0 100644 --- a/tox.ini +++ b/tox.ini @@ -60,7 +60,7 @@ setenv = !master: BST_VERSION = 2.2.1 master: BST_VERSION = master -whitelist_externals = +allowlist_externals = py{38,39,310,311,312}: mv mkdir @@ -132,7 +132,7 @@ passenv = HOME LANG LC_ALL -whitelist_externals = +allowlist_externals = make From 335a4b1668a3e8bcb80c3a2340db14cd8c00c2d1 Mon Sep 17 00:00:00 2001 From: Tristan van Berkom Date: Wed, 4 Dec 2024 23:15:33 +0900 Subject: [PATCH 6/6] tox.ini: Conditionally wrap the bzr command if it's present on the host Since bzr is not implemented with breezy, and breezy uses a python library, we cannot execute bzr on some platforms without installing the breezy python libs into the tox venv, and we cannot install breezy into the venv easily since it is installing from source, and using things like cython and rust. Instead, we simply wrap host bzr with a script which overrides the PATH variable, so that python ignores the venv when entering the bzr code, this allows us to keep our tox environment clean for buildstream and tests, while testing the host installation of bzr. --- tests/bzr_wrapper | 14 ++++++++++++++ tox.ini | 2 ++ 2 files changed, 16 insertions(+) create mode 100755 tests/bzr_wrapper diff --git a/tests/bzr_wrapper b/tests/bzr_wrapper new file mode 100755 index 0000000..27bf6b7 --- /dev/null +++ b/tests/bzr_wrapper @@ -0,0 +1,14 @@ +#!/bin/bash + +if [ -x "/usr/bin/bzr" ]; then + + cat > "${1}/bzr" << 'EOF' +#!/bin/bash + +export PATH=/usr/bin + +exec /usr/bin/bzr "$@" +EOF + + chmod +x "${1}/bzr" +fi diff --git a/tox.ini b/tox.ini index 3e001f0..5b97c50 100644 --- a/tox.ini +++ b/tox.ini @@ -27,6 +27,7 @@ skip_missing_interpreters = true [testenv] commands = bst --version + ./tests/bzr_wrapper {envdir}/bin pytest --basetemp {envtmpdir} {posargs} deps = -rrequirements/test-requirements.txt @@ -64,6 +65,7 @@ allowlist_externals = py{38,39,310,311,312}: mv mkdir + ./tests/bzr_wrapper # # Code formatters