From 643ce134d59888cc42b5c15d85039f5538dec4ee Mon Sep 17 00:00:00 2001 From: Denys Fedoryshchenko Date: Thu, 17 Apr 2025 15:57:53 +0300 Subject: [PATCH 1/3] (main.py) Make KernelCI system users as superusers Superusers can update others nodes, for example needed if kcidb bridge are processing other user nodes. This is temporary hack to make sure qualcomm setup works. Signed-off-by: Denys Fedoryshchenko --- api/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/main.py b/api/main.py index bb2cba87..44436ecb 100644 --- a/api/main.py +++ b/api/main.py @@ -334,6 +334,10 @@ async def authorize_user(node_id: str, status_code=status.HTTP_404_NOT_FOUND, detail=f"Node not found with id: {node_id}" ) + # users staging.kernelci.org and production are superusers + # TBD: This is HACK until qualcomm can migrate to direct KCIDB + if user.username in ['staging.kernelci.org', 'production']: + return user if not user.username == node_from_id.owner: if not any(group.name in node_from_id.user_groups for group in user.groups): From 8bde211497778c71570beb621017651f14e1e58e Mon Sep 17 00:00:00 2001 From: Denys Fedoryshchenko Date: Thu, 17 Apr 2025 16:16:16 +0300 Subject: [PATCH 2/3] Update linter to latest version Signed-off-by: Denys Fedoryshchenko --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 15d2ec7f..485ce902 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -101,7 +101,7 @@ jobs: pip install -r docker/api/requirements-tests.txt - if: env.CHANGED_FILES - uses: marian-code/python-lint-annotate@v3 + uses: marian-code/python-lint-annotate@v4 with: python-root-list: ${{ env.CHANGED_FILES }} use-black: false From 5451ee1892d49e7d584e60608df192999fe67b72 Mon Sep 17 00:00:00 2001 From: Denys Fedoryshchenko Date: Thu, 17 Apr 2025 16:18:03 +0300 Subject: [PATCH 3/3] Update ubuntu runner version Signed-off-by: Denys Fedoryshchenko --- .github/workflows/main.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 485ce902..22f7ffe9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ on: jobs: check: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: @@ -51,10 +51,14 @@ jobs: run: | export DEBIAN_FRONTEND=noninteractive sudo apt-get update - sudo apt-get install -y docker-compose docker.io + sudo apt install apt-transport-https ca-certificates curl software-properties-common -y + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" + sudo apt-get update + sudo apt install docker-ce docker-ce-cli containerd.io -y - name: Build docker images - run: docker-compose -f test-docker-compose.yaml build --no-cache + run: docker compose -f test-docker-compose.yaml build --no-cache - name: Run pycodestyle run: | @@ -62,18 +66,18 @@ jobs: - name: Run API containers run: | - docker-compose -f test-docker-compose.yaml up -d test + docker compose -f test-docker-compose.yaml up -d test - name: Run pylint run: | - docker-compose -f test-docker-compose.yaml exec -T test pylint --extension-pkg-whitelist=pydantic api/ - docker-compose -f test-docker-compose.yaml exec -T test pylint tests/unit_tests - docker-compose -f test-docker-compose.yaml exec -T test pylint tests/e2e_tests + docker compose -f test-docker-compose.yaml exec -T test pylint --extension-pkg-whitelist=pydantic api/ + docker compose -f test-docker-compose.yaml exec -T test pylint tests/unit_tests + docker compose -f test-docker-compose.yaml exec -T test pylint tests/e2e_tests - name: Stop docker containers if: always() run: | - docker-compose -f test-docker-compose.yaml down + docker compose -f test-docker-compose.yaml down lint: runs-on: ubuntu-22.04