Skip to content

Conversation

@CoMPaTech
Copy link
Member

@CoMPaTech CoMPaTech commented Jan 12, 2026

Summary by CodeRabbit

  • Chores
    • Replaced the Markdown linter with a Python-based tool and added its configuration (line-length rule disabled).
    • Switched local and CI pre-commit tooling to an alternative wrapper and added it as a commit-time dependency.
    • Updated CI workflows and scripts to use the new tooling, including cache and environment adjustments; one workflow step name includes a minor typographical change.
  • Documentation
    • Updated changelog to reflect these maintenance updates.

✏️ Tip: You can customize this high-level summary in your review settings.

@CoMPaTech CoMPaTech requested a review from a team as a code owner January 12, 2026 19:22
@CoMPaTech CoMPaTech added enhancement New feature or request dependencies Pull requests that update a dependency file quality pre-commit labels Jan 12, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 12, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Replace pre-commit with prek across CI workflows and scripts, swap node-based markdownlint for pymarkdown with a .pymarkdown config disabling MD013, bump workflow CACHE_VERSION values, update prepare action to v2, and remove PRE_COMMIT_HOME env var.

Changes

Cohort / File(s) Summary
GitHub Actions workflows
.github/workflows/core_next.yml, .github/workflows/test.yml
Bumped CACHE_VERSION values; removed PRE_COMMIT_HOME; updated prepare action to plugwise/gh-actions/prepare-python-and-code@v2; renamed steps and replaced pre-commit references/commands with prek.
Pre-commit & Markdown lint config
.pre-commit-config.yaml, .markdownlint.yaml, .pymarkdown
Swapped markdownlint hook (igorshubovych/markdownlint-clijackdewinter/pymarkdown, id pymarkdown, rev v0.9.34); removed default: true and MD013: false from .markdownlint.yaml; added .pymarkdown disabling md013.
Scripts & requirements
scripts/core-testing.sh, requirements_commit.txt
Added prek>=0.2.27; detect/install prek in venv; replaced pre-commit install/run steps with prek equivalents; invoke pymarkdown via prek run.
Changelog
CHANGELOG.md
Added entries noting introduction of prek and replacement of node-based markdownlint with pymarkdown.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer (push/PR)
  participant GH as GitHub Actions
  participant Prep as prepare-python-and-code@v2
  participant Runner as Job Runner (VM)
  participant Prek as prek (tool)
  participant Scripts as scripts/core-testing.sh

  Dev->>GH: push / open PR
  GH->>Prep: checkout & setup python
  Prep-->>Runner: python venv prepared
  Runner->>Prek: ensure prek installed (requirements_commit.txt)
  Runner->>Prek: prek install (hook setup)
  Runner->>Prek: prek run --all-files (pymarkdown, other hooks)
  Runner->>Scripts: run scripts/core-testing.sh (invokes prek as needed)
  Scripts->>Prek: prek run additional checks
  Prek-->>Runner: exit status
  Runner-->>GH: job result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • bouwew
  • github-actions
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Rework to prek + gh-actions v2' directly and specifically describes the main changes in the pull request: transitioning to prek tooling and updating GitHub Actions to v2.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch prek


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec8ba41 and 93b8403.

📒 Files selected for processing (1)
  • scripts/core-testing.sh
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: The linting rules in plugwise-beta have been updated to use TC001/TC002/TC003 instead of TCH001/TCH002/TCH003 for type-checking related rules.
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 789
File: .pre-commit-config.yaml:3-3
Timestamp: 2024-12-08T11:23:47.692Z
Learning: CoMPaTech considers Python 3.13 stable and prefers to use it in the project.
📚 Learning: 2025-01-25T20:42:24.862Z
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: In the plugwise-beta project, `uv` package manager was removed from core-testing.sh in favor of pip due to issues it was causing.

Applied to files:

  • scripts/core-testing.sh
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Setup for HA-core (release/master)
  • GitHub Check: Setup for HA-core (dev)
🔇 Additional comments (4)
scripts/core-testing.sh (4)

69-72: LGTM!

The prek presence check follows the same pattern as the existing uv and pytest checks. Installing from requirements_commit.txt addresses the unpinned installation concerns from previous reviews, as the dependency is now managed in a tracked requirements file.


101-103: LGTM!

The two-step installation flow is correct: first install dependencies from requirements_commit.txt (including prek), then run prek install to configure the hooks. This properly replaces the previous pre-commit-based setup.


281-282: LGTM!

The echo message and command are consistent (both reference "pymarkdown"). The prek invocation syntax with --all-files --hook-stage manual follows the expected pattern for running hooks manually.


322-328: Verify: Intentional use of pre-commit instead of prek here?

This block still uses pre-commit directly while the rest of the script has migrated to prek. If this is intentional because it runs within the HA-core directory (which uses pre-commit), consider adding a comment to clarify. Otherwise, this should be updated to use prek for consistency.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
scripts/core-testing.sh (1)

320-326: Inconsistent usage: pre-commit should be prek.

Line 325 still uses pre-commit instead of prek in the COMMIT_CHECK block. This is inconsistent with the migration to prek elsewhere in the script and could fail if pre-commit is not installed.

Proposed fix
 if [ -z "${GITHUB_ACTIONS}" ] && [ -n "${COMMIT_CHECK}" ] ; then 
 	cd "${coredir}" || exit
 	echo ""
 	echo -e "${CINFO}Core PR pre-commit check ...${CNORM}"
 	echo ""
-        git add -A ; pre-commit
+        git add -A ; prek
 fi
.github/workflows/core_next.yml (1)

51-59: Remove the precommit-home parameter or define the PRE_COMMIT_HOME environment variable.

Line 59 references ${{ env.PRE_COMMIT_HOME }} but this environment variable is not defined in the env block. It is also undefined in the test.yml workflow, which has the same reference. This will pass an empty string to the precommit-home parameter, which may cause the action to fail or behave unexpectedly.

.github/workflows/test.yml (2)

85-94: Undefined environment variable referenced.

Line 93 references ${{ env.PRE_COMMIT_HOME }}, but PRE_COMMIT_HOME is not defined in the env block (lines 6-9). This will resolve to an empty string. Additionally, other jobs using the same action (lines 106-113, 137-144, 178-185) don't pass the precommit-home parameter at all, creating an inconsistency.

Either:

  1. Remove the precommit-home parameter from this step (matching other jobs), or
  2. Define PRE_COMMIT_HOME in the env block if it's still needed for prek
Suggested fix (option 1: remove the parameter)
       - name: Prepare code checkout and python/prek/pre-commit setup
         id: cache-reuse
         uses: plugwise/gh-actions/prepare-python-and-code@v1
         with:
           cache-key: ${{ needs.cache.outputs.cache-key }}
           fail-on-miss: false  # First time create cache (if not already exists)
           python-version: ${{ needs.cache.outputs.python-version }}
           venv-dir: ${{ env.VENV }}
-          precommit-home: ${{ env.PRE_COMMIT_HOME }}
           clone-core: "true"

218-222: Pre-existing bug: Incorrect job reference.

Line 221 references needs.ha-core-release.outputs.release_failed, but the job is named ha-core-testing (line 123). This will always return an empty/undefined value, causing the release failure check to never trigger correctly.

Suggested fix
-          RELEASE_TESTS_FAILED="${{ needs.ha-core-release.outputs.release_failed }}"
+          RELEASE_TESTS_FAILED="${{ needs.ha-core-testing.outputs.release_failed }}"
🤖 Fix all issues with AI agents
In @CHANGELOG.md:
- Around line 8-10: Update the CHANGELOG entry that currently reads "Replace
node-based markdownlint with pythonesk library" to use a clearer term; replace
"pythonesk library" with either "Python-based library" or the explicit package
name (e.g., "pymarkdown") if that is the actual tool used, so the entry "Replace
node-based markdownlint with pythonesk library" becomes unambiguous.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4612dca and 5a0cb58.

📒 Files selected for processing (7)
  • .github/workflows/core_next.yml
  • .github/workflows/test.yml
  • .markdownlint.yaml
  • .pre-commit-config.yaml
  • .pymarkdown
  • CHANGELOG.md
  • scripts/core-testing.sh
💤 Files with no reviewable changes (1)
  • .markdownlint.yaml
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: The linting rules in plugwise-beta have been updated to use TC001/TC002/TC003 instead of TCH001/TCH002/TCH003 for type-checking related rules.
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 789
File: .pre-commit-config.yaml:3-3
Timestamp: 2024-12-08T11:23:47.692Z
Learning: CoMPaTech considers Python 3.13 stable and prefers to use it in the project.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Prepare
  • GitHub Check: Prepare
  • GitHub Check: Prepare
  • GitHub Check: Prepare
  • GitHub Check: Prepare
🔇 Additional comments (8)
.pymarkdown (1)

1-1: LGTM!

The configuration correctly disables the MD013 (line length) rule for pymarkdown. This is a reasonable choice as line length rules often conflict with code blocks, URLs, and tables in Markdown files.

.github/workflows/core_next.yml (1)

6-10: LGTM on cache version bump.

Incrementing the cache version is appropriate when changing the tooling from pre-commit to prek.

scripts/core-testing.sh (2)

98-101: LGTM!

The migration from pre-commit to prek for installation and hook setup is correctly implemented.


279-280: LGTM!

The pymarkdown integration via prek is correctly configured for the quality check stage.

.pre-commit-config.yaml (1)

119-123: Hook configuration is correct and uses the latest stable version.

The pymarkdown hook at v0.9.34 is properly configured and uses the most recent release. This aligns with the .pymarkdown configuration file added in this PR.

.github/workflows/test.yml (3)

6-9: LGTM: Cache version bump is appropriate.

Incrementing CACHE_VERSION to 3 aligns with the tooling change from pre-commit to prek, ensuring stale caches won't cause issues.


97-120: LGTM: Consistent renaming to prek.

The job name, step names, and command invocation are all consistently updated to reference prek. The prek run --all-files --show-diff-on-failure invocation with the SKIP environment variable for local hooks is appropriate.


137-144: LGTM: Step names consistently updated.

Step names are updated to reference "prek/pre-commit" matching the other jobs, and these steps correctly omit the precommit-home parameter (further highlighting the inconsistency in the prepare job noted above).

Also applies to: 178-185

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/test.yml (1)

220-220: Bug: Incorrect job reference will cause undefined output.

This line references needs.ha-core-release.outputs.release_failed, but the job is named ha-core-testing (Line 122), not ha-core-release. This will result in RELEASE_TESTS_FAILED being empty or undefined.

Proposed fix
-          RELEASE_TESTS_FAILED="${{ needs.ha-core-release.outputs.release_failed }}"
+          RELEASE_TESTS_FAILED="${{ needs.ha-core-testing.outputs.release_failed }}"
🧹 Nitpick comments (1)
scripts/core-testing.sh (1)

329-329: Inconsistent: still uses pre-commit instead of prek.

This line still references pre-commit directly while the rest of the script has migrated to prek. For consistency, consider updating this to use prek as well.

Suggested fix
-	git add -A ; pre-commit
+	git add -A ; prek run
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5a0cb58 and 78a285b.

📒 Files selected for processing (3)
  • .github/workflows/core_next.yml
  • .github/workflows/test.yml
  • scripts/core-testing.sh
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: The linting rules in plugwise-beta have been updated to use TC001/TC002/TC003 instead of TCH001/TCH002/TCH003 for type-checking related rules.
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 789
File: .pre-commit-config.yaml:3-3
Timestamp: 2024-12-08T11:23:47.692Z
Learning: CoMPaTech considers Python 3.13 stable and prefers to use it in the project.
📚 Learning: 2025-01-25T20:42:24.862Z
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: In the plugwise-beta project, `uv` package manager was removed from core-testing.sh in favor of pip due to issues it was causing.

Applied to files:

  • scripts/core-testing.sh
🔇 Additional comments (8)
.github/workflows/core_next.yml (2)

8-8: LGTM!

Bumping CACHE_VERSION to 3 is appropriate to invalidate caches after the tooling migration from pre-commit to prek.


51-51: LGTM!

The step name update reflects the addition of prek tooling. Keeping "pre-commit" in the name is reasonable since prek wraps pre-commit functionality.

scripts/core-testing.sh (3)

69-72: LGTM!

Good addition of prek presence check and installation within the venv setup, following the same pattern used for uv.


102-105: LGTM!

The migration from pre-commit to prek for hook management is correctly implemented.


283-284: LGTM!

Good migration from node-based markdownlint to pymarkdownlint, eliminating the Node.js dependency. The --hook-stage manual flag is appropriate for this type of validation.

.github/workflows/test.yml (3)

7-7: LGTM!

Cache version bump to 3 aligns with the tooling migration and matches core_next.yml.


85-85: LGTM!

Step and job names consistently updated to reflect prek usage, and the command migration from pre-commit run to prek run is correct.

Also applies to: 98-98, 105-105, 113-117


136-136: LGTM!

Step names in the testing jobs consistently updated to reflect the prek migration.

Also applies to: 177-177

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/core_next.yml:
- Around line 51-59: Rename the workflow step name from "Prepare code checkout
and python/prek/pre-commit setup" to "Prepare code checkout and python/prek
setup" to remove the misleading "pre-commit" mention, and open an issue against
the plugwise/gh-actions repo reporting the typo in the action.yml where the
input `clone-core` is incorrectly referenced as `${{ inputs.cone-core }}` so
that `clone-core: "true"` is passed correctly to the action; include the exact
broken reference `${{ inputs.cone-core }}` and suggest changing it to `${{
inputs.clone-core }}` in your issue so maintainers can fix the input mapping.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 78a285b and 6098510.

📒 Files selected for processing (2)
  • .github/workflows/core_next.yml
  • .github/workflows/test.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/test.yml
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 0
File: :0-0
Timestamp: 2025-01-25T20:42:24.862Z
Learning: The linting rules in plugwise-beta have been updated to use TC001/TC002/TC003 instead of TCH001/TCH002/TCH003 for type-checking related rules.
Learnt from: CoMPaTech
Repo: plugwise/plugwise-beta PR: 789
File: .pre-commit-config.yaml:3-3
Timestamp: 2024-12-08T11:23:47.692Z
Learning: CoMPaTech considers Python 3.13 stable and prefers to use it in the project.
🔇 Additional comments (1)
.github/workflows/core_next.yml (1)

6-10: LGTM!

Cache version bump is appropriate when migrating tooling from pre-commit to prek, ensuring fresh cache creation without stale artifacts.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the CI/CD tooling by introducing prek (a pre-commit wrapper) and upgrading to GitHub Actions v2, while also replacing the Node.js-based markdownlint with Python-based pymarkdown for better integration with the Python ecosystem.

Changes:

  • Replaced pre-commit with prek wrapper across scripts and workflows
  • Switched from markdownlint to pymarkdown with new .pymarkdown configuration file
  • Updated GitHub Actions from plugwise/gh-actions@v1 to @v2 with adjusted parameters
  • Bumped cache version from 1/2 to 3 to reflect tooling changes

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
scripts/core-testing.sh Added prek installation logic, replaced pre-commit commands with prek equivalents, updated markdownlint to pymarkdown
CHANGELOG.md Documented the prek and pymarkdown migration as chore items
.pymarkdown New configuration file for pymarkdown disabling MD013 (line length) rule
.pre-commit-config.yaml Replaced markdownlint-cli repository with pymarkdown repository and updated hook configuration
.markdownlint.yaml Removed legacy markdownlint configuration file (no longer needed)
.github/workflows/test.yml Updated cache version to 3, removed PRE_COMMIT_HOME env var, upgraded action version to v2, updated step names to reference prek
.github/workflows/core_next.yml Updated cache version to 3, removed PRE_COMMIT_HOME env var, upgraded action version to v2, updated step names to reference prek

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while testing for Development HA-core:

⚠️ Warning: Incompatible while testing against dev HA-core.
✔️ Success: No problem with testing against released HA-core.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (3)

.github/workflows/test.yml:62

  • The cache key computation should include 'requirements_commit.txt' in the hashFiles() call since this new file affects the environment dependencies. Without it, changes to requirements_commit.txt won't invalidate the cache, potentially causing builds to use outdated cached environments.
        run: echo "cache-key=${{ runner.os }}--${{ env.CACHE_VERSION }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', '.pre-commit-config.yaml', 'ha_pyproject.toml') }}" >> "$GITHUB_OUTPUT"

.github/workflows/core_next.yml:43

  • The cache key computation should include 'requirements_commit.txt' in the hashFiles() call since this new file affects the environment dependencies. Without it, changes to requirements_commit.txt won't invalidate the cache, potentially causing builds to use outdated cached environments.
        run: echo "cache-key=${{ runner.os }}-${{ env.CACHE_VERSION }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', '.pre-commit-config.yaml', 'ha_pyproject.toml') }}-dev-branch" >> "$GITHUB_OUTPUT"

scripts/core-testing.sh:327

  • This line still uses 'pre-commit' directly instead of 'prek'. It should be changed to 'prek' for consistency with the rest of the migration. Consider using 'prek run' or the appropriate prek command.
        git add -A ; pre-commit

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement New feature or request github-actions pre-commit quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants