feat(docs): Update coding standards to clarify database storage guide…#1583
feat(docs): Update coding standards to clarify database storage guide…#1583
Conversation
📝 WalkthroughWalkthroughUpdated code standards documentation to establish a database convention: temporary statistics storage belongs in the database, while long-term configuration must reside in the Changes
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/skills/code-standards/SKILL.md (1)
16-16: Use hyphenation for the compound adjective.At Line 16, use “long-term configuration” (hyphenated) for correctness/readability.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/skills/code-standards/SKILL.md at line 16, Update the phrasing on the line that reads "long term configuration" to use hyphenation: change it to "long-term configuration" so the compound adjective is correct (reference the sentence containing "treat DB as temporary storage for stats, long term configuration should be stored in the /config folder").
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/skills/code-standards/SKILL.md:
- Line 16: Replace the misleading sentence that says the DB is only for
temporary stats and /config holds long-term configuration with a clarifying
statement framing configuration as "source of truth vs runtime cache" — update
the SKILL.md line to say the DB may hold canonical configuration while /config
provides restoration fixtures and the DB can act as a runtime cache (mention the
behaviour in initialise.py and db_upgrade.py as examples of config represented
in the DB); keep the guidance succinct and avoid absolute language that excludes
storing configuration in the DB.
---
Nitpick comments:
In @.github/skills/code-standards/SKILL.md:
- Line 16: Update the phrasing on the line that reads "long term configuration"
to use hyphenation: change it to "long-term configuration" so the compound
adjective is correct (reference the sentence containing "treat DB as temporary
storage for stats, long term configuration should be stored in the /config
folder").
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8cf4b100-5362-432b-98a5-c31c03abdd5c
📒 Files selected for processing (1)
.github/skills/code-standards/SKILL.md
| - follow DRY principle - maintainability of code is more important than speed of implementation | ||
| - code files should be less than 500 LOC for better maintainability | ||
| - DB columns must not contain underscores, use camelCase instead (e.g., deviceInstanceId, not device_instance_id) | ||
| - treat DB as temporary storage for stats, long term configuration should be stored in the /config folder, the /config folder should allow you to restore most of your functionality (excluding historical data) |
There was a problem hiding this comment.
Clarify DB semantics to avoid misleading architecture decisions.
Line 16 currently reads as if DB should only hold stats and /config exclusively holds long-term configuration. That conflicts with current behavior where configuration is also represented in DB (server/initialise.py, Line 732–Line 741; server/db/db_upgrade.py, Line 511–Line 537). Please reword this as “source of truth vs runtime cache” rather than “DB temporary stats only.”
Proposed wording update
-- treat DB as temporary storage for stats, long term configuration should be stored in the /config folder, the /config folder should allow you to restore most of your functionality (excluding historical data)
+- treat `/config` as the source of truth for restorable long-term configuration; DB may store runtime/cache state (including settings representations) and historical/statistical data. `/config` should restore most functionality (excluding historical data).📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - treat DB as temporary storage for stats, long term configuration should be stored in the /config folder, the /config folder should allow you to restore most of your functionality (excluding historical data) | |
| - treat `/config` as the source of truth for restorable long-term configuration; DB may store runtime/cache state (including settings representations) and historical/statistical data. `/config` should restore most functionality (excluding historical data). |
🧰 Tools
🪛 LanguageTool
[uncategorized] ~16-~16: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...reat DB as temporary storage for stats, long term configuration should be stored in the /...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/skills/code-standards/SKILL.md at line 16, Replace the misleading
sentence that says the DB is only for temporary stats and /config holds
long-term configuration with a clarifying statement framing configuration as
"source of truth vs runtime cache" — update the SKILL.md line to say the DB may
hold canonical configuration while /config provides restoration fixtures and the
DB can act as a runtime cache (mention the behaviour in initialise.py and
db_upgrade.py as examples of config represented in the DB); keep the guidance
succinct and avoid absolute language that excludes storing configuration in the
DB.
…lines
Summary by CodeRabbit