-
Notifications
You must be signed in to change notification settings - Fork 147
Add MTTR and Change Failure Rate overlays #102
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f31f7eb
adds necessary components for the change-failure-rate overlay
e-for-eshaan d9597c1
adds overlay for MTTR
e-for-eshaan f399082
adds overlay link to the overlay-button
e-for-eshaan b359164
removes logs and imports the icon
e-for-eshaan 39abd4d
necessary files for the MTTR overlay
e-for-eshaan f757aa0
removes redundant-integrations code from the PRtable
e-for-eshaan eb9d54e
updates the API to allow sending of PR filters into the params
e-for-eshaan fa6d18f
adds org id to params to calculate pr-filters
e-for-eshaan 5558dd7
passes org id as param to fetchAllDeploymentsWithIncidents
e-for-eshaan 4583402
fixes CFR-overlay breaking on reload
e-for-eshaan e2b5b95
removes PR data from get_incidents API
e-for-eshaan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
web-server/src/components/OverlayComponents/ChangeFailureRate.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { FlexBox } from '../FlexBox'; | ||
|
|
||
| export const ChangeFailureRate = () => { | ||
| return <FlexBox>ChangeFailureRate</FlexBox>; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 122 additions & 0 deletions
122
web-server/src/content/DoraMetrics/DeploymentWithIncidentsMenuItem.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| import { AccessTimeRounded, ArrowForwardRounded } from '@mui/icons-material'; | ||
| import BugReportOutlinedIcon from '@mui/icons-material/BugReportOutlined'; | ||
| import NearbyErrorIcon from '@mui/icons-material/NearbyError'; | ||
| import { Card, useTheme } from '@mui/material'; | ||
| import { format } from 'date-fns'; | ||
| import Link from 'next/link'; | ||
| import pluralize from 'pluralize'; | ||
| import { FC } from 'react'; | ||
| import { FaExternalLinkAlt } from 'react-icons/fa'; | ||
|
|
||
| import { FlexBox } from '@/components/FlexBox'; | ||
| import { Line } from '@/components/Text'; | ||
| import { DeploymentWithIncidents } from '@/types/resources'; | ||
| import { getDurationString } from '@/utils/date'; | ||
| import { OPEN_IN_NEW_TAB_PROPS } from '@/utils/url'; | ||
|
|
||
| export const DeploymentWithIncidentsMenuItem: FC<{ | ||
| deployment: DeploymentWithIncidents; | ||
| selected: boolean; | ||
| onSelect: (dep: DeploymentWithIncidents) => any; | ||
| }> = ({ deployment, selected, onSelect }) => { | ||
| const theme = useTheme(); | ||
| const incidents = deployment.incidents; | ||
|
|
||
| return ( | ||
| <FlexBox | ||
| key={deployment.id} | ||
| component={Card} | ||
| p={1} | ||
| width="280px" | ||
| pointer | ||
| sx={{ | ||
| bgcolor: !onSelect && selected ? theme.colors.info.lighter : undefined, | ||
| transition: 'background-color 0.2s', | ||
| boxShadow: selected ? `0 0 0 3px ${theme.colors.info.main}` : undefined, | ||
| ':hover': { bgcolor: theme.colors.info.lighter } | ||
| }} | ||
| onClick={() => onSelect(deployment)} | ||
| > | ||
| <FlexBox fill alignCenter justifyBetween gap1> | ||
| <FlexBox col flex1> | ||
| <FlexBox alignCenter gap={1 / 2}> | ||
| <NearbyErrorIcon color="error" fontSize="inherit" /> | ||
| <Line tiny bold> | ||
| Run on{' '} | ||
| {format(new Date(deployment.conducted_at), 'do, MMM - hh:mmaaa')} | ||
| </Line> | ||
| {deployment.html_url && ( | ||
| <Link | ||
| passHref | ||
| href={deployment.html_url} | ||
| {...OPEN_IN_NEW_TAB_PROPS} | ||
| > | ||
| <Line | ||
| tiny | ||
| sx={{ | ||
| transform: 'scale(0.9)', | ||
| transition: 'all 0.2s', | ||
| ':hover': { color: 'info.main' } | ||
| }} | ||
| > | ||
| <FaExternalLinkAlt /> | ||
| </Line> | ||
| </Link> | ||
| )} | ||
| </FlexBox> | ||
| <FlexBox alignCenter justifyBetween fullWidth> | ||
| <FlexBox | ||
| alignCenter | ||
| gap={1 / 4} | ||
| title={`This deployment may have led to ${ | ||
| incidents.length | ||
| } ${pluralize('incident', incidents.length)}`} | ||
| tooltipPlacement="left" | ||
| > | ||
| <BugReportOutlinedIcon fontSize="inherit" /> | ||
| <Line | ||
| tiny | ||
| sx={{ whiteSpace: 'nowrap', transform: 'translateY(1px)' }} | ||
| > | ||
| {incidents.length} {pluralize('incident', incidents.length)} | ||
| </Line> | ||
| <Line | ||
| small | ||
| mono | ||
| px={1 / 2} | ||
| color="info" | ||
| sx={{ | ||
| overflow: 'hidden', | ||
| textOverflow: 'ellipsis', | ||
| whiteSpace: 'nowrap', | ||
| maxWidth: '100px' | ||
| }} | ||
| > | ||
| {deployment.head_branch} | ||
| </Line> | ||
| </FlexBox> | ||
| <FlexBox | ||
| alignCenter | ||
| gap={1 / 4} | ||
| title={`This deployment took ${getDurationString( | ||
| deployment.run_duration | ||
| )} to run`} | ||
| tooltipPlacement="right" | ||
| > | ||
| <AccessTimeRounded fontSize="inherit" /> | ||
| <Line small sx={{ whiteSpace: 'nowrap' }}> | ||
| {getDurationString(deployment.run_duration)} | ||
| </Line> | ||
| </FlexBox> | ||
| </FlexBox> | ||
| </FlexBox> | ||
| {onSelect && ( | ||
| <ArrowForwardRounded | ||
| fontSize="small" | ||
| color={selected ? 'info' : undefined} | ||
| /> | ||
| )} | ||
| </FlexBox> | ||
| </FlexBox> | ||
| ); | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.