Add workaround for CSS HEX colors in markdown.
Closes https://github.com/hacs/integration/issues/4688
📝 Walkthrough
"""
Walkthrough
The changes introduce a new test job to the GitHub Actions workflow, enhance the markdown issue reference conversion to avoid mangling CSS hex color codes, add comprehensive tests for this logic, and include a Vitest configuration for running the tests.
Changes
| File(s) | Change Summary |
|---|---|
| .github/workflows/test.yml | Added a test job to CI workflow to run Vitest tests; renamed workflow to "Test and Build". |
| src/tools/markdown.ts | Improved regex and logic in markdownWithRepositoryContext to avoid converting CSS hex color codes to issue links. |
| tests/markdown.test.ts | Added new test suite covering various scenarios for markdownWithRepositoryContext, including edge cases and performance. |
| vitest.config.ts | Added Vitest configuration specifying test environment and test file patterns. |
Sequence Diagram(s)
sequenceDiagram
participant Developer
participant GitHub Actions
participant Node.js
participant Vitest
Developer->>GitHub Actions: Push code / PR
GitHub Actions->>Node.js: Set up Node.js 18
GitHub Actions->>Node.js: Install dependencies (script/bootstrap)
GitHub Actions->>Vitest: Run tests (npx vitest run)
Vitest-->>GitHub Actions: Test results
GitHub Actions-->>Developer: Report build and test status
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
Prevent markdownWithRepositoryContext from converting CSS hex color codes to issue links (#4688) |
✅ | |
| Add tests to verify correct handling of issue references and CSS hex codes (#4688) | ✅ |
Assessment against linked issues: Out-of-scope changes
No out-of-scope changes found. """
[!WARNING] There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.
🔧 ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
yarn install v1.22.22 [1/4] Resolving packages... (node:3141) [DEP0169] DeprecationWarning:
url.parse()behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued forurl.parse()vulnerabilities. (Usenode --trace-deprecation ...to show where the warning was created) warning Resolution field "[email protected]" is incompatible with requested version "lit@^3.1.2" warning Resolution field "[email protected]" is incompatible with requested version "lit-html@^3.2.0" warning Resolution field "[email protected]" is incompatible with requested version "lit@^3.2.0" warning Resolution field "[email protected]" is incompatible with requested version "lit@^3.1.2" warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-button > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-button > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-button > @material/mwc-ripple > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-checkbox > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-checkbox > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-dialog > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-dialog > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-drawer > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-fab > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-formfield > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-icon-button > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-linear-progress > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-list > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-list > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-list > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-list > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-list > @material/mwc-radio > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-list > @material/mwc-radio > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-menu > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-menu > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-select > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-select > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-select > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-select > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-select > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-select > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-select > @material/mwc-notched-outline > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-select > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-snackbar > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-switch > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-switch > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-tab > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-tab > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-tab > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-tab > @material/mwc-tab-indicator > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-tab-bar > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-tab-bar > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-tab-bar > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-tab-bar > @material/mwc-tab-scroller > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-textarea > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-textarea > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-textarea > @material/mwc-textfield > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-textarea > @material/mwc-textfield > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-textarea > @material/mwc-textfield > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-textarea > @material/mwc-textfield > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-top-app-bar > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning @material/mwc-top-app-bar-fixed > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning Resolution field "[email protected]" is incompatible with requested version "lit@^3.0.0" warning Resolution field "[email protected]" is incompatible with requested version "lit@^3.0.0" warning Resolution field "[email protected]" is incompatible with requested version "lit@^3.0.0" warning Resolution field "[email protected]" is incompatible with requested version "lit@^3.0.0" warning Resolution field "[email protected]" is incompatible with requested version "lit@^3.0.0" warning Resolution field "[email protected]" is incompatible with requested version "lit@^3.0.0" warning Resolution field "[email protected]" is incompatible with requested version "lit@^3.0.0" warning Resolution field "[email protected]" is incompatible with requested version "lit@^3.0.0" warning Resolution field "[email protected]" is incompatible with requested version "lit@^3.0.0" warning Resolution field "[email protected]" is incompatible with requested version "lit@^3.0.0" warning Resolution field "[email protected]" is incompatible with requested version "lit@^3.0.0" warning app-datepicker > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning app-datepicker > @material/mwc-button > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning app-datepicker > @material/mwc-button > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web warning app-datepicker > @material/mwc-button > @material/mwc-ripple > @material/[email protected]: MWC beta is longer supported. Please upgrade to @material/web error Couldn't find any versions for "hls.js" that matches "patch:hls.js@npm%3A1.5.7#~/homeassistant-frontend/.yarn/patches/hls.js-npm-1.5.7-f5bbd3d060.patch" info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
📜 Recent review details
Configuration used: CodeRabbit UI Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge Base: Disabled due to data retention organization setting
📥 Commits
Reviewing files that changed from the base of the PR and between c003657d8e3ea0244b42f039b6ba14186829995d and 19ac839f7b51fde6c7cff6081ee0510e8382a58a.
📒 Files selected for processing (2)
src/tools/markdown.ts(1 hunks)tests/markdown.test.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- src/tools/markdown.ts
- tests/markdown.test.ts
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Run tests
- GitHub Check: Test build
✨ Finishing Touches
- [ ] 📝 Generate Docstrings
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.
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
‼️ IMPORTANT Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai explain this code block.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and explain its main purpose.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.