-
Notifications
You must be signed in to change notification settings - Fork 51
✨ Refactor issues api to insights api #2446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Changes needed to - URL endpoints - URL endpoint default filters (issues = insights.effort>0) - Model field renames `s/issue/insight` - Implicit filters for affected applications query Refactoring: - Update `rest.ts` - Extract and clean up analysis related rest functions Signed-off-by: Scott J Dickerson <[email protected]>
WalkthroughThe changes update the frontend codebase to support a conceptual shift from "Issues" to "Insights" in the analysis data model and API. This involves renaming properties, updating API endpoints, refactoring REST and query functions, and reorganizing related code to align with backend changes for insights support. Changes
Sequence Diagram(s)sequenceDiagram
participant UI
participant REST_Client
participant Backend
UI->>REST_Client: Fetch App Reports (now with insights)
REST_Client->>Backend: GET /analysis/app-reports (insight-based)
Backend-->>REST_Client: Paginated App Reports (with insights)
REST_Client-->>UI: App Reports Data
UI->>REST_Client: Fetch File Reports (insightId)
REST_Client->>Backend: GET /analysis/file-reports?insightId=...
Backend-->>REST_Client: File Reports (insight-based)
REST_Client-->>UI: File Reports Data
UI->>REST_Client: Fetch Incidents (insightId)
REST_Client->>Backend: GET /analysis/incidents?insightId=...
Backend-->>REST_Client: Incident Data
REST_Client-->>UI: Incident Data
Assessment against linked issues
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm error Exit handler never called! ✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
client/src/app/api/models.ts(3 hunks)client/src/app/api/rest.ts(20 hunks)client/src/app/api/rest/analysis.ts(1 hunks)client/src/app/pages/applications/components/import-applications-form/import-applications-form.tsx(2 hunks)client/src/app/pages/issues/affected-applications/affected-applications.tsx(2 hunks)client/src/app/pages/issues/issue-detail-drawer/file-incidents-detail-modal/file-all-incidents-table.tsx(1 hunks)client/src/app/pages/issues/issue-detail-drawer/file-incidents-detail-modal/file-incidents-detail-modal.tsx(1 hunks)client/src/app/pages/issues/issues-table.tsx(1 hunks)client/src/app/queries/issues.ts(0 hunks)
💤 Files with no reviewable changes (1)
- client/src/app/queries/issues.ts
🧰 Additional context used
🧬 Code Graph Analysis (3)
client/src/app/pages/issues/issue-detail-drawer/file-incidents-detail-modal/file-incidents-detail-modal.tsx (1)
client/src/app/queries/issues.ts (1)
useFetchIncidents(142-159)
client/src/app/pages/applications/components/import-applications-form/import-applications-form.tsx (1)
client/src/app/api/rest.ts (1)
APP_IMPORTS_SUMMARY_UPLOAD(62-62)
client/src/app/api/rest/analysis.ts (2)
client/src/app/api/models.ts (7)
HubRequestParams(23-33)BaseAnalysisRuleReport(638-640)AnalysisAppReport(621-635)BaseAnalysisIssueReport(643-646)AnalysisIssue(615-617)AnalysisFileReport(660-665)AnalysisIncident(667-674)client/src/app/api/rest.ts (1)
getHubPaginatedResult(109-121)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: unit-test
- GitHub Check: build-and-upload-for-global-ci
🔇 Additional comments (19)
client/src/app/pages/issues/issues-table.tsx (1)
36-38: LGTM - Import cleanup looks good.The removal of the duplicate import statement for
useFetchApplicationsimproves code organization and aligns with the broader refactoring effort mentioned in the PR objectives.client/src/app/pages/issues/issue-detail-drawer/file-incidents-detail-modal/file-all-incidents-table.tsx (1)
48-48: LGTM - Property name change aligns with API refactoring.The change from
fileReport.issueIdtofileReport.insightIdcorrectly reflects the terminology shift from "issues" to "insights" as described in the PR objectives. This maintains consistency with the updated data model.client/src/app/pages/applications/components/import-applications-form/import-applications-form.tsx (2)
17-17: LGTM - API endpoint constant updated correctly.The import statement correctly reflects the renamed constant from
UPLOAD_FILEtoAPP_IMPORTS_SUMMARY_UPLOAD, which aligns with the REST API reorganization mentioned in the PR objectives.
60-60: LGTM - Endpoint usage updated consistently.The axios POST request correctly uses the new
APP_IMPORTS_SUMMARY_UPLOADconstant, maintaining consistency with the import change and the API reorganization effort.client/src/app/pages/issues/issue-detail-drawer/file-incidents-detail-modal/file-incidents-detail-modal.tsx (1)
43-43: LGTM - Property name change aligns with data model updates.The change from
fileReport.issueIdtofileReport.insightIdcorrectly reflects the updated data model where theAnalysisFileReportinterface property has been renamed. This maintains consistency with the broader "issues" to "insights" refactoring effort.client/src/app/pages/issues/affected-applications/affected-applications.tsx (3)
84-84: LGTM - Filter field updated to use insight terminology.The change from
issue.rulesettoinsight.rulesetcorrectly reflects the updated data model where theissueproperty has been renamed toinsight. This maintains consistency with the broader API refactoring effort.
89-89: LGTM - Filter field updated consistently.The change from
issue.ruletoinsight.rulemaintains consistency with the previous filter field change and aligns with the updated data model terminology.
241-241: LGTM - Component prop updated to use insight terminology.The change from
activeItem?.issue.idtoactiveItem?.insight.idcorrectly updates theissueIdprop passed to theIssueDetailDrawercomponent, maintaining consistency with the broader refactoring from "issue" to "insight" terminology.client/src/app/api/models.ts (2)
619-635: LGTM! Terminology correctly updated from "issue" to "insight"The interface changes properly reflect the conceptual shift from "issues" to "insights" in the data model.
661-661: Property name correctly updated to match new terminologyThe rename from
issueIdtoinsightIdmaintains consistency with the overall refactoring effort.client/src/app/api/rest/analysis.ts (2)
1-13: Good modularization of analysis-related API functionsThe extraction of analysis functions into a dedicated module improves code organization and maintainability.
14-22: Endpoint URLs correctly updated with insights terminology and filtersThe URL constants properly reflect the shift to "insights" and include the
effort>0filter as specified in the PR objectives.client/src/app/api/rest.ts (7)
48-50: New model imports correctly addedThe addition of
AnalysisDependencyandAnalysisAppDependencyimports aligns with the new analysis-related functionality.
103-103: Good use of barrel export for analysis moduleExporting all analysis-related functions from the dedicated module maintains backward compatibility while improving code organization.
105-122: Well-implemented generic pagination helperThe
getHubPaginatedResultfunction provides a clean, reusable pattern for handling paginated API responses. Good defensive programming with the fallback to 0 for missing headers.
88-90: Clarify the TODO comments for tracker endpointsThe TODO comments suggest these constants might be incomplete. Please clarify if these need to be prefixed with a base path.
125-166: Well-structured application dependencies API functionsThe new dependency-related functions follow consistent patterns and properly utilize the generic pagination helper.
302-308: Useful batch update helper for applicationsThe
updateAllApplicationsfunction provides a convenient way to handle multiple application updates with proper error handling.
556-556: Good explicit return type specificationMaking the
Promise<void>return type explicit improves type safety and code clarity.
Changes needed to - URL endpoints - URL endpoint default filters (issues = insights.effort>0) - Model field renames `s/issue/insight` - Implicit filters for affected applications query Refactoring: - Update `rest.ts` - Extract and clean up analysis related rest functions Resolves: konveyor#2444 Part of: https://issues.redhat.com/browse/MTA-5459 Signed-off-by: Scott J Dickerson <[email protected]>
Changes needed to
s/issue/insightRefactoring:
rest.tsResolves: #2444
Part of: https://issues.redhat.com/browse/MTA-5459
Summary by CodeRabbit
Refactor
Bug Fixes
Chores