Skip to content

Feat/copy schema tags to device - #1072

Merged
zven merged 3 commits into
devfrom
feat/copy-schema-tags-to-device
Aug 20, 2026
Merged

Feat/copy schema tags to device#1072
zven merged 3 commits into
devfrom
feat/copy-schema-tags-to-device

Conversation

@jona159

@jona159 jona159 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Type of Change

  • Dependency upgrade
  • Bug fix (non-breaking change)
  • Breaking change
    • e.g. a fixed bug or new feature that may break something else
  • New feature
  • Code quality improvements
    • e.g. refactoring, documentation, tests, tooling, ...

Implementation

Checklist

  • I gave this pull request a meaningful title
  • My pull request is targeting the dev branch
  • I have added documentation to my code
  • I have deleted code that I have commented out

Additional Information

  • This PR closes #

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Device creation now includes tags defined by the device schema, alongside user-provided and schema identity tags.
    • Duplicate tags are automatically removed.
  • Documentation

    • Updated the example device schema to demonstrate temperature, relative humidity, and PM10 sensors.
    • Refined the example’s tag configuration and formatting.

Walkthrough

Device creation now combines request tags, schema tags, and the schema identity tag, then removes duplicates. The example device schema defines three sensors and uses no preset tags.

Changes

Device schema tag handling

Layer / File(s) Summary
Tag merge and schema example
app/db/models/device.server.ts, public/examples/device-schema.json
Device creation merges request tags, schema tags, and the schema identity tag, then deduplicates them. The example schema defines temperature, relative-humidity, and PM10 sensors with an empty tags array.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 2f274

This change is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Description check ❓ Inconclusive The description contains only an incomplete template and does not explain the schema-tag changes. Complete the description with the implementation details, change type, testing information, and issue reference.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: copying schema tags to devices.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/copy-schema-tags-to-device

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

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 65.99% 2242 / 3397
🔵 Statements 64.53% 2316 / 3589
🔵 Functions 63.21% 433 / 685
🔵 Branches 50.84% 1081 / 2126
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
app/db/models/device.server.ts 61.21% 65.93% 59.18% 62.25% 91-96, 104, 210, 222-223, 288-345, 385, 419, 448, 477, 507, 511, 519-521, 527-529, 547-549, 553-555, 597-599, 614, 625-797, 848-852, 880-886, 891-907, 989-991, 1002, 1009-1010, 1022-1029, 1033-1044, 1084, 1192-1212, 1231
Generated in workflow #2887 for commit 213e9e6 by the Vitest Coverage Report Action

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
app/db/models/device.server.ts (1)

1047-1057: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add regression coverage for schema-derived tags.

The existing test in tests/db/models/device.server.spec.ts covers only request-provided tags. Add cases for schema tags, the schema:<slug> identity tag, and duplicate removal.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 463783dc-21a3-469e-a536-789e85a4d466

📥 Commits

Reviewing files that changed from the base of the PR and between 3f79a72 and 2f27464.

📒 Files selected for processing (2)
  • app/db/models/device.server.ts
  • public/examples/device-schema.json

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@zven zven linked an issue Aug 20, 2026 that may be closed by this pull request
@zven
zven merged commit d7e3d64 into dev Aug 20, 2026
7 checks passed
@zven
zven deleted the feat/copy-schema-tags-to-device branch August 20, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to provide custom tag(s) in registration schemas

2 participants