From 4490aa72c66cb7024fb7ad3059c74cb9f93f2762 Mon Sep 17 00:00:00 2001 From: raman325 <7243222+raman325@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:17:14 -0500 Subject: [PATCH 01/15] Use uv instead of pip in pytest workflow - Replace pip with uv for faster, more reliable dependency installation - Use astral-sh/setup-uv action with caching enabled - Use uv python install for Python setup - Use uv pip install --system for dependencies - Use uv run for pytest execution Also add self-referencing workflow paths to triggers so that changes to workflow files trigger their respective CI runs: - pytest.yaml - vitest.yaml - yarn.yaml Add [project] section to pyproject.toml with requires-python to fix uv warning: "No requires-python value found in the workspace" Co-Authored-By: Claude Opus 4.5 --- .github/workflows/pytest.yaml | 20 ++++++++++++-------- .github/workflows/vitest.yaml | 2 ++ .github/workflows/yarn.yaml | 2 ++ pyproject.toml | 5 +++++ 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index dc9a3b39..d5c86fa7 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -7,12 +7,14 @@ on: branches: [main] paths: - "**.py" + - ".github/workflows/pytest.yaml" pull_request: branches: [main] paths: - "**.py" - "requirements*.txt" - "pyproject.toml" + - ".github/workflows/pytest.yaml" jobs: test: @@ -24,20 +26,22 @@ jobs: steps: - uses: actions/checkout@v6 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + - name: Install uv + uses: astral-sh/setup-uv@v5 with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies + enable-cache: true + - name: Set up Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} + - name: Install system dependencies run: | sudo apt-get update sudo apt-get install libudev-dev - python -m pip install --upgrade pip - pip install -r requirements_dev.txt + - name: Install dependencies + run: uv pip install --system -r requirements_dev.txt - name: Run tests and generate coverage report run: | - pip install pytest-cov pytest-github-actions-annotate-failures - pytest ./tests/ --cov=custom_components/lock_code_manager/ --cov-report=xml + uv pip install --system pytest-cov pytest-github-actions-annotate-failures + uv run --no-project pytest ./tests/ --cov=custom_components/lock_code_manager/ --cov-report=xml - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: diff --git a/.github/workflows/vitest.yaml b/.github/workflows/vitest.yaml index f0b36bfd..0484db3b 100644 --- a/.github/workflows/vitest.yaml +++ b/.github/workflows/vitest.yaml @@ -10,6 +10,7 @@ on: - "ts/**" - "package.json" - "vitest.config.ts" + - ".github/workflows/vitest.yaml" pull_request: branches: [main] paths: @@ -17,6 +18,7 @@ on: - "ts/**" - "package.json" - "vitest.config.ts" + - ".github/workflows/vitest.yaml" jobs: test: diff --git a/.github/workflows/yarn.yaml b/.github/workflows/yarn.yaml index 63617841..97b30773 100644 --- a/.github/workflows/yarn.yaml +++ b/.github/workflows/yarn.yaml @@ -12,6 +12,7 @@ on: - "package.json" - "rollup.config.js" - "tsconfig.json" + - ".github/workflows/yarn.yaml" pull_request: branches: [main] paths: @@ -22,6 +23,7 @@ on: - "package.json" - "rollup.config.js" - "tsconfig.json" + - ".github/workflows/yarn.yaml" jobs: yarn: diff --git a/pyproject.toml b/pyproject.toml index b995eda4..785ee3ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,8 @@ +[project] +name = "lock-code-manager" +version = "0.0.0" +requires-python = ">=3.13" + [tool.ruff] lint.select = ["D", "E", "F", "G", "I", "PLC", "PLE", "PLR", "PLW", "UP", "W"] lint.ignore = [ From 9ba90459981d5efd4f4596263b834a676d5fd642 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 15 Jan 2026 02:20:44 +0000 Subject: [PATCH 02/15] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 571544cf..d7364bb0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -82,7 +82,7 @@ class MockFlow(ConfigFlow): @pytest.fixture(name="mock_config_flow") -def config_flow_fixture(hass: HomeAssistant) -> Generator[None, None, None]: +def config_flow_fixture(hass: HomeAssistant) -> Generator[None]: """Mock config flow.""" mock_platform(hass, f"{TEST_DOMAIN}.config_flow") From 3fcf3e33af03bc5a3e6d3d8219dc8c538e30674c Mon Sep 17 00:00:00 2001 From: raman325 <7243222+raman325@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:21:07 -0500 Subject: [PATCH 03/15] Run pytest directly instead of via uv run Co-Authored-By: Claude Opus 4.5 --- .github/workflows/pytest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index d5c86fa7..8415fc85 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -41,7 +41,7 @@ jobs: - name: Run tests and generate coverage report run: | uv pip install --system pytest-cov pytest-github-actions-annotate-failures - uv run --no-project pytest ./tests/ --cov=custom_components/lock_code_manager/ --cov-report=xml + pytest ./tests/ --cov=custom_components/lock_code_manager/ --cov-report=xml - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: From dee5a051e249da86e44ca5331e54b3863709964b Mon Sep 17 00:00:00 2001 From: raman325 <7243222+raman325@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:23:01 -0500 Subject: [PATCH 04/15] Add comment explaining CI-only test dependencies Co-Authored-By: Claude Opus 4.5 --- .github/workflows/pytest.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 8415fc85..a2e39c49 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -39,6 +39,7 @@ jobs: - name: Install dependencies run: uv pip install --system -r requirements_dev.txt - name: Run tests and generate coverage report + # CI-only deps installed separately to keep requirements_dev.txt lightweight run: | uv pip install --system pytest-cov pytest-github-actions-annotate-failures pytest ./tests/ --cov=custom_components/lock_code_manager/ --cov-report=xml From 0d193f9dcd9571adef9a9de345c771e55168a628 Mon Sep 17 00:00:00 2001 From: raman325 <7243222+raman325@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:24:10 -0500 Subject: [PATCH 05/15] Add uv.lock to .gitignore uv.lock is generated when using uv for project management, but we only use uv as a pip replacement for faster package installs. Co-Authored-By: Claude Opus 4.5 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8ade202c..3a546303 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ coverage/ .mypy_cache .ruff_cache .uv-cache +uv.lock coverage htmlcov node_modules From bbb85b927beae08463e3e3904561f94e3049f786 Mon Sep 17 00:00:00 2001 From: raman325 <7243222+raman325@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:24:34 -0500 Subject: [PATCH 06/15] Remove uv.lock Not needed since we only use uv as a pip replacement, not for project management. Co-Authored-By: Claude Opus 4.5 --- uv.lock | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 uv.lock diff --git a/uv.lock b/uv.lock deleted file mode 100644 index bda02073..00000000 --- a/uv.lock +++ /dev/null @@ -1,3 +0,0 @@ -version = 1 -revision = 3 -requires-python = ">=3.13" From 933e3b25f50b932624352ee2d268d271e5852024 Mon Sep 17 00:00:00 2001 From: raman325 <7243222+raman325@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:26:20 -0500 Subject: [PATCH 07/15] Use actions/setup-python for system Python uv pip install --system requires a system Python. Use actions/setup-python to provide it, then use uv just as a fast pip replacement. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/pytest.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index a2e39c49..2f85db10 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -26,12 +26,14 @@ jobs: steps: - uses: actions/checkout@v6 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} - name: Install uv uses: astral-sh/setup-uv@v5 with: enable-cache: true - - name: Set up Python ${{ matrix.python-version }} - run: uv python install ${{ matrix.python-version }} - name: Install system dependencies run: | sudo apt-get update From 993c8c8a1202898c23458ce7cdf07ffdca5431d2 Mon Sep 17 00:00:00 2001 From: raman325 <7243222+raman325@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:31:03 -0500 Subject: [PATCH 08/15] Consolidate and rename CI workflows - Combine vitest.yaml and yarn.yaml into frontend.yaml with parallel jobs: - "Lint and Build" job (from yarn.yaml) - "Test" job (from vitest.yaml) - Rename pytest.yaml to python.yaml with workflow name "Python" - Standardize job names for consistent GitHub UI grouping: - Frontend: "Lint and Build", "Test" - Python: "Test" Co-Authored-By: Claude Opus 4.5 --- .../workflows/{yarn.yaml => frontend.yaml} | 56 ++++++++++++------- .../workflows/{pytest.yaml => python.yaml} | 8 +-- .github/workflows/vitest.yaml | 47 ---------------- 3 files changed, 39 insertions(+), 72 deletions(-) rename .github/workflows/{yarn.yaml => frontend.yaml} (51%) rename .github/workflows/{pytest.yaml => python.yaml} (90%) delete mode 100644 .github/workflows/vitest.yaml diff --git a/.github/workflows/yarn.yaml b/.github/workflows/frontend.yaml similarity index 51% rename from .github/workflows/yarn.yaml rename to .github/workflows/frontend.yaml index 97b30773..0e04f092 100644 --- a/.github/workflows/yarn.yaml +++ b/.github/workflows/frontend.yaml @@ -1,6 +1,7 @@ --- -name: Yarn lint and build +name: Frontend +# yamllint disable-line rule:truthy on: push: branches: [main] @@ -12,7 +13,8 @@ on: - "package.json" - "rollup.config.js" - "tsconfig.json" - - ".github/workflows/yarn.yaml" + - "vitest.config.ts" + - ".github/workflows/frontend.yaml" pull_request: branches: [main] paths: @@ -23,50 +25,62 @@ on: - "package.json" - "rollup.config.js" - "tsconfig.json" - - ".github/workflows/yarn.yaml" + - "vitest.config.ts" + - ".github/workflows/frontend.yaml" jobs: - yarn: - name: Yarn lint and build + lint-and-build: + name: Lint and Build runs-on: ubuntu-latest - strategy: - matrix: - node-version: - - "lts/iron" - steps: - uses: actions/checkout@v6 with: fetch-depth: 2 - - name: Set up Node ${{ matrix.node-version }} + - name: Set up Node uses: actions/setup-node@v6 with: - node-version: ${{ matrix.node-version }} - - name: Install + node-version: lts/iron + - name: Install dependencies run: yarn install - name: Lint - run: | - yarn lint:fix + run: yarn lint:fix - name: Check for changes from lint id: change_lint - # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT - name: Check if clean from lint if: steps.change_lint.outputs.changed != 0 uses: actions/github-script@v8 with: script: | - core.setFailed('Repo is dirty after lint! Run yarn lint:fix locally before pushing changes.') + core.setFailed('Repo is dirty after lint! Run yarn lint:fix locally before pushing changes.') - name: Build - run: | - yarn build + run: yarn build - name: Check for changes from build id: change_build - # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT - name: Check if clean from build if: steps.change_build.outputs.changed != 0 uses: actions/github-script@v8 with: script: | - core.setFailed('Repo is dirty after build! Run yarn build locally before pushing changes.') + core.setFailed('Repo is dirty after build! Run yarn build locally before pushing changes.') + + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Set up Node + uses: actions/setup-node@v6 + with: + node-version: lts/iron + - name: Install dependencies + run: yarn install + - name: Run tests + run: yarn test --coverage --coverage.reporter=json + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: typescript + files: ./coverage/coverage-final.json diff --git a/.github/workflows/pytest.yaml b/.github/workflows/python.yaml similarity index 90% rename from .github/workflows/pytest.yaml rename to .github/workflows/python.yaml index 2f85db10..7ebb1f18 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/python.yaml @@ -1,5 +1,5 @@ --- -name: Pytest +name: Python # yamllint disable-line rule:truthy on: @@ -7,18 +7,18 @@ on: branches: [main] paths: - "**.py" - - ".github/workflows/pytest.yaml" + - ".github/workflows/python.yaml" pull_request: branches: [main] paths: - "**.py" - "requirements*.txt" - "pyproject.toml" - - ".github/workflows/pytest.yaml" + - ".github/workflows/python.yaml" jobs: test: - name: Python ${{ matrix.python-version }} Test + name: Test runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/vitest.yaml b/.github/workflows/vitest.yaml deleted file mode 100644 index 0484db3b..00000000 --- a/.github/workflows/vitest.yaml +++ /dev/null @@ -1,47 +0,0 @@ ---- -name: Vitest - -# yamllint disable-line rule:truthy -on: - push: - branches: [main] - paths: - - "**.ts" - - "ts/**" - - "package.json" - - "vitest.config.ts" - - ".github/workflows/vitest.yaml" - pull_request: - branches: [main] - paths: - - "**.ts" - - "ts/**" - - "package.json" - - "vitest.config.ts" - - ".github/workflows/vitest.yaml" - -jobs: - test: - name: TypeScript Test - runs-on: ubuntu-latest - strategy: - matrix: - node-version: - - "lts/iron" - - steps: - - uses: actions/checkout@v6 - - name: Set up Node ${{ matrix.node-version }} - uses: actions/setup-node@v6 - with: - node-version: ${{ matrix.node-version }} - - name: Install dependencies - run: yarn install - - name: Run tests and generate coverage report - run: yarn test --coverage --coverage.reporter=json - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: typescript - files: ./coverage/coverage-final.json From 12544c5055f84343ff9a6d6796b3752ed350efae Mon Sep 17 00:00:00 2001 From: raman325 <7243222+raman325@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:32:30 -0500 Subject: [PATCH 09/15] Consolidate Integration workflow with HACS and Hassfest - Rename python.yaml to integration.yaml - Move HACS and Hassfest validation into Integration workflow as parallel jobs - Delete standalone hacs.yaml and hassfest.yaml Integration workflow now has three parallel jobs: - Test (pytest) - HACS - Hassfest Note: auto-merge.yaml uses `gh pr checks --required` which automatically waits for all required checks - no job name references to update. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/hacs.yaml | 19 ------------ .github/workflows/hassfest.yaml | 16 ---------- .../{python.yaml => integration.yaml} | 31 +++++++++++++------ 3 files changed, 22 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/hacs.yaml delete mode 100644 .github/workflows/hassfest.yaml rename .github/workflows/{python.yaml => integration.yaml} (69%) diff --git a/.github/workflows/hacs.yaml b/.github/workflows/hacs.yaml deleted file mode 100644 index 69a039c3..00000000 --- a/.github/workflows/hacs.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: "HACS" -# yamllint disable-line rule:truthy -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - validate_hacs: - name: "HACS Validation" - runs-on: ubuntu-latest - steps: - - uses: "actions/checkout@v6" - - name: HACS Action - uses: "hacs/action@main" - with: - category: "integration" diff --git a/.github/workflows/hassfest.yaml b/.github/workflows/hassfest.yaml deleted file mode 100644 index 274d2856..00000000 --- a/.github/workflows/hassfest.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -name: "Hassfest" -# yamllint disable-line rule:truthy -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - validate_hassfest: - name: "Hassfest Validation" - runs-on: "ubuntu-latest" - steps: - - uses: "actions/checkout@v6" - - uses: home-assistant/actions/hassfest@master diff --git a/.github/workflows/python.yaml b/.github/workflows/integration.yaml similarity index 69% rename from .github/workflows/python.yaml rename to .github/workflows/integration.yaml index 7ebb1f18..761e0f19 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/integration.yaml @@ -1,5 +1,5 @@ --- -name: Python +name: Integration # yamllint disable-line rule:truthy on: @@ -7,29 +7,25 @@ on: branches: [main] paths: - "**.py" - - ".github/workflows/python.yaml" + - ".github/workflows/integration.yaml" pull_request: branches: [main] paths: - "**.py" - "requirements*.txt" - "pyproject.toml" - - ".github/workflows/python.yaml" + - ".github/workflows/integration.yaml" jobs: test: name: Test runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.13"] - steps: - uses: actions/checkout@v6 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v6 with: - python-version: ${{ matrix.python-version }} + python-version: "3.13" - name: Install uv uses: astral-sh/setup-uv@v5 with: @@ -51,3 +47,20 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} flags: python files: coverage.xml + + hacs: + name: HACS + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: HACS Action + uses: hacs/action@main + with: + category: integration + + hassfest: + name: Hassfest + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: home-assistant/actions/hassfest@master From 69730aa21f79bdf2f77008d422fdb35f52a90448 Mon Sep 17 00:00:00 2001 From: raman325 <7243222+raman325@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:37:03 -0500 Subject: [PATCH 10/15] Consolidate release-drafter and auto-merge into repository.yaml Merge release-drafter.yaml and auto-merge.yaml into a single repository.yaml workflow for better organization in GitHub UI. Both jobs retain their original concurrency settings at job level. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/release-drafter.yaml | 52 ------------- .../{auto-merge.yaml => repository.yaml} | 73 +++++++++++++++---- 2 files changed, 59 insertions(+), 66 deletions(-) delete mode 100644 .github/workflows/release-drafter.yaml rename .github/workflows/{auto-merge.yaml => repository.yaml} (50%) diff --git a/.github/workflows/release-drafter.yaml b/.github/workflows/release-drafter.yaml deleted file mode 100644 index 19258fde..00000000 --- a/.github/workflows/release-drafter.yaml +++ /dev/null @@ -1,52 +0,0 @@ ---- -name: Release Drafter - -# yamllint disable-line rule:truthy -on: - push: - branches: - - main - pull_request: - types: - - labeled - - opened - - reopened - - synchronize - - unlabeled - # pull_request_target is needed for fork PRs - it runs in the base repo context - # with elevated permissions required for pull-requests: write - pull_request_target: - types: - - labeled - - opened - - reopened - - synchronize - - unlabeled - workflow_dispatch: - -permissions: - contents: read - -concurrency: - # Use head_ref for PRs (branch name) or ref for pushes (refs/heads/main) - # This ensures PR updates are serialized while different PRs run concurrently - group: release-drafter-${{ github.head_ref || github.ref }} - cancel-in-progress: false - -jobs: - update_release_draft: - name: Update release draft - permissions: - contents: write - pull-requests: write - runs-on: ubuntu-latest - steps: - # Give GitHub API time to index newly merged PRs before querying - - name: Wait for PR indexing - if: github.event_name == 'push' - run: sleep 10 - - uses: release-drafter/release-drafter@v6 - with: - commitish: main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/auto-merge.yaml b/.github/workflows/repository.yaml similarity index 50% rename from .github/workflows/auto-merge.yaml rename to .github/workflows/repository.yaml index e064019f..134cb0d0 100644 --- a/.github/workflows/auto-merge.yaml +++ b/.github/workflows/repository.yaml @@ -1,27 +1,72 @@ --- -name: auto-merge +name: Repository -"on": +# yamllint disable-line rule:truthy +on: + push: + branches: [main] pull_request: - types: [opened, synchronize, reopened, labeled, unlabeled] + types: + - labeled + - opened + - reopened + - synchronize + - unlabeled + # pull_request_target is needed for fork PRs - it runs in the base repo context + # with elevated permissions required for pull-requests: write + pull_request_target: + types: + - labeled + - opened + - reopened + - synchronize + - unlabeled + workflow_dispatch: permissions: - contents: write - pull-requests: write - -# Cancel in-progress runs for the same PR (only latest should merge) -concurrency: - group: auto-merge-${{ github.event.pull_request.number }} - cancel-in-progress: true + contents: read jobs: + update-release-draft: + name: Update Release Draft + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + concurrency: + # Use head_ref for PRs (branch name) or ref for pushes (refs/heads/main) + # This ensures PR updates are serialized while different PRs run concurrently + group: release-drafter-${{ github.head_ref || github.ref }} + cancel-in-progress: false + steps: + # Give GitHub API time to index newly merged PRs before querying + - name: Wait for PR indexing + if: github.event_name == 'push' + run: sleep 10 + - uses: release-drafter/release-drafter@v6 + with: + commitish: main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + auto-merge: + name: Auto Merge runs-on: ubuntu-latest - # Run for dependabot, pre-commit-ci, or PRs with auto-merge label + # Only run on pull_request events (not push, pull_request_target, or workflow_dispatch) + # and only for dependabot, pre-commit-ci, or PRs with auto-merge label if: >- - github.event.pull_request.user.login == 'dependabot[bot]' || - github.event.pull_request.user.login == 'pre-commit-ci[bot]' || - contains(github.event.pull_request.labels.*.name, 'auto-merge') + github.event_name == 'pull_request' && ( + github.event.pull_request.user.login == 'dependabot[bot]' || + github.event.pull_request.user.login == 'pre-commit-ci[bot]' || + contains(github.event.pull_request.labels.*.name, 'auto-merge') + ) + permissions: + contents: write + pull-requests: write + concurrency: + # Cancel in-progress runs for the same PR (only latest should merge) + group: auto-merge-${{ github.event.pull_request.number }} + cancel-in-progress: true steps: # Fetch Dependabot metadata (only runs for dependabot PRs) - name: Fetch Dependabot metadata From 1bfe69af0f57ce41587a7027e66431fa3a8e6878 Mon Sep 17 00:00:00 2001 From: raman325 <7243222+raman325@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:39:32 -0500 Subject: [PATCH 11/15] Use ruff-check hook ID instead of legacy ruff alias Co-Authored-By: Claude Opus 4.5 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 273e348f..75b53b0a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.14.11 hooks: - - id: ruff + - id: ruff-check files: ^(scripts|tests|custom_components)/.+\.py$ args: [--fix, --exit-non-zero-on-fix] - id: ruff-format From 29ab75cddbe1cf6292a3b7715d75ce729c8ae8ab Mon Sep 17 00:00:00 2001 From: raman325 <7243222+raman325@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:42:17 -0500 Subject: [PATCH 12/15] Add 1% threshold for codecov project status checks Allows small coverage decreases (up to 1%) without failing CI. Co-Authored-By: Claude Opus 4.5 --- codecov.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/codecov.yml b/codecov.yml index e7fe6d46..6ca413b8 100644 --- a/codecov.yml +++ b/codecov.yml @@ -7,11 +7,13 @@ coverage: paths: - custom_components/ - tests/ + threshold: 1% typescript: flags: - typescript paths: - ts/ + threshold: 1% patch: python: flags: From 60c9ca8e09d4b37199f3fe3b45cc5a6382ee8b15 Mon Sep 17 00:00:00 2001 From: raman325 <7243222+raman325@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:45:25 -0500 Subject: [PATCH 13/15] Rename Test jobs to Pytest and Vitest for clarity Distinct names allow proper branch protection configuration. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/frontend.yaml | 2 +- .github/workflows/integration.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/frontend.yaml b/.github/workflows/frontend.yaml index 0e04f092..37b2db86 100644 --- a/.github/workflows/frontend.yaml +++ b/.github/workflows/frontend.yaml @@ -66,7 +66,7 @@ jobs: core.setFailed('Repo is dirty after build! Run yarn build locally before pushing changes.') test: - name: Test + name: Vitest runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 761e0f19..c0ac0e23 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -18,7 +18,7 @@ on: jobs: test: - name: Test + name: Pytest runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 From 0a963fade38e8ce10914baa880d43987697634e8 Mon Sep 17 00:00:00 2001 From: raman325 <7243222+raman325@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:46:27 -0500 Subject: [PATCH 14/15] Add comment explaining why Lint and Build job is needed pre-commit.ci skips yarn hooks due to missing Node.js. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/frontend.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/frontend.yaml b/.github/workflows/frontend.yaml index 37b2db86..1d2e6d1b 100644 --- a/.github/workflows/frontend.yaml +++ b/.github/workflows/frontend.yaml @@ -30,6 +30,7 @@ on: jobs: lint-and-build: + # pre-commit.ci skips yarn-lint and yarn-build (Node.js not available), so CI needs this job name: Lint and Build runs-on: ubuntu-latest steps: From be278d52924e6e32d25cddbb81ab3628f4663b4e Mon Sep 17 00:00:00 2001 From: raman325 <7243222+raman325@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:51:27 -0500 Subject: [PATCH 15/15] Rename Lint and Build to Yarn Lint and Build More explicit naming for the yarn-based lint and build job. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/frontend.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/frontend.yaml b/.github/workflows/frontend.yaml index 1d2e6d1b..7541dd48 100644 --- a/.github/workflows/frontend.yaml +++ b/.github/workflows/frontend.yaml @@ -31,7 +31,7 @@ on: jobs: lint-and-build: # pre-commit.ci skips yarn-lint and yarn-build (Node.js not available), so CI needs this job - name: Lint and Build + name: Yarn Lint and Build runs-on: ubuntu-latest steps: - uses: actions/checkout@v6