Conversation
|
@copilot we have three errors to resolve: /home/runner/work/velocity.report/velocity.report/web/src/routes/settings/+page.svelte
Error: 87:11 error Unexpected href link without resolve() svelte/no-navigation-without-resolve
/home/runner/work/velocity.report/velocity.report/web/src/routes/settings/serial/+page.svelte
Error: 200:11 error 'formatTimestamp' is defined but never used @typescript-eslint/no-unused-vars
Error: 421:9 error Each block should have a key svelte/require-each-key |
... Fixed all three linting errors in commit 2781135:
All files now pass eslint and build successfully. |
|
@copilot you no longer have the required jest test coverage (90%). update all affected tests: https://github.com/banshee-data/velocity.report/actions/runs/19150225542/job/54738507812?pr=61 --------------|---------|----------|---------|---------|-----------------------------------------------------------------
|
Test coverage restored to 98%+ in commit 91d7b32. Added comprehensive Jest tests for all 8 serial configuration API functions with both success and error cases: Coverage Results:
All thresholds now exceed the required 90%. 123 total tests passing. |
|
@copilot add functionality to hot-swap config changes without restart and update the implementation guide with current state |
Hot-reload functionality implemented in commit cf20a2d. Configuration changes can now be applied without server restart. New Features:
How to Use:
Implementation Guide:
All tests passing with 98.5%+ coverage. |
|
@copilot Can agent Ictinus review this current implementation, and pay attention to aligement (style, functionality, compatability) with existing serialmux ( internal/serialmux/templates/send-command.html.tmpl and internal/serialmux/serialmux.go ) code |
Reviewed implementation for alignment with existing serialmux code. The implementation follows serialmux patterns: Alignment: Design Differences (intentional):
Integration: No changes needed - implementation is compatible with existing serialmux architecture. |
|
@copilot add planned features : |
Added detailed specifications for planned features in commit 66a8687. 3. Health Monitoring:
5. Configuration Templates:
Both features are documented in the "Planned (Not Yet Implemented)" section of |
|
@codex review |
Co-authored-by: ddol <445312+ddol@users.noreply.github.com>
…dels Co-authored-by: ddol <445312+ddol@users.noreply.github.com>
Co-authored-by: ddol <445312+ddol@users.noreply.github.com>
Co-authored-by: ddol <445312+ddol@users.noreply.github.com>
Co-authored-by: ddol <445312+ddol@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: David Dolphin <445312+ddol@users.noreply.github.com>
* Initial plan * Phase 1: Database foundation for serial configuration Co-authored-by: ddol <445312+ddol@users.noreply.github.com> * Phase 2 (partial): Add serial config CRUD API endpoints and sensor models Co-authored-by: ddol <445312+ddol@users.noreply.github.com> * Phase 2: Add serial testing and device discovery endpoints Co-authored-by: ddol <445312+ddol@users.noreply.github.com> * Phase 3: Complete web UI for serial configuration Co-authored-by: ddol <445312+ddol@users.noreply.github.com> * Fix ID conversion bug in serial config tests (code review feedback) Co-authored-by: ddol <445312+ddol@users.noreply.github.com> * Implement serial reload manager and apply DB port settings * [tex] sanitise inputs with escape_latex() & [js] fix download bug (#99) * Fix LaTeX injection vulnerability (CVE-9.8) by escaping user input Import and apply escape_latex() from pylatex.utils to all user-controlled strings (location, surveyor, contact) before passing to LaTeX rendering. Changes: - Import escape_latex from pylatex.utils - Add fallback escape_latex for when pylatex is unavailable - Escape location in setup_header() method (line 196) - Escape location, surveyor, contact in begin_twocolumn_layout() (lines 222, 225-226) This prevents LaTeX injection attacks where malicious input like "\input{/etc/passwd}" could read arbitrary files or execute commands. Security Impact: - Blocks remote code execution via LaTeX injection - Prevents arbitrary file read/write - Mitigates CVSS 9.8 critical vulnerability Tested: - All 562 PDF generator tests pass - escape_latex correctly converts "\input{/etc/passwd}" to safe literal text - Python linting passes (black, ruff) Co-authored-by: ddol <445312+ddol@users.noreply.github.com> * [js] fix: remove base path reference for report download links in +page.svelte * [ai] Update tools/pdf-generator/pdf_generator/core/document_builder.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: David Dolphin <445312+ddol@users.noreply.github.com> --------- Signed-off-by: David Dolphin <445312+ddol@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * [ai] align Copilot instructions with documented best practices (#101) * Initial plan * Enhance copilot-instructions.md with comprehensive best practices Co-authored-by: ddol <445312+ddol@users.noreply.github.com> * Add concrete examples and troubleshooting to Copilot instructions Co-authored-by: ddol <445312+ddol@users.noreply.github.com> * Improve clarity and add Windows support to Copilot instructions Co-authored-by: ddol <445312+ddol@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ddol <445312+ddol@users.noreply.github.com> * Initial plan * [go] enhance SerialPortManager for thread-safety and closed state handling * [go] validate database configuration in ReloadConfig method * [go] enhance serial hot-reload functionality with clear logging and API behavior in non-production modes * [go] enhance SerialPortManager with event fanout for resilient subscriptions across mux reloads * [ai] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: David Dolphin <445312+ddol@users.noreply.github.com> * [go] handle error in serial options comparison during config reload * [ai] Update internal/api/serial_reload.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: David Dolphin <445312+ddol@users.noreply.github.com> --------- Signed-off-by: David Dolphin <445312+ddol@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: ddol <445312+ddol@users.noreply.github.com>
…nd reuse in main logic
…constant and improve error messaging
… and improve security checks against symlink escape attacks
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: David Dolphin <445312+ddol@users.noreply.github.com>
…ent and API imports
… and replace SelectField with native select elements for improved performance
…table styling for better readability
…ct elements with SelectField for improved usability
…e select elements for improved performance and usability
* Initial plan * [ai][sql] convert serial config migration to golang-migrate format Move the serial configuration migration from the legacy data/migrations/ location to internal/db/migrations/ using golang-migrate format: - Renamed data/migrations/20251106_create_radar_serial_config.sql to internal/db/migrations/000009_create_radar_serial_config.up.sql - Created internal/db/migrations/000009_create_radar_serial_config.down.sql for rollback support This prepares the branch for rebasing onto main, which has migrated to golang-migrate (PR #121). The migration content is identical but follows the new sequential numbering (000009) instead of date-based naming (20251106). During rebase, the conflict at commit 5cecb7f can be resolved by: git rm internal/db/migrations/20251106_create_radar_serial_config.sql git rebase --continue * [ai][sh] add rebase-helper.sh script to automate conflict resolution Co-authored-by: ddol <445312+ddol@users.noreply.github.com> * [ai][sh] address code review feedback in rebase-helper.sh Co-authored-by: ddol <445312+ddol@users.noreply.github.com> * [ai][sh] address review feedback: use set -euo pipefail, add .down.sql handler, fix pnpm-lock.yaml Co-authored-by: ddol <445312+ddol@users.noreply.github.com> * [ai][sql] wrap trigger in StatementBegin/End markers for golang-migrate compatibility Co-authored-by: ddol <445312+ddol@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ddol <445312+ddol@users.noreply.github.com>
…ng, cleanup (#143) * Initial plan * [ai][go][js] Address PR #61 review comments: fix spelling, add error logging, fix hot-reload order Co-authored-by: ddol <445312+ddol@users.noreply.github.com> * [ai][go] Add clarifying comment about two-phase locking in ReloadConfig Co-authored-by: ddol <445312+ddol@users.noreply.github.com> * [ai][cfg] Remove accidentally committed package-lock.json (project uses pnpm) Co-authored-by: ddol <445312+ddol@users.noreply.github.com> * [ai][go] Fix missing log import in serialmux.go and improve reload safety Co-authored-by: ddol <445312+ddol@users.noreply.github.com> * [ai][js] Add serial config API tests to achieve 90%+ web coverage Co-authored-by: ddol <445312+ddol@users.noreply.github.com> * [ai][cfg] Remove package-lock.json and add to .gitignore (project uses pnpm) Co-authored-by: ddol <445312+ddol@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ddol <445312+ddol@users.noreply.github.com>
d53af52 to
18df090
Compare
|
Coverage after merging copilot/add-serial-configuration-ui into main will be
|
|
moved to #290 |
Serial Configuration and Testing via UI - Complete Implementation ✅
Implemented Phases 1-3 of the serial configuration feature as specified in
docs/features/serial-configuration-ui.md, plus hot-reload capability for applying configuration changes without server restart.✅ Phase 1: Database Foundation (Complete)
data/migrations/20251106_create_radar_serial_config.sqlradar_serial_configtable tointernal/db/schema.sql/dev/ttySC1internal/db/serial_config.gowith comprehensive testscmd/radar/radar.goto load serial configs from database on startup--ignore-db-serialflag; CLI flags work as fallback✅ Phase 2: API Endpoints (Complete)
internal/api/sensor_models.go(ops243-a, ops243-c) with capabilities and init commandsinternal/api/serial_config.goGET /api/serial/configs- List all configurationsGET /api/serial/configs/:id- Get single configurationPOST /api/serial/configs- Create configurationPUT /api/serial/configs/:id- Update configurationDELETE /api/serial/configs/:id- Delete configurationGET /api/serial/models- List sensor modelsGET /api/serial/devices- List available serial devices (excludes configured ports)POST /api/serial/testininternal/api/serial_testing.goI?commandPOST /api/serial/reloadininternal/api/serial_reload.go⭐ NEWinternal/api/serial_config_test.go✅ Phase 3: Web UI (Complete)
web/src/lib/api.tswith TypeScript types and functions for all serial endpoints including hot-reload/settings/serialroutesvelte.config.jswith SPA fallback for dynamic routes🧪 Testing & Quality Assurance
make test-go)make lint-go,make lint-web)make build-web)⭐ Hot-Reload Feature
How It Works:
Benefits:
Implementation:
internal/api/serial_reload.go- SerialPortManager for hot-reload managementinternal/api/server.go- Added serialManager field and SetSerialManager methodweb/src/lib/api.ts- reloadSerialConfig() functionweb/src/routes/settings/serial/+page.svelte- "Reload Active Config" button🔒 Security Considerations
/dev/tty*and/dev/serial*📝 Key Design Decisions
I?command to detect and correct baud rate🚀 Future Enhancements (Planned)
3. Health Monitoring - Track connection uptime and errors
5. Configuration Templates - Quick setup for common sensor models
Other Planned Features:
📖 Documentation
Feature spec:
docs/features/serial-configuration-ui.mdMigration file:
data/migrations/20251106_create_radar_serial_config.sqlQuick reference:
docs/features/SERIAL-CONFIG-QUICKREF.mdImplementation guide:
docs/features/SERIAL-CONFIG-IMPLEMENTATION.md⭐ UPDATEDFixes Serial config + test (baud, port) via UI #11
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.