Skip to content
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

feat: project insights resource with hardcoded data #6610

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

kwasniew
Copy link
Contributor

@kwasniew kwasniew commented Mar 19, 2024

About the changes

Hardcoded data powering this screen:
Screenshot 2024-03-19 at 16 26 34

This PR introduces a new resource (/insights) and corresponding openapi schemas.

Important files

Discussion points

Copy link

vercel bot commented Mar 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Mar 19, 2024 3:26pm
unleash-monorepo-frontend ⬜️ Ignored (Inspect) Visit Preview Mar 19, 2024 3:26pm

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: FAILED

  • Declining Code Health: 2 findings(s) 🚩
  • Improving Code Health: 0 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Detailed -- Inspect the code that degrades in code health.
View detailed results in CodeScene

🚩 Declining Code Health (highest to lowest):

@@ -20,16 +20,14 @@ import {
deprecatedProjectOverviewSchema,
type ProjectDoraMetricsSchema,
projectDoraMetricsSchema,
projectInsightsSchema,

Choose a reason for hiding this comment

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

❌ New issue: Code Duplication
The module contains 2 functions with similar structure: ProjectController.getDeprecatedProjectOverview,ProjectController.getProjectOverview

Why does this problem occur?

Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health. Read more.

To ignore this warning click here.

Comment on lines +122 to +141
this.route({
method: 'get',
path: '/:projectId/insights',
handler: this.getProjectInsights,
permission: NONE,
middleware: [
this.openApiService.validPath({
tags: ['Unstable'],
operationId: 'getProjectInsights',
summary: 'Get an overview of a project insights.',
description:
'This endpoint returns insights into the specified projects stats, health, lead time for changes, feature types used, members and change requests.',
responses: {
200: createResponseSchema('projectInsightsSchema'),
...getStandardResponses(401, 403, 404),
},
}),
],
});

Choose a reason for hiding this comment

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

❌ Getting worse: Large Method
ProjectController.constructor increases from 128 to 145 lines of code, threshold = 70

Why does this problem occur?

Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function. Read more.

To ignore this warning click here.

@@ -287,3 +287,15 @@ test('response should include last seen at per environment for multiple environm

expect(body.features[1].lastSeenAt).toBe('2023-10-01T12:34:56.000Z');
});

test('project insights happy path', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

smoke test for now

@kwasniew kwasniew merged commit 03a84e2 into main Mar 19, 2024
8 of 9 checks passed
@kwasniew kwasniew deleted the project-insights-resource-hardcoded-data branch March 19, 2024 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants