Engineering Initiated - FE: Improve api entity naming - #45865
Conversation
Codecov Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.tsand removing the old duplicate ininterfaces/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.tsdoesn’t match the actual frontend directory structure (frontend/services/entities/...). Consider updating this to the correct path (andservicesplural) 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.tsdoesn’t match the actual frontend directory structure (frontend/services/entities/...). Consider updating this to the correct path (andservicesplural) 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.
| // should be defined in service/entities/hosts.ts | ||
| interface IHostDetailsReponse { | ||
| interface IHostDetailsResponse { | ||
| ... |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (39)
💤 Files with no reviewable changes (1)
WalkthroughThis PR applies systematic TypeScript interface refactoring across the Fleet frontend codebase to standardize naming conventions. Request-body types are renamed to form-data types ( Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Testing
For unreleased bug fixes in a release candidate, one of:
Summary by CodeRabbit
Refactor
Bug Fixes