Skip to content

fix: supports null values for MEBX and MPSPasswords#753

Merged
rsdmike merged 1 commit intomainfrom
fixNullHandling
Jan 12, 2026
Merged

fix: supports null values for MEBX and MPSPasswords#753
rsdmike merged 1 commit intomainfrom
fixNullHandling

Conversation

@rsdmike
Copy link
Member

@rsdmike rsdmike commented Jan 12, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 12, 2026 21:04
@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

❌ Patch coverage is 63.88889% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.87%. Comparing base (ae4e0fa) to head (c747c7b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/usecase/devices/repo.go 46.66% 4 Missing and 4 partials ⚠️
internal/usecase/devices/usecase.go 76.19% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #753      +/-   ##
==========================================
+ Coverage   39.78%   39.87%   +0.09%     
==========================================
  Files         112      112              
  Lines       10580    10596      +16     
==========================================
+ Hits         4209     4225      +16     
+ Misses       6020     6016       -4     
- Partials      351      355       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 pull request modifies the device entity to support nullable values for MPSPassword and MEBXPassword fields, changing them from required string fields to optional pointer fields that can be null in the database.

Changes:

  • Updated entity structure to use pointer types (*string) for MPSPassword and MEBXPassword fields
  • Modified database schema in test files to remove NOT NULL constraints for these password columns
  • Enhanced password handling logic to properly encrypt/decrypt nullable password fields
  • Added comprehensive test coverage for scenarios with both nil and non-nil password values

Reviewed changes

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

Show a summary per file
File Description
internal/entity/device.go Changed MPSPassword and MEBXPassword from string to *string to support null values
internal/usecase/sqldb/device_test.go Updated test database schema to remove NOT NULL constraints from password columns
internal/usecase/devices/usecase.go Modified dtoToEntity and entityToDTO to handle nil pointer values during encryption/decryption
internal/usecase/devices/repo.go Updated GetByID to safely dereference password pointers before decryption
internal/usecase/devices/repo_test.go Added comprehensive tests for password handling including nil cases and added ptr helper function

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

@rsdmike rsdmike enabled auto-merge (squash) January 12, 2026 22:27
Copy link
Contributor

@graikhel-intel graikhel-intel left a comment

Choose a reason for hiding this comment

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

Looks good to me, I was able to load the devices page after upgrading from v1.15 using this fix.

@rsdmike rsdmike merged commit e568fca into main Jan 12, 2026
19 checks passed
@rsdmike rsdmike deleted the fixNullHandling branch January 12, 2026 22:27
@RosieAMT
Copy link

🎉 This PR is included in version 1.18.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants