From 22301049cd3e19be1d2f46831840c2b7423c728d Mon Sep 17 00:00:00 2001 From: Anupam Kumar Date: Tue, 1 Apr 2025 07:23:52 +0530 Subject: [PATCH 1/3] enh: add static analysis with pyright Signed-off-by: Anupam Kumar --- .github/workflows/static-analysis.yml | 90 +++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .github/workflows/static-analysis.yml diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml new file mode 100644 index 0000000..9c90158 --- /dev/null +++ b/.github/workflows/static-analysis.yml @@ -0,0 +1,90 @@ +name: Static Analysis + +on: + pull_request: + branches: + - master + push: + branches: + - master + +permissions: + contents: read + +concurrency: + group: static-analysis-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + changes: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + + outputs: + src: ${{ steps.changes.outputs.src}} + + steps: + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 + id: changes + continue-on-error: true + with: + filters: | + src: + - 'main.py' + - 'main_em.py' + - 'config.cpu.yaml' + - 'config.gpu.yaml' + - 'context_chat_backend/**' + - 'appinfo/**' + - 'example.env' + - 'hwdetect.sh' + - 'persistent_storage/**' + - 'project.toml' + - 'requirements.txt' + - 'logger_config.yaml' + - '.github/workflows/static-analysis.yml' + + analysis: + runs-on: ubuntu-latest + + needs: changes + if: needs.changes.outputs.src != 'false' + + steps: + - name: Checkout CCB + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Setup python 3.11 + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5 + with: + python-version: '3.11' + cache: 'pip' + cache-dependency-path: | + requirements.txt + requirements_dev.txt + + - name: Install dependencies + run: | + pip install --upgrade pip setuptools wheel + pip install -r requirements_dev.txt + + - name: Static analysis with pyright + run: | + pyright + + summary: + permissions: + contents: none + runs-on: ubuntu-latest-low + needs: [changes, analysis] + + if: always() + + # This is the summary, we just avoid to rename it so that branch protection rules still match + name: static-analysis + + steps: + - name: Summary status + run: if ${{ needs.changes.outputs.src != 'false' && needs.analysis.result != 'success' }}; then exit 1; fi From 04995b893d9003dfb488e9023271f5fd426edde8 Mon Sep 17 00:00:00 2001 From: Anupam Kumar Date: Tue, 1 Apr 2025 07:23:59 +0530 Subject: [PATCH 2/3] update code owners Signed-off-by: Anupam Kumar --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d7e9371..28156ba 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors # SPDX-License-Identifier: AGPL-3.0-or-later # App maintainers -/appinfo/info.xml @kyteinsky @marcelklehr +* @kyteinsky @marcelklehr From c4dfa318aafd8ccccae7e00fdf35c051144a1a3b Mon Sep 17 00:00:00 2001 From: Anupam Kumar Date: Tue, 1 Apr 2025 07:26:11 +0530 Subject: [PATCH 3/3] fix license Signed-off-by: Anupam Kumar --- .github/workflows/static-analysis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 9c90158..a52e745 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: AGPL-3.0-or-later + name: Static Analysis on: