Skip to content

Reset verified certificates to pending during Android host re-enrollment (#43443)#43602

Merged
getvictor merged 1 commit intorc-minor-fleet-v4.84.0from
victor/42600-cherry-pick
Apr 17, 2026
Merged

Reset verified certificates to pending during Android host re-enrollment (#43443)#43602
getvictor merged 1 commit intorc-minor-fleet-v4.84.0from
victor/42600-cherry-pick

Conversation

@getvictor
Copy link
Copy Markdown
Member

Related issue: Resolves #42600

Unreleased bug:
#42600 (comment)

Checklist for submitter

Testing

  • Added/updated automated tests
  • QA'd all new/changed functionality manually

For unreleased bug fixes in a release candidate, one of:

  • Confirmed that the fix is not expected to adversely impact load test results

Summary by CodeRabbit

  • Bug Fixes

  • Re-enrolling devices now fully reset certificate templates: templates return to pending (install retained), retry counts and delivery metadata are cleared to avoid stale state.

  • Behavior

  • Re-enrollment explicitly deletes prior device certificate entries before creating fresh pending templates to prevent duplicates and stale data.

  • Tests

  • Added tests covering Android re-enrollment to verify templates are recreated and metadata is cleared.

(cherry picked from commit 67d0c57)

…ent (#43443)

<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #42600

Unreleased bug:
#42600 (comment)

# Checklist for submitter

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually

For unreleased bug fixes in a release candidate, one of:

- [x] Confirmed that the fix is not expected to adversely impact load
test results

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Re-enrolling devices now fully reset certificate templates: templates
return to pending (install retained), retry counts and delivery metadata
are cleared to avoid stale state.

* **Behavior**
* Re-enrollment explicitly deletes prior device certificate entries
before creating fresh pending templates to prevent duplicates and stale
data.

* **Tests**
* Added tests covering Android re-enrollment to verify templates are
recreated and metadata is cleared.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

(cherry picked from commit 67d0c57)
@getvictor getvictor marked this pull request as ready for review April 15, 2026 12:40
@getvictor getvictor requested a review from a team as a code owner April 15, 2026 12:40
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

Codecov Report

❌ Patch coverage is 76.66667% with 7 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (rc-minor-fleet-v4.84.0@da2080b). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...rver/datastore/mysql/host_certificate_templates.go 69.23% 2 Missing and 2 partials ⚠️
server/mdm/android/service/pubsub.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##             rc-minor-fleet-v4.84.0   #43602   +/-   ##
=========================================================
  Coverage                          ?   66.86%           
=========================================================
  Files                             ?     2579           
  Lines                             ?   207114           
  Branches                          ?     9239           
=========================================================
  Hits                              ?   138485           
  Misses                            ?    56023           
  Partials                          ?    12606           
Flag Coverage Δ
backend 68.63% <76.66%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@getvictor getvictor merged commit 391eee2 into rc-minor-fleet-v4.84.0 Apr 17, 2026
52 of 53 checks passed
@getvictor getvictor deleted the victor/42600-cherry-pick branch April 17, 2026 15:30
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.

Android host certificate templates not cleared when device is re-enrolled

2 participants