Skip to content

Engineering Initiated - FE: Improve api entity naming - #45865

Merged
RachelElysia merged 6 commits into
mainfrom
improve-api-entity-naming
May 21, 2026
Merged

Engineering Initiated - FE: Improve api entity naming#45865
RachelElysia merged 6 commits into
mainfrom
improve-api-entity-naming

Conversation

@RachelElysia

@RachelElysia RachelElysia commented May 20, 2026

Copy link
Copy Markdown
Member

Testing

  • QA'd all new/changed functionality manually

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

Summary by CodeRabbit

  • Refactor

    • Standardized TypeScript type naming conventions across the frontend for improved code clarity and consistency. Interface names now follow clearer patterns for distinguishing form data, API parameters, and response types throughout the codebase.
  • Bug Fixes

    • Corrected spelling errors in several type definitions.

Review Change Stack

@codecov

codecov Bot commented May 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 37.50000% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.78%. Comparing base (2535704) to head (fdb3942).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
frontend/services/entities/mdm.ts 0.00% 3 Missing ⚠️
frontend/services/entities/software.ts 25.00% 3 Missing ⚠️
frontend/services/entities/scripts.ts 0.00% 2 Missing ⚠️
...ities/components/AddCertAuthorityModal/helpers.tsx 0.00% 1 Missing ⚠️
...ties/components/EditCertAuthorityModal/helpers.tsx 0.00% 1 Missing ⚠️
frontend/services/entities/hosts.ts 0.00% 1 Missing ⚠️
frontend/services/entities/invites.ts 0.00% 1 Missing ⚠️
frontend/services/entities/mdm_apple.ts 0.00% 1 Missing ⚠️
frontend/services/entities/queries.ts 0.00% 1 Missing ⚠️
frontend/services/entities/teams.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #45865      +/-   ##
==========================================
- Coverage   66.78%   66.78%   -0.01%     
==========================================
  Files        2747     2748       +1     
  Lines      219860   219862       +2     
  Branches    10879    10879              
==========================================
+ Hits       146831   146832       +1     
- Misses      59760    59761       +1     
  Partials    13269    13269              
Flag Coverage Δ
frontend 55.62% <37.50%> (-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.

@RachelElysia
RachelElysia marked this pull request as ready for review May 20, 2026 13:42
Copilot AI review requested due to automatic review settings May 20, 2026 13:42
@RachelElysia
RachelElysia requested a review from a team as a code owner May 20, 2026 13:42

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

Pull request overview

Standardizes frontend API-related type names to better reflect their usage (request bodies vs params vs responses), aligning services, interfaces, and call sites with the documented naming convention.

Changes:

  • Renamed many API types to consistent suffixes (*FormData, *ApiParams/*QueryParams, *Response, *QueryKey) and updated downstream usages.
  • Cleaned up/standardized query-related typing by moving “edit query” typing to interfaces/schedulable_query.ts and removing the old duplicate in interfaces/query.ts.
  • Updated frontend documentation and Copilot rules to codify the naming convention.

Reviewed changes

Copilot reviewed 41 out of 41 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/services/entities/variables.ts Renames request/body types used by variables service.
frontend/services/entities/teams.ts Updates team user add/remove request body typings to *FormData.
frontend/services/entities/software.ts Renames app store / maintained app request body types to *FormData.
frontend/services/entities/scripts.ts Renames scripts params and run/batch request body types to *ApiParams/*FormData.
frontend/services/entities/queries.ts Updates query create/update typings to *FormData.
frontend/services/entities/mdm.ts Fixes SSO response type name and renames setup experience request body type.
frontend/services/entities/mdm_apple.ts Fixes typo in VPP token upload response type name.
frontend/services/entities/invites.ts Renames validate invite response type to *Response.
frontend/services/entities/installers.ts Renames installer existence request params type to *ApiParams.
frontend/services/entities/hosts.ts Renames host certs request params type to *ApiParams.
frontend/services/entities/device_user.ts Renames device user details/certs request params types to *ApiParams.
frontend/services/entities/command.ts Renames commands request params type to *ApiParams.
frontend/services/entities/charts.ts Renames chart request params type to *ApiParams.
frontend/services/entities/certificates.ts Renames certificate authority request body types to *FormData.
frontend/pages/queries/edit/EditQueryPage.tsx Updates query form typing; refactors debounced submit handler formatting.
frontend/pages/queries/edit/components/SaveNewQueryModal/SaveNewQueryModal.tsx Updates prop typing to new query *FormData type.
frontend/pages/queries/edit/components/SaveAsNewQueryModal/SaveAsNewQueryModal.tsx Updates initial query typing to new query *FormData type.
frontend/pages/queries/edit/components/EditQueryForm/EditQueryForm.tsx Updates submit/update callback typings to new query *FormData type.
frontend/pages/MDMAppleSSOPage/MDMAppleSSOPage.tsx Updates SSO response typing to corrected IMdmSSOResponse.
frontend/pages/ManageControlsPage/Variables/components/AddCustomVariableModal/AddCustomVariableModal.tsx Updates custom variable creation payload type to IVariableFormData.
frontend/pages/hosts/ManageHostsPage/components/RunScriptBatchModal/RunScriptBatchModal.tsx Updates batch run request type to IRunScriptBatchFormData.
frontend/pages/hosts/details/HostDetailsPage/HostDetailsPage.tsx Updates React Query key typing for host certificates params rename.
frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx Updates React Query key typing for device certificates params rename.
frontend/pages/DashboardPage/cards/ChartCard/ChartCard.tsx Updates chart query params typing to IChartApiParams.
frontend/pages/ConfirmSSOInvitePage/ConfirmSSOInvitePage.tsx Updates invite verify response typing to IValidateInviteResponse.
frontend/pages/ConfirmInvitePage/ConfirmInvitePage.tsx Updates invite verify response typing to IValidateInviteResponse.
frontend/pages/admin/ManageUsersPage/helpers/userManagementHelpers.tests.ts Updates user update body typing to IUserUpdateFormData.
frontend/pages/admin/ManageFleetsPage/TeamDetailsWrapper/UsersPage/UsersPage.tsx Updates add-users typing to INewTeamUsersFormData.
frontend/pages/admin/ManageFleetsPage/TeamDetailsWrapper/UsersPage/components/AddUsersModal/AddUsersModal.tsx Updates add-users modal prop typing to INewTeamUsersFormData.
frontend/pages/admin/IntegrationsPage/cards/CertificateAuthorities/components/EditCertAuthorityModal/helpers.tsx Updates edit CA helper typing to IEditCertAuthorityFormData.
frontend/pages/admin/IntegrationsPage/cards/CertificateAuthorities/components/AddCertAuthorityModal/helpers.tsx Updates add CA helper typing to IAddCertAuthorityFormData.
frontend/pages/AccountPage/AccountSidePanel/AccountSidePanel.tsx Updates version response typing to IVersionResponse.
frontend/interfaces/version.ts Renames version API interface to IVersionResponse.
frontend/interfaces/variables.ts Renames variable request body interface to IVariableFormData.
frontend/interfaces/user.ts Renames user update request body interface to IUserUpdateFormData.
frontend/interfaces/team.ts Renames team users/secrets request body interfaces to *FormData.
frontend/interfaces/schedulable_query.ts Renames query request body interfaces to *FormData and consolidates edit type.
frontend/interfaces/query.ts Removes duplicate IEditQueryFormData definition (now in schedulable_query.ts).
frontend/interfaces/mdm.ts Fixes typo in SSO response interface name.
frontend/docs/patterns.md Documents the naming convention and provides updated examples.
.claude/rules/fleet-frontend.md Adds frontend rule documenting the naming convention for API-related types.
Comments suppressed due to low confidence (2)

frontend/docs/patterns.md:112

  • The example path service/entities/users.ts doesn’t match the actual frontend directory structure (frontend/services/entities/...). Consider updating this to the correct path (and services plural) to keep the docs accurate.
// should be defined in service/entities/users.ts
interface IUpdateUserFormData {
  ...
}

frontend/docs/patterns.md:120

  • The example path service/entities/software.ts doesn’t match the actual frontend directory structure (frontend/services/entities/...). Consider updating this to the correct path (and services plural) to keep the docs accurate.
// should be defined in service/entities/software.ts
interface IGetSoftwareApiParams {
  ...
}
interface ISoftwareCountResponse {
  ...
}

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

Comment thread frontend/docs/patterns.md
Comment on lines 101 to 103
// should be defined in service/entities/hosts.ts
interface IHostDetailsReponse {
interface IHostDetailsResponse {
...
@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c425f0b7-d720-4940-a9c0-6bc640b8a6dc

📥 Commits

Reviewing files that changed from the base of the PR and between 61a2d11 and fdb3942.

⛔ Files ignored due to path filters (2)
  • .claude/rules/fleet-frontend.md is excluded by !**/*.md
  • frontend/docs/patterns.md is excluded by !**/*.md
📒 Files selected for processing (39)
  • frontend/interfaces/mdm.ts
  • frontend/interfaces/query.ts
  • frontend/interfaces/schedulable_query.ts
  • frontend/interfaces/team.ts
  • frontend/interfaces/user.ts
  • frontend/interfaces/variables.ts
  • frontend/interfaces/version.ts
  • frontend/pages/AccountPage/AccountSidePanel/AccountSidePanel.tsx
  • frontend/pages/ConfirmInvitePage/ConfirmInvitePage.tsx
  • frontend/pages/ConfirmSSOInvitePage/ConfirmSSOInvitePage.tsx
  • frontend/pages/DashboardPage/cards/ChartCard/ChartCard.tsx
  • frontend/pages/MDMAppleSSOPage/MDMAppleSSOPage.tsx
  • frontend/pages/ManageControlsPage/Variables/components/AddCustomVariableModal/AddCustomVariableModal.tsx
  • frontend/pages/admin/IntegrationsPage/cards/CertificateAuthorities/components/AddCertAuthorityModal/helpers.tsx
  • frontend/pages/admin/IntegrationsPage/cards/CertificateAuthorities/components/EditCertAuthorityModal/helpers.tsx
  • frontend/pages/admin/ManageFleetsPage/TeamDetailsWrapper/UsersPage/UsersPage.tsx
  • frontend/pages/admin/ManageFleetsPage/TeamDetailsWrapper/UsersPage/components/AddUsersModal/AddUsersModal.tsx
  • frontend/pages/admin/ManageUsersPage/helpers/userManagementHelpers.tests.ts
  • frontend/pages/hosts/ManageHostsPage/components/RunScriptBatchModal/RunScriptBatchModal.tsx
  • frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx
  • frontend/pages/hosts/details/HostDetailsPage/HostDetailsPage.tsx
  • frontend/pages/queries/edit/EditQueryPage.tsx
  • frontend/pages/queries/edit/components/EditQueryForm/EditQueryForm.tsx
  • frontend/pages/queries/edit/components/SaveAsNewQueryModal/SaveAsNewQueryModal.tsx
  • frontend/pages/queries/edit/components/SaveNewQueryModal/SaveNewQueryModal.tsx
  • frontend/services/entities/certificates.ts
  • frontend/services/entities/charts.ts
  • frontend/services/entities/command.ts
  • frontend/services/entities/device_user.ts
  • frontend/services/entities/hosts.ts
  • frontend/services/entities/installers.ts
  • frontend/services/entities/invites.ts
  • frontend/services/entities/mdm.ts
  • frontend/services/entities/mdm_apple.ts
  • frontend/services/entities/queries.ts
  • frontend/services/entities/scripts.ts
  • frontend/services/entities/software.ts
  • frontend/services/entities/teams.ts
  • frontend/services/entities/variables.ts
💤 Files with no reviewable changes (1)
  • frontend/interfaces/query.ts

Walkthrough

This PR applies systematic TypeScript interface refactoring across the Fleet frontend codebase to standardize naming conventions. Request-body types are renamed to form-data types (*Body*FormData) to better reflect their purpose as form submission payloads. API request-parameter types adopt consistent naming (*RequestParams*ApiParams). Additionally, several typos in response interface names are corrected (e.g., IMdmSSOReponseIMdmSSOResponse, IUploadVppTokenReponseIUploadVppTokenResponse). The changes propagate from interface definitions through service layers to component implementations across approximately 45 files with 94 ranges of modifications.

Possibly related PRs

  • fleetdm/fleet#44965: Modifies frontend/interfaces/variables.ts with variable payload type contract changes that overlap with this PR's type standardization effort.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Engineering Initiated - FE: Improve api entity naming' directly describes the main change: renaming API entity types across frontend code for improved naming conventions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ 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 improve-api-entity-naming

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.

@lukeheath lukeheath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

@RachelElysia
RachelElysia merged commit 4de604a into main May 21, 2026
30 checks passed
@RachelElysia
RachelElysia deleted the improve-api-entity-naming branch May 21, 2026 20:10
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.

4 participants